draoth
Member-
Content Count
73 -
Joined
-
Last visited
-
Medals
Everything posted by draoth
-
MPHit Eventhandler instigator
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you so much! People like you are the reason i keep scripting. Have a good day! -
Hello everybody, I'm working on a script that will change a player his side when he's shot by a certain person. And change the player that shot the other player back. So it will always be a 3v1 The player that is last shot will be called = Active. The eventhandler doesn't work as i hoped it would, because everyone gets changed sides when shot by anyone. I'm pretty certain that the mistake is in the first line, but i'll show it all: _HITIT = Player1 addMPEventHandler ["MPHit", {if (_this select 4 == Active) then { [Active] joinSilent (Friendlygroup); Active setObjectTexture [0, "#(rgb,8,8,3)color(0,0.1,0,1)"]}; Active = Player1; [Active] joinSilent (Enemygroup); Active setObjectTexture [0, "#(rgb,8,8,3)color(1,0,0,1)"]; }]; This is done for all 4 players. Thank you for helping someone who has almost no experience in coding howsoever! Draoth
-
MPHit Eventhandler instigator
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I made an arrow spinning in 360 degrees. 4 players stand around it. The infinite loop checks at what degree the arrow stops. When it stops it will set a player ActiveP. The only part i need help with is this line. _HITIT = Player1 addMPEventHandler ["MPHit", {if (_this select 4 == ActiveP) then { ETC Is the eventhandler correct? i want to check if the one that shot Player one is the same as ActiveP. That's why i put select 4, which is the instigator. instigator: Object - Person who pulled the trigger https://community.bistudio.com/wiki/Arma_3:_Event_Handlers -
MPHit Eventhandler instigator
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
They are set in different scripts: //First script Friendlygroup = createGroup west; Enemygroup = createGroup east; //ArrowSpin script that randomizes the first Active while {true} do { //player1 if (ArrowDir >180 && ArrowDir <235) then {ActiveP = Player1}; if (ArrowDir >135 && ArrowDir <180) then {ActiveP = Player1}; //player2 if (ArrowDir >45 && ArrowDir <90) then {ActiveP = Player2}; if (ArrowDir >90 && ArrowDir <45) then {ActiveP = Player2}; //player3 if (ArrowDir >0 && ArrowDir <45) then {ActiveP = Player3}; if (ArrowDir >315 && ArrowDir <360) then {ActiveP = Player3}; //player4 if (ArrowDir >270 && ArrowDir <315) then {ActiveP = Player4}; if (ArrowDir >235 && ArrowDir <275) then {ActiveP = Player4}; Pointer setPos [ getPos ActiveP select 0, getPos ActiveP select 1, 3]; if (Arrowspeed < 1) exitwith {}; sleep 0.1 } I hope you can understand it a little, I know it's messy but i did my best -
Disable Animations yet Allow Head Movement
draoth replied to Kydoimos's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I'm pretty late on this one but if you use playmove instead of switchmove it seems to work. And by the way the sliding thing is pretty fun! if only the camera wouldn't glitch that much... -
solved Using a pre-set unit face in a multiplayer mission (solved)
draoth posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello Everyone! I'm making a mission, and i want the player use the face/skin texture i selected in the editor. But it uses the custom player face instead. Is there any way to fix this? Draoth -
solved Using a pre-set unit face in a multiplayer mission (solved)
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks guys that's what i needed! -
Hide Object but keep collision (Solved)
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
He places the object directly in the character that's pretty smart. Thanks man. -
Hide Object but keep collision (Solved)
draoth posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello folks, I want to hide a object but using hideobject will disable the collision. So... How can i hide objects but remain collison? Draoth -
Hide Object but keep collision (Solved)
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for the reply. Can i give this "invisible wall" physics? Make it fall? I want to create some ragdoll system and i need something to fall on the player, but it needs to be invisible ofcourse. -
impossible? How to increase a local variable within an eventhandler? (Not solved)
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Can you explain it? I don't really know what you mean by that?- 2 replies
-
- difficult
- eventhandler
-
(and 5 more)
Tagged with:
-
Welcome, To keep this short : _hit = 0 I want this variable to increase everytime the object _Str been hit. _Str addEventHandler ["HitPart",{_hit = _hit + 1}]; This doesn't work because the EH doesn't know the localvariable. _Str addEventHandler ["HitPart",{hit = hit + 1}]; This does work because it is a globalvariable. But i need it to be a localvariable, because there are 200 objects that are being spawned using the same variable. waitUntil {_Hit > 3}; deletevehicle _Str; I want the obj to delete itself after being hit 3 times. Is there workaround that i can use? Or maby a different way to approach this? Draoth
- 2 replies
-
- difficult
- eventhandler
-
(and 5 more)
Tagged with:
-
collision Check Object Collision (No solution yet)
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I tried the EpeContact event handler but it didn't seem to work. i added this to my script: _Str addeventhandler ["EpeContactStart",{deletevehicle _Str}]; I don't have that much experience with eventhandlers so i'm probally doing something wrong. I also tried disabling the : _Str enablesimulation false; But that didn't work either. If you know what's wrong please explain it to me. So i can use eventhandlers in my future scripts. -
collision Check Object Collision (No solution yet)
draoth posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello everyone. I'm creating a spawner that spawns around 300 different items in the 400 m2 range. How can i make my script detect if two objects spawn in each other? This is my script: _Locationx = floor random [-85,0,85]; _Locationy = floor random [-85,0,85]; _AllStr = Selectrandom ["Land_Wreck_Hunter_F","Land_Cncbarriermedium_F","Land_HBarrierBower_F","Land_toiletbox_F","land_bagbunker_small_f","land_ancientpillar_damaged_f","land_ancientpillar_fallen_f","land_ancientpillar_f","land_cinderblocks_f","land_pallet_vertical_f","land_bricks_v2_f","land_bricks_v1_f","land_bricks_v3_f","land_timbers_f","land_bagwall_long_f"]; _randomD = floor(random 360); _Str = createVehicle [_AllStr, getMarkerPos "area1", [], 0, ""]; _Str enablesimulation false; _Str allowdamage false; _locationstrX = (getPos _Str select 0); _locationstrY = (getPos _Str select 1); _Str setPos [_locationstrx + _Locationx ,_locationstry + _Locationy,9.293]; _Str setDir _randomD; [_Str] execVM "Hitcheck.sqf"; I hope someone has a solution to my problem. Draoth -
collision Check Object Collision (No solution yet)
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks for your fast response. Isn't epeContactStart only for objects with physics? And how can i check the distance between all 300 objects spawned with the same name? : _Str Perhaps with nearObjects. I will check that first. If you or someone else has a better solution, I would like to hear it ;). -
I don't really get what you're wanting from us, but there's a mod called ArmAGeddon. They use meteors in this too, as well as earthquakes, tornadoes and floods. Maby you can look into the scripts to learn how to do it yourself. I'm not saying you should steal the scripts. But just check them out.
-
Hello everyone! So i know how to use addAction in the way the wiki told me (Run a script) , but what if i want to increase a variable of something that only exists in this script. Lets say i have a local variable called: "_speed" I can't use: _Car addaction ["Faster:", "_speed + 10"]; I also can't do this: _Car addaction ["Faster:", "[_speed] speed.sqf"]; (And in speed.sqf : _Car = _this select 0; _speed+10;) I can't seem to find any answers on the forums, so i hope you can help me with this. Remember i'm not that experienced with arma scripting. (scripting in general). Draoth.
-
Please explain addAction to me.
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
thanks! -
Please explain addAction to me.
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thank you for answering this fast. but what if i want to keep it local? The _speed is is for a car you can spawn. So i don't want everyones car to speed up if one person uses the action. -
Check if static object is hit by bullet
draoth posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So i'm have a mission, with random objects spawning in a small area. I want those objects to react when being hit by a bullet (Delete/Disappear). I don't have any idea how to do this since i have little experience with Event handlers. So if you know an easy way to do this, and teach me how i can do it myself later on i would be very happy! Draoth -
Check if static object is hit by bullet
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks! That's what i needed. Another question. if i want to change delete vehicle to something else in the future (Like playsound ). will this still work ? -
Global variable - Undefined variable in expression
draoth posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hello everyone! I'm pretty new to scripting in Arma, so i hope someone can help me out. I've created a script that makes a global variable grow when a unit spawns. it worked great in singleplayer but when i tested it in multiplayer, it suddenly threw this error. Undefined variable in expression: participants So now i'm asking myself, what did i do wrong? init.sqf participants = 0; code when unit spawns participants = participants + 1; -
Global variable - Undefined variable in expression
draoth replied to draoth's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Good tip! Here's the error. '...tered.altis\players.sqf" participants = |#|participants + 1;' Error Undefined variable in expression: participants File C:\Users\Peter\Documents\Arma 3\Missions\Testmission.altis\players.sqf, line 1 Error undefined variable in expression: participants That's all.