Forum Jump :

Author Message


Posts: 38
Rank:


Level: Member

Country: tz
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2014-05-17 18:06        
     
I am trying to get my spawned units to stop moving at one particular waypoint, then move when there is more than 5 units.
trg1=0;
_wp1=0;

trg1 attachto[_wp1,[0,0,0]];

_wp1= mygroup1 addwaypoint [getmarkerpos "waypoint1",0];
_wp1 setWaypointType "MOVE";
_wp1 setWaypointFormation "LINE";
_wp1 setWaypointSpeed "FULL";



_wp2= mygroup1 addwaypoint [getmarkerpos "waypoint2",0];
_wp2 setWaypointType "MOVE";
_wp2 setWaypointFormation "Line";
_wp2 setWaypointSpeed "FULL";



_wp3= mygroup1 addwaypoint [getmarkerpos "waypoint3",0];
_wp3 setWaypointType "SAD";
_wp3 setWaypointFormation "WEDGE";
_wp3 setWaypointSpeed "FULL";

I have the spawn and waypoints working well in game, but my attempt at trigger control just breaks the script.Taking out "trg1 attachto[_wp1,[0,0,0]];" it works great. the named "trg1" in game is a delta trigger, I have also tried creating a new local trigger
//_trg1 = createTrigger ["emptydetector",getmarkerpos "waypoint1"];
//_trg1 setTriggerActivation ["any","present",true];
//_trg1 setTriggerStatements ["east countSide thislist >=5","",""];
thanks for looking.
the spawning script that can customize unit and time to respawn

Added 1 hour 6 minutes later:

my temporary workaround is to break the scripts into pieces and have the Editor triggers activate scripts separately. The trigger conditions are "this and east countSide thislist >=5". I hope this helps any future problem solvers. Any help with linking triggers and waypoints will still be appreciated.

Added 1 hour 55 minutes later:

somewhat related question. Would anyone know where to start if I wanted to have a new group created with each new spawn. I thought "_var= [] call bns_fnc_selectrandom;" might provide something if the array was infinity huge, but thats a shot in the dark.

This post was edited by alphapan (2014-05-17 21:12, ago)


Author Message


Posts: 1484
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#2 Posted at 2014-05-17 21:13        
     
This would sync a trigger to a waypoint


_wp1= mygroup1 addwaypoint [getmarkerpos "waypoint1",1];
_wp1 setWaypointType "MOVE";
_wp1 setWaypointFormation "LINE";
_wp1 setWaypointSpeed "FULL";

_trg1 = createTrigger ["emptydetector",getmarkerpos "waypoint1"];
_trg1 setTriggerActivation ["any","present",true];
_trg1 setTriggerStatements ["east countSide thislist >=5","",""];
_trg1  synchronizeTrigger [[mygroup1, 0], _wp1];
_trg1 setTriggerType "switch";
_trg1 attachto[_wp1,[0,0,0]];


Advertisement


Author Message


Posts: 38
Rank:


Level: Member

Country: tz
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2014-05-18 01:17        
     
Thanks for the response everything works great now. :-D