Page 1 of 1

How does the "return value" work?

Posted: Wed Nov 29, 2017 2:41 pm
by Tormentor667
I am currently playing around with script stuff and noticed that "SpawnSpot" returns a value if it successfully spawns an actor, actually if you spawn an actor with "SpawnSpot" on a map spot and one is blocked, it returns "1" if I have understood this correctly.

But how can I use that in ACS? I mean, how can I restart a spawning script in case SpawnSpot doesn't return 1 but 0? Or how can I proceed through script if it returns 1 as expected?

Re: How does the "return value" work?

Posted: Wed Nov 29, 2017 3:46 pm
by Graf Zahl
You use it like any other return value:

Either assign it to a variable or check it directly with an 'if' statement.

So

Code: Select all

script 1(void)
{
    int num = SpawnSpot(...);
    if (num == 0) restart;
}