joshpc 0 Posted July 22, 2009 Hello, I havent scripted anything since OFP, I tried once in Arma But none of the stuff I was trying to use worked and I didnt care to learn again. Now Im in arma 2 and want to try yet again. I use to Make missions with simple scripting I think, I would set down and Array something like this Shilka [ S1,S2,S3] S1-S3 being what I named the Shilkas in the mission, didnt matter how many. I it was just grouping them so I could get a trigger to count them later, and when the number of Shilka left was less then 1 Objective was true for that objective. I looked through arrays here I dont see anything like it used to be it all seems more complex. So does anyone know what Im talking about? and how I can now do this? I tried to search for the answers but the arrays I saw I dont understand at all. It was like reading Chinese, I read english and bad english. Share this post Link to post Share on other sites
Benny. 15 Posted July 22, 2009 (edited) In an init. Shilkas = [s1,S2,S3]; In a trigger: Condition: Count Shilkas < 1 Activation: ... Each Shilka (S1,S2,S3) init field: this addEventHandler["killed",{Shilkas = Shilkas - [_this select 0]}]; It's a bit hard, an easier way would be using an easier trigger condition like: Condition: ((getDammage S1 >= 1)&&(getDammage S2 >= 1)&&(getDammage S3 >= 1)) Edited July 22, 2009 by Benny. Share this post Link to post Share on other sites
joshpc 0 Posted July 22, 2009 (edited) Well Thanks, that bottom one Is much easier isnt it! That makes my day.. but now how do I make it say when this is true Objective complete? and if your helping :-D I ready on another post the set hight for objects. It doesnt work :-( any reason Why I was trying to set a help on the Carrier. After trying the bottom one out it doesnt work :-( least not with me doing it wrong I assume. After thinking about it, I really dont learn so well this way, I was wondering if someone would build a mission to show me? something I would reverse engineer? I can dePBO it and look it over and learn from what I see working. Then I will learn if anyone is willing to help? Edited July 22, 2009 by joshpc Share this post Link to post Share on other sites
Benny. 15 Posted July 22, 2009 My bad it's: ((getDammage S1 >= 1)&&(getDammage S2 >= 1)&&(getDammage S3 >= 1)) Was using < instead of >= Share this post Link to post Share on other sites
joshpc 0 Posted July 22, 2009 (edited) Oh Sweet! This is Awesome! It worked and it was Way easier then before. Im not sure how but thats pretty nice. ok so now to make it work in a mission... need to link things to objectives... I got that now, if I can just figure out why the vehciles wont start out where I tell them to... Edited July 22, 2009 by joshpc Share this post Link to post Share on other sites
Tajin 349 Posted July 23, 2009 this addEventHandler["killed",{Shilkas = Shilkas - [_this select 0]}]; this one is rather pointless. The great thing about arrays is that you can count them and even execute a command for all its contents. this: ((getDammage S1 >= 1)&&(getDammage S2 >= 1)&&(getDammage S3 >= 1)) can be simplyfied to: {alive _x} count Shilkas < 1 It will count how many of the units listed in the "Shilkas" array are still alive. Good thing you're getting back to scripting. Things really got easier compared to OFP, so don't give up. This might be helpful: http://community.bistudio.com/wiki/sqf I got that now, if I can just figure out why the vehciles wont start out where I tell them to... Maybe they are set to be "In Formation". Share this post Link to post Share on other sites