Forum Jump :

Author Message


Posts: 3
Rank:


Level: Member

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

 
#1 Posted at 2014-06-25 19:12        
     
hey :)
i have a little problem concerning the Waypoint-system:
i use
wp = (group this) addWaypoint [player,0]; 
wp setWaypointType "JOIN";

in a unit's init field placed in the editor.
i want to use this "functionality" in a .sqf file later,
so just placing a waypoint in the editor is not an option.

Does anybody know how to get that running?
the group moves to the position where the player is, but doesn't join player's group.

This post was edited by piluspalus (2014-06-25 19:20, ago)


Author Message


Posts: 131
Rank:


Level: Member

Country: us
Location:
Occupation:
Age: 22
In-game name: Joshua

 
#2 Posted at 2014-06-26 02:19        
     
When I spawn waypoints I generally just use 'move' and 'search and destroy'. For any other special stuff I just custom script things for when the waypoints are completed. In this case you could use the join command (https://community.bistudio.com/wiki/join). At the bottom of the wiki page is a 'See Also' section with several variations on joining a group for more advanced customization.


Advertisement


Author Message


Posts: 3
Rank:


Level: Member

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

 
#3 Posted at 2014-06-27 10:35        
     
ok so you set the custom sripts via setWaypointStatements ["bla","blubb"] ?
because the problem is, these statements are executed in their own scope, so you just have a reference to the group's leader, who has the waypoint and nothing else...

But i solved the problem now: i just changed my code, so that i just don't need any other references in the waypoint's statements than the group leader.

for others:
i think the waypointType "JOIN" just doesn't work for dynamically created waypoints.
it may be a solution to do: (group a wants to join group b)
_leaderofA = leader a;
_leaderofA setVariable [groupToJoin, b];
a addWaypoint [b,0];
a setWaypointType "JOIN"; //i think in this case you could also use "MOVE"
a setWaypointStatetements 
["","_toGroup = this getVariable ""groupToJoin""; {_x join toGroup;} forEach (units (group this));"];
note : i didnt test this code (so syntax errors are possible) but it should work






Tags: Join, Waypoint