• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

adding positive circle to a region covers the map?!

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
What I want: to store a region behind my Car unit and apply the OilSlick behavior to units in that region.

Problem: When I add a positive circle 4 units behind my car with a radius of 0.01 it somehow contains every unit in the entire map! The trigger is below. The effect is to put the Oilslick behavior on everyone in the map.

Why on earth would a positive circle with a radius of .01 be that huge?


  • Region - Add a Positive circle centered at ((Position of Cars[tempPlayerNumber].Unit) offset by 4.0 towards ((Facing of Cars[tempPlayerNumber].Unit) - 180.0) degrees) with radius 0.01 to OilSlickedRegion
  • Unit Group - Pick each unit in (Any units in OilSlickedRegion owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
    • Debug - Display (Name of (Unit type of (Picked unit))) as debug output using Type 01, and Do display it in the game window
    • Unit - Add 1 Oil Slicked to (Picked unit) from Cars[tempPlayerNumber].Unit
 
Level 9
Joined
Dec 21, 2006
Messages
490
i don't understand why you are using a region at all. you can filter with unit groups.
i would select all units in range and if they are located behind your car ( determine with the help of the facing angle of your car) apply behavior.
this all could be done with data only too.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
i would select all units in range and if they are located behind your car ( determine with the help of the facing angle of your car) apply behavior.
Slipping on oil has nothing to do with the current position or orientation of the car, only where it was placed by the car.

What he wants to do is make certain areas of the map "oil slick". When another car drives over these areas they then are effected by it. The oil will logically wash away (vanish) over time.

Why on earth would a positive circle with a radius of .01 be that huge?
Two possible explinations.
1. The region already is that huge to start with (entire map area). You then add a small positive circle to an already positive map which makes no difference at all.
2. The circle is too small. The game might not resolve area that well and so is forced to make it the entire map in size.

There is a data editor only approach for this. Use a persistant effect that lasts for a while that acts as the oil slick. This would be mechancily similar to Psyonic Storm, the High Templar ability that creates a persistent area of damage while the High Templar is free to move. This has the advantage of being very easy to do and needing no triggers but has the disadvantage of creating data threads which might not make it suitable if you want to cover the map in trails of oil.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Slipping on oil has nothing to do with the current position or orientation of the car, only where it was placed by the car.

What he wants to do is make certain areas of the map "oil slick". When another car drives over these areas they then are effected by it. The oil will logically wash away (vanish) over time.


Two possible explinations.
1. The region already is that huge to start with (entire map area). You then add a small positive circle to an already positive map which makes no difference at all.
2. The circle is too small. The game might not resolve area that well and so is forced to make it the entire map in size.

There is a data editor only approach for this. Use a persistant effect that lasts for a while that acts as the oil slick. This would be mechancily similar to Psyonic Storm, the High Templar ability that creates a persistent area of damage while the High Templar is free to move. This has the advantage of being very easy to do and needing no triggers but has the disadvantage of creating data threads which might not make it suitable if you want to cover the map in trails of oil.

Thanks to you both (+rep of course).

I tried making a larger region at first, and I initialize the region to no region in the trigger. I appear to have found the problem, but I haven't replicated it in a new map to establish the principle.

Solution: the oil slick is made up of 3 circles, and I would add them all to an empty region. That didn't work, but when set the region equal to the first circle (rather than "adding" it) and then added the second two regions that did work.

I'm not sure if it's a general principle, but if anyone out there is making big regions by adding them, I recommend setting your variable equal to a region first, then adding the other regions to it.

p.s. Dr. Good, I had the sense that there was probably an easy data way to do this, but I'm so scared of the data editor from the early days that I'm doing absolutely everything I can in the trigger editor.
 
Status
Not open for further replies.
Top