OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: LCD on 24 Aug 2007, 09:21:36

Title: condition of presence and init.sqs
Post by: LCD on 24 Aug 2007, 09:21:36
im just makin a mision and 4 da 1st time im tryin 2 use da condition of presence... nd it seems dat it doesnt matter if i set da variable true... usin da init.sqs or even da players init.... is dere nyway 2 make da condition of presence work ?

i have 5 vulcans.... each 1 have condition called vulcan1,vulcan2....vulcan5

in da init i added da line

vulcan5 = true

and da fifth vulcan doesnt appear....

also i tried randomizing usin

Code: [Select]
_num = (floor (random 5)) + 1
call compile (format ["vulcan%1 = true",_num])


but nothin seems 2 make da vulcan apear  :(

LCD OUT
Title: Re: condition of presence and init.sqs
Post by: Cheetah on 24 Aug 2007, 09:59:51
You might want to take a look at this (http://www.ofpec.com/forum/index.php?topic=28634.0).

It might work (not tested) if you give the 1st unit you place all the information required for the variables. Hopefully they get executed first, don't forget to include vulcan1=false, vulcan2=false etc.
Title: Re: condition of presence and init.sqs
Post by: LCD on 24 Aug 2007, 10:05:58
interesting read... but as im usin some scriptin 4 dat... nd i hate 2 script in da init field of units... ill probably find a workaround  :(

LCD OUT
Title: Re: condition of presence and init.sqs
Post by: Wolfrug on 24 Aug 2007, 14:32:47
If you want the vulcans to appear randomly, just "script" that into their initialization fields (or just turn the % slider around ;)), and that'll do it for that. Tell us more about your situation, maybe we can help. I.e:

You want 2-5 vulcans to appear with a random chance: -> Make 2 vulcans have a 100% presence, the rest whatever % you need. You want these vulcans to appear in random locations (random pre-defined ones, but not the same all the time, i.e., the two 100% would always appear anyway) -> do the old "group with marker" trick to get them to appear randomly. Although I guess that might lead to two vulcans appearing on the same marker with a bit of bad luck :)

Otherwise, some creative deleteVehicle'ing and scripting should get things done. The condition of presence field is a fickle mistress, and not really necessary. Useful for campaign scripting and stuff like "!cadetMode" and whatnot.

 :good:

Wolfrug out. 
Title: Re: condition of presence and init.sqs
Post by: Cheetah on 25 Aug 2007, 09:36:24
From where do you execute the script?
Title: Re: condition of presence and init.sqs
Post by: Mandoble on 26 Aug 2007, 00:22:09
More than probably conditions of presence are checked before executing init.sqs or init.sqf.