Jump to content
Sign in to follow this  
frosties

init.sqf

Recommended Posts

How do i "start" an init.sqf properly?

I have a init line that i used in the INIT line of a soldier, but i would like the line to work for all soldiers.

In the INIT field of the soldier i have:

VIPS = [VIP]

That i use to list wich characters in the mission are the VIPs.

Its working when i have it in the INIT field of the soldiers, but when i add the same line to the init.sqf (first line in the file btw) its not working...?

What have i missed?

Share this post


Link to post
Share on other sites

I don't know off the top of my head the order in which the game initializes things but it's possible that line is running before the VIP unit exists/is created. Maybe try putting it farther down in the init.sqf file, or make a check that waits until the VIP unit is alive/exists.

Share this post


Link to post
Share on other sites
What have i missed?

The subforums you should be posting in...

Share this post


Link to post
Share on other sites
The subforums you should be posting in...

Dont remember wich forum i put it in, but CONFIGS and SCRIPTING seems ok, i either i put it right or somebody moved it... i blame my intake of alcoholic beverages...

Anyhow...

As that is the only line in the init.sqf i cant put it further down.

Or can i check somehow if the VIP is alive first?

Share this post


Link to post
Share on other sites

If its the only line lol... doesn't matter how far "down" in the page it is lol. I meant farther down time-wise in the execution of scripts but thats the only one so its always gonna go off at the same time.

If the unit's name is actually "VIP" I think you could use this:

waitUntil {alive VIP};

Put that in your init.sqf, but before the other thing. It should stop at that line until it comes back as true/the VIP is alive.

Share this post


Link to post
Share on other sites
Dont remember wich forum i put it in, but CONFIGS and SCRIPTING seems ok, i either i put it right or somebody moved it... i blame my intake of alcoholic beverages...

If you would have finished the reading, you would end up with Configs and Scripting(addons). You are not making an addon, are you?

There is a lot more help in the MISSion editing forums for this sort of questions

Share this post


Link to post
Share on other sites

I read in the SQFScripting Guide by Taurus I believe, on page six...

“init.sqfâ€

This is the init file of your mission, and will run after the unit init lines have been processed.

meaning, I believe, that what you have posted in the soldier's init line is being read first (if you still have that line in their init area at the same time as the init.sqf file is running)

Don't know if that helps, but maybe

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  

×