OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: nominesine on 07 Jul 2009, 17:46:09

Title: Ambient civilians
Post by: nominesine on 07 Jul 2009, 17:46:09
According to the wiki I can limit the spawn distance of ambient civilians with this code:

Code: [Select]
BIS_alice_mainscope setvariable ["spawnDistance",500];
How do I implement it? Just add it to the init line of the editor module? Or do I need to name the module and refer to it somehow???
Title: Re: Ambient civilians
Post by: kju on 07 Jul 2009, 18:04:22
init.sqf should do.
Title: Re: Ambient civilians
Post by: Rommel92 on 10 Jul 2009, 07:13:09
Remember modules take approximately '0.5s' to initiate, so you may want a delay or a waituntil till you execute that code.
Title: Re: Ambient civilians
Post by: nominesine on 10 Jul 2009, 17:59:50
Thanks. I noteced as much. I'm new to sqf.scripting. Can you show me a working example of the "wait until" syntax, with the above statement included and all the brackets in the right place. I feel a bit lost

  ::)
Title: Re: Ambient civilians
Post by: Spooner on 10 Jul 2009, 23:50:08
Code: [Select]
waitUntil { BIS_alice_mainscope getVariable "init" };should wait the right amount of time.
Title: Re: Ambient civilians
Post by: nominesine on 11 Jul 2009, 12:11:10
Would the following syntax suffice too? Or does line breaks make a difference in sqf-scripting, just as they do in sqs-scripting?

Code: [Select]
waitUntil
{
BIS_alice_mainscope getVariable "init"
};

I find it much easier to learn if I can work with nicely structured code. I've also noticed that ArmA2 does not give me an error message when I make a syntax error in a script. Someone adviced me to look for a rpt-report. What is that? Where do I find it?
Title: Re: Ambient civilians
Post by: Zipper5 on 11 Jul 2009, 12:15:04
If you're using XP it should be located at:
C:\Documents and Settings\User name\Local Settings\Application Data\ArmA 2\arma2.RPT
Just open the file with Notepad.

Not sure where it is on Vista though.
I do find it a bit odd that they removed those error messages. They were quite useful. :dunno: