Jump to content
Sign in to follow this  
khaki

Scripting to make finding an ammo cache an objective ?

Recommended Posts

I'm creating a mission where I want the players to find a ammo cache as an objective. But how can I script this ? Can I script in a scroll menu option to complete it ?

Share this post


Link to post
Share on other sites

Sure you can. You can do almost anything with scripting ;)

Step 1: Learn the basics of scripting. Look at code, do tutorials, learn to use the references on biki.

Step 2: Make an attempt on solving your problem.

Step 3: If it fails, post it and ask why.

Share this post


Link to post
Share on other sites
I'm creating a mission where I want the players to find a ammo cache as an objective. But how can I script this ? Can I script in a scroll menu option to complete it ?

You can solve that with a small code... player distance ammobox < 5 is only one example of thousands...

:rolleyes:

Share this post


Link to post
Share on other sites

Trigger 1:

Condition: {_x knowsabout cache1 > 0.8} count (if ismultiplayer then {playableunits} else {switchableunits}) > 0

OnAct: cacheFound = true; publicvariable "cacheFound";

Trigger 2:

Condition: cacheFound

OnAct: tskCache = player createsimpletask ["cache"]; tskCache setsimpletaskdescription ["sdfg","fdgh","hgj"];

Share this post


Link to post
Share on other sites

Wow thanks for all the great replies !

I'll try out everything you guys suggested, and probably try to learn basic scripting. I've attempted before but I was so overwhelmed, I gave up :P

and BTW, the scripting language is C++ correct ?

Share this post


Link to post
Share on other sites
and BTW, the scripting language is C++ correct ?

Nope, it's just their own scripting language. It's called SQF. It has the basic if-else, while, switch-case etc. that everything else has. Then you have the commands to interact with objects in the game world and so on.

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  

×