Jump to content
Sign in to follow this  
scottb613

Scripted Waypoint Statements

Recommended Posts

Hi Folks,

 

I'm trying to make a scripted waypoint - report on completion - via the side chat.  Spent hours and hours on this - I just want to report arrival at waypoint with a group count. 

 

From past experience - on simpler statements - I had to assemble a string for use with "setWaypointStatements".

 

Any suggestions appreciated.

 

// Build the string manually
private _strReport = format [
    "private _grp = %1;
     private _wpName = '%2';
     private _groupLeader = leader _grp;
     private _groupLeaderName = name _groupLeader;
     private _groupName = groupId _grp;
     if (_groupName == '') then { _groupName = format ['%1''s group', _groupLeaderName]; };
     private _memberCount = count units _grp;
     [[_groupLeader], 'SIDE', format ['%1: Reached waypoint %2 with %3 members.', _groupName, _wpName, _memberCount]] remoteExec ['sideRadio'];
    ", _grp, _markerName];

// Set the waypoint statement
_wp setWaypointStatements ["true", _strReport];

 

Thanks.

 

Regards,
Scott

Share this post


Link to post
Share on other sites

the format is not going to work because _grp will become string and not the actual variable

 

its better to put the code in function like this:

private strReport = {

 // Rest of the code here

};

 

Then call it like this:

 

_wp setWaypointStatements ["true", "call strReport"];

 

 

  • Like 2

Share this post


Link to post
Share on other sites

Hi...

 

Thanks - I'll give that a try.

 

Regards,
Scott

Share this post


Link to post
Share on other sites

Hi...

 

Thanks much - I'm certainly no expert but I've written many scripts to do many things - this one is giving me fits. I'll take a look.

 

Regards,
Scott

Share this post


Link to post
Share on other sites

Remember, setWaypointStatements works with this & thisList within the Condition & Statement code string. Utilize these for the information you seek to display

On 9/26/2024 at 9:23 AM, scottb613 said:

I just want to report arrival at waypoint with a group count

 

  • Like 1

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  

×