Jump to content

draoth

Member
  • Content Count

    73
  • Joined

  • Last visited

  • Medals

Everything posted by draoth

  1. Thank you so much! People like you are the reason i keep scripting. Have a good day!
  2. 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
  3. 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
  4. 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
  5. 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...
  6. 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
  7. He places the object directly in the character that's pretty smart. Thanks man.
  8. 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
  9. 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.
  10. 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
  11. 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.
  12. 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
  13. 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 ;).
  14. draoth

    Meteorite

    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.
  15. 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.
  16. 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.
  17. 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
  18. 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 ?
  19. 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;
  20. 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.
×