Search the Community
Showing results for tags 'event handlers'.
Found 6 results
-
Is there a way to contain a Fired eventhandler to a trigger area? [SOLVED]
Mungo Turkey posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello everyone. Apologies for being useless and having to come on here, but I'm stuck. Using VCOM AI (when units are grouped) the firefights are really good. My goal is to make the AI behave naturally to gunfire before they all 'knowsabout' you. At default it is really, really bad. My idea was to simulate the sound of gunfire carrying realistic distances (using triggers of up to 1km or more) and then have the AI react appropriately within these trigger areas when any shots are fired. I am nearly there. I don't understand SQF, but I spliced these things together from looking through the forums. Player squad is called GT. OPFOR units named a1, a2, a3, a4, a5. In the (player's) Object Init box - {_x addEventHandler['Fired',{shotIsFired = true}]} forEach (units GT); note - I would do it for all OPFOR units as well so they react the same if OPFOR fired first. In the Trigger named T1 - Activation - Any group member Activation type - Present Condition Expression - shotIsFired On Activation - [a2,a3,a4,a5] join a1; a1 reveal [GT, 1.7] This works brilliantly. They don't know exactly where I am, but they break out of ambient animations/patrol cycles instantly, huddle up (group) and take appropriate action. As they would in reality when hearing the shot. The problem is it will trigger if GT shoots outside the trigger area, they could be on the moon and it triggers! It is completely irrelevant to what settings I use in the trigger, what size or who I try to group to sync to, any of it. If anyone could help that would be great. Thanks in advance.- 5 replies
-
- triggers
- artifical intelligence
-
(and 2 more)
Tagged with:
-
Sysroot's Utility Scripts [SUS] This "mod" is less so a mod and moreso a collection of utility scripts created in hopes of assisting you in creating other, more complex mods/missions. The mod currently consists of 4 SQF scripts with varying utility functions: EzAnimate : Various functions for easily and efficiently animating objects in different ways. EzEvents : Various functions for easily creating and managing custom events. EzQuaternions : An easy to use library for working with quaternions and vector rotations utilizing them. MiscUtils : Miscellaneous utilities that don't really fit into a file of their own, but are useful for various things. Interested? See more info on the steam workshop page here. Any questions, concerns, or suggestions are very welcome and much appreciated. This is my first time posting on this forum, so I apologize for any mistakes. Note that the steam workshop page does have a dedicated discussion thread that I will also be monitoring. Thank you for your time!
-
Sysroot's Utility Scripts [SUS] This "mod" is less so a mod and moreso a collection of utility scripts created in hopes of assisting you in creating other, more complex mods/missions. The mod currently consists of 4 SQF scripts with varying utility functions: EzAnimate : Various functions for easily and efficiently animating objects in different ways. EzEvents : Various functions for easily creating and managing custom events. EzQuaternions : An easy to use library for working with quaternions and vector rotations utilizing them. MiscUtils : Miscellaneous utilities that don't really fit into a file of their own, but are useful for various things. Interested? See more info on the steam workshop page here. Any questions, concerns, or suggestions are very welcome and much appreciated. This is my first time posting on this forum, so I apologize for any mistakes. Note that the steam workshop page does have a dedicated discussion thread that I will also be monitoring. Thank you for your time!
-
"FiredMan" and "Fired" event handlers on the same unit?
LSValmont posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
FiredMan can complete replace Fired. Problem solved, please close this.-
- event handlers
- fired
-
(and 2 more)
Tagged with:
-
Adding and deleting Event Handlers multiple times - is it bad?
Leopard20 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey guys. I was wondering which one is worse performance-wise: 1. Creating one EH and making it not work when not needed using "if (conditionNotMet) exitWith {};" 2. Adding the EH when needed and deleting it when it's done. Particularly I'm interested in two types of Event Handlers: 1. KeyDown, added directly to display 46 like this: (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call someCode"]; 2. onEachFrame, created using BIS_fnc_addStackedEventHandler. Any help would be appreciated. -
I'm developing a game of hide and seek for my community. The problem I've encountered is figuring out how to have the hiders become seekers once they are found. To do this, I have the seekers with weapons shoot the hiders, and have an event handler in the init of every hiding unit that runs a script to change faction and equipment. I have a couple of problems: 1. The hiding units have allowDamage false, since I don't want them to die when they are found and shot. This means most damage-detecting event handlers do no work. 2. I don't know how to have the script effect the hiding unit who is shot, and not the seeker who shoots. This is one configuration I had that worked, except it effected the shooter and not the hider. Hiding Unit init: this allowDamage false; this addEventHandler ["HitPart", {this execVM "switchside.sqf"}]; switchside.sqf this joinSilent hunters; // "Exported from Arsenal by Blakestophen"; // "Remove existing items"; removeAllWeapons this; removeAllItems this; removeAllAssignedItems this; removeUniform this; removeVest this; removeBackpack this; removeHeadgear this; removeGoggles this; // "Add containers"; this forceAddUniform "CUP_U_O_RUS_Gorka_Partizan_A"; this addItemToUniform "FirstAidKit"; this addItemToUniform "ACE_Banana"; this addItemToUniform "ACE_CableTie"; this addItemToUniform "ACE_bodyBag"; this addItemToUniform "ACE_IR_Strobe_Item"; this addItemToUniform "ACE_MapTools"; this addItemToUniform "ACE_microDAGR"; this addItemToUniform "ACE_SpraypaintRed"; this addItemToUniform "ACE_Flashlight_XL50"; this addVest "CUP_V_RUS_Smersh_1"; for "_i" from 1 to 6 do {this addItemToVest "CUP_30Rnd_Sa58_M_TracerG";}; for "_i" from 1 to 3 do {this addItemToVest "CUP_8Rnd_9x18_MakarovSD_M";}; for "_i" from 1 to 2 do {this addItemToVest "ACE_HandFlare_Green";}; for "_i" from 1 to 2 do {this addItemToVest "ACE_Chemlight_HiWhite";}; this addHeadgear "CUP_H_RUS_Beret_Spetsnaz"; this addGoggles "G_Balaclava_oli"; // "Add weapons"; this addWeapon "CUP_arifle_Sa58RIS1_des"; this addPrimaryWeaponItem "CUP_acc_Flashlight_desert"; this addWeapon "CUP_hgun_PB6P9"; this addHandgunItem "CUP_muzzle_PB6P9"; this addWeapon "ACE_Vector"; // "Add items"; this linkItem "ItemMap"; this linkItem "ItemCompass"; this linkItem "ItemWatch"; this linkItem "tf_fadak"; this linkItem "ItemGPS"; I tested this and I successfully did what I wanted, except on the wrong unit. Now I am experimenting with MPHit and other event handlers, but this won't let me use allowDamage. Is there anyway to change this code I posted to effect the one who is shot and not the shooter?