Search the Community
Showing results for tags 'if then'.
Found 2 results
Error when there is no player in squad lead spot
InsanityGamer posted a topic in ARMA 3 - MISSION EDITING & SCRIPTINGEssentially i'm try to make my own take on an invade and annex server thats team oriented. currently im working on adding a flagpole teleportation mechanic that will teleport you to your squad leader if you have a squad leader and will get you in the fight faster. so ive spent the better part of the day doing this.... im sure some of you are gagging at that, sorry im not very proficient in eden editor....or anything particularily... nonetheless this works as intended except it'll throw an error if there is nobody playing the character with their specific variable attached IE; SquadLeader_1, SquadLeader_2, Pilot, COC, Recon. for what i intend that's fine but i'd like to clean it up and offer a "Teleportation is down right now" for the characters that can teleport atleast. i've been trying to find some way to integrate try throw catch, but cant seem to find a way to set it up proper. any tips?
troubles defining variables in trigger
lordfrith posted a topic in ARMA 3 - MISSION EDITING & SCRIPTINGwell, i have been trawling about trying to find this particular problem for a while so i'll ask here: i'm trying to create a script that will spawn and despawn specific objects when player moves in/out of trigger area. originally i did this using separate spawn/despawn scripts but i'm trying to put both scripts in one SQF and select between the two parts using if/then and a variable in the script call. so i created an object "desk1" (which spawned objects attach to) and then created trigger with the following conditions trigger is working fine (i get ping pong) the script "officedesk.sqf" is below. The problem is i keep getting undefined variable errors for the "_stage" (line 7) even though it is defined in the call? i'm pretty confused as to whats going on here, changing _stage to be global doesn't seem to help and i'm.... pretty sure the script call in the trigger is ok? can anybody see what (probably blindingly obvious) thing is going wrong here? EDIT: SOLVED it was NOTHING to do with the error message's which confused me for ages the problem was that if i defined deskArray at the start of the script (before if/then code) 'pushback' didn't work and i was trying to delete and empty array of objects. I just moved it into the if/then code and it works fine with no errors. thing is... 'deskArray' is global so how come i can't define it at code start and then add items in the if/then code? Here's the working script in case anyones bored enough to check it out: p.s. sorry mods, having solved the problem i think the thread title is... inaccurate :D