Jump to content
Sign in to follow this  
{USI}_Zombie

setwaypointstatements problem

Recommended Posts

I am using the following command in a script after I create the waypoint:

[west1,1] setwaypointstatements ["true",[] exec "talondone.sqs"]

And I get the error type any expected string as soon as the above line is run, and also the script "talondone.sqs" is executed right away, even though I am far from the waypoint. It was my understanding that the script wouldn't be called until I completed the waypoint. The biki is not much help in this area, anyone have any ideas?

I also tried this script this way:

[west1,1] setwaypointstatements ["true","[] exec "talondone.sqs""]

and got a different error, which sadly I didn't write down. Am I using this code incorrectly?

Share this post


Link to post
Share on other sites

The wiki was very helpful. A quick look at the wiki example shows it has to be encased in qoutes:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[grp, 2] setWaypointStatements ["true", ""]

So to execute a script you need to double up on your quotes, for the exec command:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[west1,1] setwaypointstatements ["true","[] exec ""talondone.sqs"" "]

But if you read two commands up in the wiki, you might have seen this?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[grp, 2] setWaypointScript "talondone.sqs"

Share this post


Link to post
Share on other sites

neither option gives an error, but neither option calls the script talondone.sqs either

Ideas?

Share this post


Link to post
Share on other sites

Do the units actually follow that waypoint?

If not,

try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

[west1,0] setwaypointstatements ["true","[] exec ""talondone.sqs"" "]

or use:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

west1 setCurrentWaypoint [west1, 1]

Except you already had given the group a wp with index 0 before.

It think script waypoints override existing waypoints, so choosing the index 0 always works for me. But now with the new command you can manually set the waypoint index that you want.

Share this post


Link to post
Share on other sites

waypoint zero is placed in the editor, where waypoint 1 and beyond are dynamically created. I have tested this as a player, and I go to wp 0, which has a trigger nearby, that calls a script which among other things creates wp 1. Then I ran over to wp 1 and the script talondone did not get called. Talondone.sqs does many things, among them creates wp 2.

These wp's are for a multiplayer coop, where the players units are supposed to follow the waypoints, and I have tested them as the leader of west1.

Share this post


Link to post
Share on other sites

the biki says the waypoint won't be completed until the condition is met, then the statement is run......

so using the format:

waypoint setWaypointStatements [condition, statement]

making the statement:

[west1,1] setwaypointstatements ["true", [] exec "talondone.sqs"]

As soon as the above line is run, the script talonedone.sqs is run, before I get to waypoint 1. Is the condition "true" the only one that works? Anyone tried "DONE" or something similar? I don't want the script "talondone.sqs" to be run until AFTER I arrive at the waypoint west1,1. Right now I am testing waypoint 1 without enemies, but when it gets working, I will put enemies there to fight through.

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  

×