Search the Community
Showing results for tags 'handler'.
Found 8 results
-
Vehicle respawn with EntityKilled EH
Asmodeuz posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, through trial and testing I've arrived to the following format for a vehicle respawn functionality. addMissionEventHandler ["EntityKilled", { params ["_killed", "_killer", "_instigator"]; [_killed] spawn { switch (true) do { case (!alive vehCivSUV_1): {deleteVehicle vehCivSUV_1; _newVehicle2 = "C_SUV_01_F" createVehicle [1263,1298,0]; _newVehicle2 setVehicleVarName "vehCivSUV_1"; vehCivSUV_1 = _newVehicle2; publicVariable "vehCivSUV_1";}; sleep 2; case (!alive vehCivSUV_2): {deleteVehicle vehCivSUV_2; _newVehicle = "C_SUV_01_F" createVehicle [1232,1298,0]; _newVehicle setVehicleVarName "vehCivSUV_2"; vehCivSUV_2 = _newVehicle; publicVariable "vehCivSUV_2";}; }; }; }]; While testing has proven that it works decently enough in a dedicated server there's still at least one edge-case scenario that I'd like to iron out. The edge-case is that should the two vehicles mentioned in the event handlers code be destroyed exactly at the same time the functionality does not work as expected. Should the demise of both vehicles happen at the same time the other vehicle won't be created at all (and the other that gets created will have a duplicate vehicle spawned next to it). So while what I have now works to some degree there should be some changes made to make the functionality more robust. Maybe the switch-do is not the best solution but I have only just arrived to that and don't have off the top of my head any other solution to try. So question for this is that: what would be a more robust way to achieve what I have now and do away with the edge-case scenario at the same time? Another thing would be that the functionality should, if possible, incorporate at least two more vehicles in it. edit: while I know that there's a respawn module available in the editor that can't be used for "reasons" -
Is there an event handler that deals with a mine being triggered? I'm hoping to setup a trip-wire that can be disarmed like a mine but that triggers an explosion somewhere else. I may be able to do it with an on-entry trigger but i'm betting this will make the disarming bit somewhat clumbsy. thanks!
-
Hello Armaholics! I must admit I'm very bad when it comes to scripting. Is there a easy way to have a trigger activate when you have closed a leaflet after you've read it. Couldn't find anything on leaflets on the wiki regarding event handlers. I'm using this for the leaflets: ["init", [this, "image.jpg", "Text message"]] call BIS_fnc_initLeaflet It will be used in a upcoming horror mission this halloween. Thanks in advance! :) Some of my missions: [CO-04] Last Stand - Bunker [CO-04] Last Stand - Compound [CO-04] Last Stand - Town [CO-04] Terrorist Hunt - Village [CO-04] Terrorist Hunt - Factory
-
When switching weapons delete the weapon that gets placed on the ground
Asmodeuz posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello, I've been playing with Put and Take event handlers to try and achieve functionality that's stated in the topic. For starters Put EH seems to only fire when you drop your weapon on the ground (groundWeaponHolder) or put the weapon into a container (box, vehicle) directly from your inventory. It doesn't fire when switching to a weapon that is on the ground even though (at least how I see it) you are still dropping your current weapon into a "groundWeaponHolder". Does anyone have an idea why this EH doesn't fire in that case? I used this shortie to test Put EH: player addEventHandler ["Put", {_unit = _this select 0; _content = _this select 1; _weapon = _this select 2; hint "This EH seems to be working";}]; Take EH on the other hand seems to work just fine for detecting the weapon pick up operation. But other than testing with simple hint that the EH fires when needed I haven't been able to come up with anything I'm looking to achieve. Now the ultimate question is: by using either of the aforementioned EHs how to delete the weapon that gets put on the ground during weapon switching operation? -
Hi. How can I find the handler ID to use with ctrlRemoveEventHandler ? https://community.bistudio.com/wiki/ctrlRemoveEventHandler
- 3 replies
-
- handler
- eventhandler
-
(and 2 more)
Tagged with:
-
https://community.bistudio.com/wiki/Arma_3:_Event_Handlers/inGameUISetEventHandler#Action I cannot get this thing to work i've added it to the target unit and to the player but when I perform an action the handler doesn't do anything. I have unit A that needs to be rescued by the player, so there is an action added to A. So i've done both situations of adding the handler to either unit A or the player and it doesn't seem do anything for either of them? I also checked wether it is added and it is as systemChat in the text block display in the case of the switch.
-
basic selection of connected Player help
Tom507 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
I got this to work (at least partially): in the init: if (isServer) then { addMissionEventHandler["PlayerConnected",{_this execVM "playerInit.sqf"}]; }; in playerInit.sqf: thisPlayer = objNull; playerId = (_this select 4); for "_x" from 0 to (count allPlayers) -1 step 1 do { if (owner _x == playerId) then { thisplayer = (allPlayers select _x); }; }; thisPlayer = _this publicVariable "thisplayer"; publicVariable "playerId"; the Id is correctly transfered the problem is thisPlayer returns nothing the if never returns true so either the player is not in the list allPlayers at the time or i have no clue I tested everything seperately and everything works so Ihave nu f*king idea why it doesn't work Please help thanks in advance- 11 replies
-
- multiplayer
- jip
-
(and 4 more)
Tagged with:
-
A safe way to get the weapon/object which killed a unit?
Heeeere's johnny! posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Since the "Killed" EH does not provide the weapon/object which killed the unit, I was looking through the other possible EHs (Dammaged, HandleDamage, Hit, HitPart), only to find that each one of these is either fireing multiple times for each damaged/hit part or potentially NOT fireing at all. So, if I wanted to print a single line to the log, mentioning the killing weapon/object, which would be the most senseful (most efficient) way of doing that? Best wishes, Johnny- 4 replies
-
- event handler
- killed
- (and 4 more)