khaki 10 Posted November 26, 2010 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
CarlGustaffa 4 Posted November 27, 2010 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
MeIvin 10 Posted November 27, 2010 CarlGustaffa is spot on. But you can check this out: http://www.ofpec.com/forum/index.php?topic=33468.0 It has some information about adding tasks, and should point you in the right direction for creating your very first task script! :) Kind Regards Melvin Share this post Link to post Share on other sites
buliwyf 4 Posted November 27, 2010 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
shuko 59 Posted November 27, 2010 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
khaki 10 Posted November 27, 2010 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
shuko 59 Posted November 28, 2010 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