Jump to content
Sign in to follow this  
sturmfalkerda

Going crazy!! Stupid syntax error

Recommended Posts

This is driving me up a wall, I get errors such as "Missing ], Missing ;, Type Array expected object" Depending on how I change this. Can somebody fix my horrible syntax?

Thanks!

Mission1.sqf called on a Mission Module with nul = [] execvm "Mission1.sqf"; (Assuming this is how I am supposed to do this.... LOL)

The line so far with problems is the one with statements....

_pos1t = getMarkerPos "Teleport1";
_grp1t = Walrustest;
_wp1t = _grp1t addWaypoint [_pos1t, 0];
[_grp1t, 0] setWaypointType "MOVE";
[_grp1t, 0] setWaypointBehaviour "SAFE";
[_grp1t, 0] setWaypointType "MOVE";
[_grp1t, 0] setWaypointSpeed "FULL";
[_grp1t, 0] setWaypointStatements "true", [walrustest [""end1"", true, true] call BIS_fnc_endMission,];

//myRespawnInventory = [west,"WEST1", "WEST2", "WEST3", "WEST4", "WEST5", "WEST6"] call BIS_fnc_addRespawnInventory;
PAPABEAR=[West,"HQ"]; PAPABEAR SideChat "Loading Complete";

Share this post


Link to post
Share on other sites

waypoint setWaypointStatements [condition, statement] 
Parameters:
   waypoint: Array - format Waypoint 
   [condition, statement]: Array
   condition: String
   statement: String
Return Value:
   Nothing 
//---Example code for future reference---//
new_wp setWaypointStatements ["true", "diag_log ['GroupLeader: ', this]; diag_log ['Units: ', thislist]"];

I think you want if the group is alive and at the waypoint so try this.

[_grp1t, 0] setWaypointStatements ["alive walrustest","[""end1"", true, true] call BIS_fnc_endMission"];

Share this post


Link to post
Share on other sites

Thank you so much!

No more errors. I tried so many different ways, brackets and stuff. :|

Problem though, the AI gives a move to order "Sounds like Move to 0,0,0,0,0,0,0" and they do nothing but get in formation, so I cant really see if it will end the mission.

I should squad up and see where the waypoint goes.

Leader has the following on him

walrustest = group this;

The marker type is a circle and the whole thing is being called from a init on a strategic map mission module.

nul = [] execvm "Mission1.sqf";

**EDIT**

The marker name was Teleport, not Teleport1, LOL.... They now move to the marker, but no mission end. I basically want the mission to end when a group member (or whole group, or a certain group member) finishes the waypoint.

https://community.bistudio.com/wiki/setWaypointStatements

Different sites say different things..

BisSim has a great example of the alive thing in use, BisStudio wiki has more info (and most likely more up to date)

I still love Arma 3. XD

Parameters:

waypoint: Waypoint

condition: String - if true then group will execute the defined statement and continue to the next waypoint; if false then group will wait at this waypoint until it's set to true.

statement: String - Code to execute when waypoint is completed ("this" is available, and contains the group leader). Set to an emtpty string ("") if no special action should be performed

The waypoint is done only when the condition is fulfilled. When the waypoint is done, the statement expression is executed.

Within the Condition & Statement code string:

this refers to the group leader

thislist refers to an array containing each unit in the group

Edited by SturmFalkeRDA

Share this post


Link to post
Share on other sites

AddWaypoint will add a waypoint , so thats why they are moving. All your other waypoint commands you are adding to index 0 (e.g [_grp1t, 0] ).

Never use the group, index array to set up your waypoints, you can not guarantee you are configuring the right one. Instead use the return from the addWaypoint command.

_wp1t = _grp1t addWaypoint [_pos1t, 0];  //0 here is random radius of waypooint position not waypoint index
_wp1t setWaypointType "MOVE";

When placing a group/units in the editor they are automatically given a waypoint of index 0 set at their starting location. So by the time you add a new one ( at index 1) index 0 is already complete and forgotten about so the extra's you add to it are basically ignored.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×