Jump to content
Sign in to follow this  
dmarkwick

Probability of presence help please

Recommended Posts

I got a mission where in about 30 random farmsteads & buildings across the map I have ammo crates each with a 10% chance of existing. Sort of like a found resistance cache.

I find that the people playing the mission don't really do the sniffing around that I'd hoped for, so I thought that I would maybe attach a sound, say frogs, to an area that has an ammo crate.

My question: how can I tie the probability of existance of a frog croak object to the existence of the ammo crate object?

Share this post


Link to post
Share on other sites

1. Name your crates (crate1, crate2 etc..) ;

2. Crate a trigger for each crate, with the frogs sound as "effects", at the position of the crate, with this on the condition line (for "crate1" for example) :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">alive crate1

Very long cause you've got 30 possible crates...and 30 triggers !

Or : find a frog sound, put it in the mission folder with the appropriate description file, and create a looping script playing this sound, such as :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_crate = _this select 0

#soundloop

_crate say "frogs"

; if "frogs" is the config name of the sound, defined in the description file

~10

;if 10 seconds is the length of the sound

goto "soundloop"

If the name of the script is "frog.sqs", you launch it in the init line of the crates :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[this] exec "frogs.sqs"

Much easier, because once you've got the sound and its config through the description file, you can copy and paste the 30 crates cause they've got the same init launching the same script. To create a script file and a description file, you can get Chris' OFP script editor.

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  

×