r/armadev • u/Historical_Raise326 • 5d ago
Question Learning SQF Scripting and need help
I hope this is the right place for this!! I am in an Arma 3 starsim unit, I have experience with Eden and Zeusing but not much with scripting itself, so please forgive if I've made some super obvious error I just missed because I don't know anything.
I have a script (see below) that is intended to evaluate whether some shields have been disabled (deleted). If the jammer shields are still up, it is meant to display an addAction-type message hinting to the players that they need to disable those shields first. If the jammer shields are down, it is meant to be interactable to disable a second set of shields (the blue house shields). I suspect the issue is with the first message portion and that I don't have an action assigned to that part, or maybe the ordering of the sections, but the error it's giving me is that I'm missing a bracket haha. Any and all help appreciated as I am new to this :)
if (!isNull jammer_1) then {this addAction ["Disable Transmission Center Shields", [deleteVehicle blue_house_1; deleteVehicle blue_house_2;]]} else {this addAction ["Cannot Access Transmission Dish While Jammer Is Active"]};
2
u/commandercasserole 5d ago
I can't tell you the right way to do this, or the best way to do this, I can only tell you what I would do, and I am no sqf expert. Someone may have better understanding and will comment on how to do what you are attempting, but sometimes posts here just get crickets.
Firstly, I assume you are placing this code in the init box in eden of an object? I'm guessing that from your use of "this" but I suppose I'm asking: where are you running this code? In Eden from an object init, from an external script file? From an Eden trigger? Does it matter where you want it to execute or do you just need to get the job done?
0
u/HateAndCaffeine 3d ago
I think you’re looking for “hint” and not “addAction”