so here is the deal I'm just trying to make it so that when i bring my marine near any command center the player will have a button displayed on there screen saying enter command but the enter/leave unit range trigger will not allow me to find a unit that has not been pre-set. For example the map starts nothing is placed on the map (no units) after all options have been chosen units spawn, now there is a unit you control and a command center for a computer player you are allied to. Now what i want to do is simply just walk near the command center the button pops up and you click enter sounds easy right well, its not lol. the unit you play as is determined with a variable and works great, but the command center part is where i have trouble with i can't even use variables so there is no way for me to specify the unit. If you know how to do this or have any work around please let me know.
hey man thanks for the quick response but i still can't get it going the problem is i cant use a variable to determine "My Marine" well i can but i mean i can't use a variable on that last part of the event. Unless I'm just a huge noob which is probably the case.
1) Make your marine variable constant. this will display this var in event selection list
but fyeah, you dont need a constant variable :D if you preplace CC - theres the best way
2) Okay, you can make a region (in editor or dynamically in trigger)
but w00t - region needs to be constant - so if you know size of cc - you can make region and move it to position (not tested)
3) and t3h galaxy hack
place this in your initialization/start trigger, where all vaiables are known
hi guys, I'm trying to do sort of the reverse of this. I have 1 unit that chases another and if the gap between them gets to big I want to run a trigger. So I figured event: unit enters/leaves range of unit; would work for this idea but also like about the unit I want to center the event on does not exist at the beginning of the game and can not be made a constant variable. I like the idea of using the scripting but am not sure how to implement it.
I put this code in my initialization trigger General - Custom Script: TriggerAddEventUnitRange(gt_Movement, null, gv_vUnit[1], 5.0, true);
and set the action in the trigger to kill triggering unit (just to test) but nothing happens. I'm not surprised considering I've never used scripting beyond calling functions. :-). Help is much appreciated thanks.
*Edit
I got the kill unit when it comes close thing working so now I just need to know how to reverse it. Unit leaving range rather than unit enter.
so here is the deal I'm just trying to make it so that when i bring my marine near any command center the player will have a button displayed on there screen saying enter command but the enter/leave unit range trigger will not allow me to find a unit that has not been pre-set. For example the map starts nothing is placed on the map (no units) after all options have been chosen units spawn, now there is a unit you control and a command center for a computer player you are allied to. Now what i want to do is simply just walk near the command center the button pops up and you click enter sounds easy right well, its not lol. the unit you play as is determined with a variable and works great, but the command center part is where i have trouble with i can't even use variables so there is no way for me to specify the unit. If you know how to do this or have any work around please let me know.
hey man thanks for the quick response but i still can't get it going the problem is i cant use a variable to determine "My Marine" well i can but i mean i can't use a variable on that last part of the event. Unless I'm just a huge noob which is probably the case.
1) Make your marine variable constant. this will display this var in event selection list
but fyeah, you dont need a constant variable :D if you preplace CC - theres the best way
2) Okay, you can make a region (in editor or dynamically in trigger)
but w00t - region needs to be constant - so if you know size of cc - you can make region and move it to position (not tested)
3) and t3h galaxy hack
place this in your initialization/start trigger, where all vaiables are known
TTT - trigger name with come_to_cc event
and MMM - variable My Marine
hey thanks for all the help guys that solved my issue really appreciate it.
how do you make a trigg unit IN region, not units enter/leave...
dunno maybe make a variable inregion turn true when it enters and false when leaves..
and make a smthing to check if its still true lol
Pick all units in X region add to unit group Y
So far this is the only way to get the units in a region that i've found that works reliably.
hi guys, I'm trying to do sort of the reverse of this. I have 1 unit that chases another and if the gap between them gets to big I want to run a trigger. So I figured event: unit enters/leaves range of unit; would work for this idea but also like about the unit I want to center the event on does not exist at the beginning of the game and can not be made a constant variable. I like the idea of using the scripting but am not sure how to implement it.
I put this code in my initialization trigger General - Custom Script: TriggerAddEventUnitRange(gt_Movement, null, gv_vUnit[1], 5.0, true); and set the action in the trigger to kill triggering unit (just to test) but nothing happens. I'm not surprised considering I've never used scripting beyond calling functions. :-). Help is much appreciated thanks.
*Edit I got the kill unit when it comes close thing working so now I just need to know how to reverse it. Unit leaving range rather than unit enter.