| 07-10-2006, 02:36 AM | #1 |
How can i do this? when a unit is selected a trigger finds what region the selected unit is on and then makes circles of Power around the unit(some units will have more then others). When a circle is clicked the unit will move to the center of the circle. Circles can't be created in areas were land is (water map). Anyone how what to do? |
| 07-10-2006, 09:02 AM | #2 |
ok i not useing the regions any more, i've decided to use offsets, by i still dont know how to make sure the circles of power are not created in the land region. Also when i select the unit i want that selected unit to go into a var. This is what i ahve so far. Movement: ![]() Events![]() unit - Human Battleship 0000 <gen> is selected![]() Conditions![]() Actions![]() Set Selected_Unit = (Picked unit)![]() Unit - create 1 Circle of Power (large) for Player 1 (Red) at ((Position of Selected_unit) offset by (1.00, 1.00)) faceing default building facing degrees |
| 07-10-2006, 05:34 PM | #3 |
Place a dummy unit marker in the land spaces, and when you detect that the land marker is within range of the circle of power you want to create, don't create that circle of power. Alternatively pre-place the circles of power and don't place them on the land places. Convert control of those nearby circles to whoever you want to. I have a map I created last time, doesn't do anything much but is a possible system you might want to use. |
| 07-10-2006, 07:18 PM | #4 |
Assuming that all movement is made in predetermined steps and limited to a grid, I think using rects would actually be much more effective; however, I would suggest setting up the rects with a trigger rather than by hand. You could index all the rows and modulo the index by the number of rects in each row to determine the column. The circles of power, however, require that you create triggers that fire when they are selected since selection of a unit is only a specific unit event. Of course you could also use Ant's method and preplace all the circles of power and create triggers for them. |
| 07-10-2006, 08:46 PM | #5 |
What i would do: Preplace all the circles. Wherever you want. At map init Hide all the circles. When you want them visable, get all circles in a range (a range the right size so only the 8 circles(or less) is picked up) and show them. Then when a unit selects that circle, order the unit to move to that loc, and hide them all again. |
| 07-10-2006, 09:03 PM | #6 |
That also depends on if the map is multiplayer or not. If single player, Tide's idea would work. However, if MP, I would create them on the fly as units for the moving player, then give them perm invis so enemies wouldnt be able to see the potential moves. Would look more professional. Plus, if you use rects it's not hard to get a rect center. :P |
| 07-10-2006, 11:42 PM | #7 |
A good way of doing this would be by setting points offset by xnumber towards (Integer A) x 45 using a for each integer A from 1 to 8 loop everytime a player selects a unit. Then you check in what region the points landed, then check if the regions contain obstacles and if yes you DONT create a circle and if there's no obstacle you create a circle. Then whatever happens next. |
| 07-11-2006, 09:05 AM | #8 | |
Quote:
That variable is totaly wrong, you MUST use "Triggering Unit" or you cant detect the selected unit. Try adding, 0 collison to the circle of power, None pathing map or make it a ward. |
| 07-11-2006, 09:18 AM | #9 |
TideHunter's idea sounds the most practical to me; unless you can't use it for some specific reason. |
| 07-11-2006, 07:14 PM | #10 |
Yup his idea requires less regions and less working around ![]() |
| 07-12-2006, 03:12 AM | #11 |
Ant could you tell me how your movement part of your map works? I was reading over the part when it makes an item a region, is the item what makes the unit move? how does it know what circle you selected? |
