Jump to content
Sign in to follow this  
El Mariachi

Can't figure out how to call a mission parameter in "Condition of Presence" field.

Recommended Posts

I'm trying to get an empty object to be present at mission start if a mission parameter is set to a certain number.

I know I'm calling the right parameter because I can do it in other scripts in the mission, I just don't know if the syntax is different for whatever reason in the Condition of Presence field.

The Mission Parameter's default is set to 1, so I know that this is the param called in the mission editor when previewing a mission.

I've tried the following:

((paramsArray select 1) == 1)

paramsArray select 1 == 1

(paramsArray select 1) == 1

The object is never present when I've tried any of the above options.

Share this post


Link to post
Share on other sites

Did you actual use an if statement or just one of the portions of code above?

Share this post


Link to post
Share on other sites

Just one of the codes above.

Why would I need to put an if statement, isn't that 'assumed' in the condition field? At least, that's how I've always assumed it has worked.

For example:

Place a unit in the editor, name it bob, and have its probability of presence set below 100%

then, place a unit in the editor, name it phil, and set the condition to (alive bob)

When you test the mission, phil won't spawn unless bob does.

You haven't explicitly added an 'if' statement, yet it still works.

Unless you're saying something else and I completely miss the point.

Share this post


Link to post
Share on other sites

Actually sorry, complete misread on my part. And it may be initialization order that is causing the issue, though I'm not sure, I personally haven't messed with CfgParams before (understand them, haven't used them).

EDIT: Have you tried simply hinting the mission param variable to make sure it is defaulting/working properly?

Edited by JShock

Share this post


Link to post
Share on other sites

I'm pretty sure its working because I call on that mission parameter to determine what vehicles spawn at the beginning in a script.

Share this post


Link to post
Share on other sites

Seems ok here from a quick TEST using ((paramsArray select #) == #) in the Condition of Presence field.

I was expecting as JShock said that perhaps paramsArray was not available at initial spawn and only became available at mission start, time > 0, but the above test worked for me first time.

Edited by Larrow

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  

×