ConPrice 1 Posted August 9, 2023 Hello, everyone! I have a problem related to addAction and triggers on Dedicated servers. In my mission there is an objective where players have to go to a laptop_1 and make mines online which in turn sets the boolean isMineSet to TRUE. And I have a Trigger_1 and isMineSet is in the condition field of Trigger_1. In the activation field of Trigger_1 is this code: laptop_2 addaction["Blow it up!", { (_this select 0) removeAction(_this select 2); canBlowUp = true; }, [], 6, false, true, "", "", 5]; and in the second Trigger_2 I have canBlowUp in the condition field and I have this code in the activation: [] spawn { sleep 1; charge_1 setDamage 1; hint "Yes2!!"; sleep 1; charge_2 setDamage 1; }; and I know that boolean values get set because addAction works and the hint "Yes2!!" also works. But there is no explosion. But if I set an area for Trigger_2 and set Activation to Any Player and step into the trigger, the explosion happens I also tried this code in addAction, but it also does not work, but if I add this code to a trigger and activate it by stepping in it, it works: Laptop_2 addaction["Blow it up!", { (_this select 0) removeAction(_this select 2); null = [napalm1] execVM "AL_napalm\alias_obj_sing.sqf"; sleep 1; null = [napalm2] execVM "AL_napalm\alias_obj_sing.sqf"; sleep 1; }, [], 6, false, true, "", "", 5]; all the above mentioned code works properly when I host it as multiplayer in the editor. Does anyone have any Idea what might cause this? I appreciate your help. Thank you! Share this post Link to post Share on other sites
mrcurry 505 Posted August 10, 2023 13 hours ago, ConPrice said: Does anyone have any Idea what might cause this? Well you haven't described the symptoms yet, just your setup... But yes. 🙂 If it works in SP/Host but not in MP/clients the most likely culprit is locality. There are good pages on the biki for that but the TL;DR is this: As a general rule in MP the game doesn't want to send all commands over the network unless it has to. In some cases it doesn't make sense to do so (example UI elements) in other cases it just simply better performance not to. So SQF commands are designed to have their effects happen either: - locally: only on the PC that executed them - globally: on all PCs connected to the server (there are other variations but not important here) When writing script for a MP environment you need to consider where (which machine) the execution starts on and who will receive the effects. addAction has local effect, you get that info from the EL icon at the top of its BIKI page. Makes sense since it's a UI feature. That means the action gets added ONLY on the PC that executed it AND the same goes for the attached script when the action is activated. Hope that helps! 2 Share this post Link to post Share on other sites
ConPrice 1 Posted August 10, 2023 16 hours ago, mrcurry said: Well you haven't described the symptoms yet, just your setup... But yes. 🙂 If it works in SP/Host but not in MP/clients the most likely culprit is locality. There are good pages on the biki for that but the TL;DR is this: As a general rule in MP the game doesn't want to send all commands over the network unless it has to. In some cases it doesn't make sense to do so (example UI elements) in other cases it just simply better performance not to. So SQF commands are designed to have their effects happen either: - locally: only on the PC that executed them - globally: on all PCs connected to the server (there are other variations but not important here) When writing script for a MP environment you need to consider where (which machine) the execution starts on and who will receive the effects. addAction has local effect, you get that info from the EL icon at the top of its BIKI page. Makes sense since it's a UI feature. That means the action gets added ONLY on the PC that executed it AND the same goes for the attached script when the action is activated. Hope that helps! Hi, Mrcurry! Thank you for responding. my addactions only set the booleans to true. I have booleans in init.sqf for example: canBlowUp = false; publicVariable "canBlowUp"; canEnd = false; publicVariable "canEnd"; and even when I try to activate the setDamage code via script using booleans as condition. Hint in between setDamage codes shows up, but there is no explosion but If I activate that trigger by stepping into it, it works and explosion happens. Am I supposed figure out a way to set a boolean for every machine on the server? setVariable? I still don't understand why setdamage works when the trigger is activated by a player, but when the same trigger is activated by a boolean it does not work ( hint "Yes2!!" still works so that means boolean gets set). If you need more details, I will happily provide Share this post Link to post Share on other sites