Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

Rkillah-Rye

Member
  • Content Count

    14
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

About Rkillah-Rye

  • Rank
    Private First Class
  1. Rkillah-Rye

    Emulated Minefield script

    Im back and I have found where the problem is, it is not the script itself it is the trigger, when the vehicle activates the trigger and the vehicle stays in the trigger area it is not deactivating, so my question is now how can i group the trigger via script to all of the players, so it is only activated deactivated by each player seperately. RK ---------- Post added at 07:26 PM ---------- Previous post was at 07:24 PM ---------- The Trigger itself is only created once on the server, but the script runs on the player so is this possible to have 2 different players activate the trigger at the same time?
  2. Hi my problem is with the following script, the script itself works wonders but breaks if the script is triggered when in a wheeled/tracked vehicle. The script execution is in a repeating detect blufor trigger that covers a specific area when trigger is activated it runs the following script.. //hit_minefield.sqf ---- delayed trigger every specific increment set in reactivating trigger emulates a minefield player setVariable ["in_Minefield", TRUE]; _in_minefield = player getVariable "in_Minefield"; while {_in_minefield} do { if(alive player)then { _in_minefield = player getVariable "in_Minefield"; _Who = player; _velx = velocity (vehicle player) select 0; _vely = velocity (vehicle player) select 1; _spd = (_velx + _vely); _air = vehicle player isKindOf "Air"; _veh = vehicle player; [WEST,"base"] sideChat format["%1 stepped in a minefield traveling at speed %2 as a %3 / air vehicle = %4",_Who,_spd,_veh,_air];// debugging if (vehicle player isKindOf "Air")then { [WEST,"base"] sideChat format["%1 is in an air vehicle and is above the minefield",_Who];// debuggingdd }else{ [WEST,"base"] sideChat format["%1 checking are you moving in the minefield?",_Who];// debugging if (_spd != 0 or _spd != -0)then { [WEST,"base"] sideChat format["%1 is moving have you hit a mine?",_Who];// debugging _hitmine = floor(random(3)); [WEST,"base"] sideChat format["%1 is moving have you hit a mine? give me 0 for yes = %2",_Who,_hitmine];// debugging if( _hitmine != 0)then{ [WEST,"base"] sideChat format["%1 is a lucky bastard just missed a mine",_Who];// debugging }else{ _pos = position player ; [WEST,"base"] sideChat format["%1 has hit a mine!",_Who];// debugging //bomb="Bo_GBU12_lgb" createVehicle (_pos); }; }else{ [WEST,"base"] sideChat format["%1 is standing still in a minefield",_Who];// debugging }; }; }else{ [WEST,"base"] sideChat "you are dead";// debugging player setVariable ["in_Minefield", FALSE]; }; sleep floor(random(5)); }; When the trigger is deactivated it runs this script. player setVariable ["in_Minefield", FALSE]; The problem is as follows if the player enters the "minefield"(trigger area) in a vehicle and then gets out of the vehicle and then walks out of the "minefield"(trigger area) the script continues to run on the player? this tells me it is still running on the vehicle entity but doing the speed checks and vehicle checks on the player entity but its ignoring the player variable "in_Minefield" as if it has attached this variable to the vehicle, but it works seemlessly if you go in and out on foot. ps the side chat is just for debugging purposes.
  3. Thanx again twirly, ok this works for the vehicles and air, but not for the player as the player does not use the simple vehicle respawn. any other ideas??? Thanx in advance :) I have also modded the simple vehicle respawn script to add parts damage when the vehicle is respawned dynamically if anyone would like this script as it works pretty well.(see below) /* ========================================================= Simple Vehicle Respawn Script v1.7 by Tophe of Östgöta Ops [OOPS] Edited by RKillah Put this in the vehicles init line: veh = [this] execVM "vehicle.sqf" Options: There are some optional settings. The format for these are: veh = [this, Delay, Deserted timer, Respawns, Effect, Static] execVM "vehicle.sqf" Default respawn delay is 30 seconds, to set a custom respawn delay time, put that in the init as well. Like this: veh = [this, 15] execVM "vehicle.sqf" Default respawn time when vehicle is deserted, but not destroyed is 120 seconds. To set a custom timer for this first put the respawn delay, then the deserted vehicle timer. (0 = disabled) Like this: veh = [this, 15, 10] execVM "vehicle.sqf" By default the number of respawns is infinite. To set a limit First set the other values then the number of respawns you want (0 = infinite). Like this: veh = [this, 15, 10, 5] execVM "vehicle.sqf" Set this value to TRUE to add a special explosion effect to the wreck when respawning. Default value is FALSE, which will simply have the wreck disappear. Like this: veh = [this, 15, 10, 5, TRUE] execVM "vehicle.sqf" By default the vehicle will respawn to the point where it first was when the mission started (static). This can be changed to dynamic. Then the vehicle will respawn to the position where it was destroyed. First set all the other values then set TRUE for dynamic or FALSE for static. Like this: veh = [this, 15, 10, 5, TRUE, TRUE] execVM "vehicle.sqf" If you you want to set the INIT field of the respawned vehicle, first set all other values, then set init commands. Those must be inside quotations. Like this: veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf" Default values of all settings are: veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf" Contact & Bugreport: [email protected] ========================================================= */ if (!isServer) exitWith {}; // Define variables _unit = _this select 0; _delay = if (count _this > 1) then {_this select 1} else {30}; _deserted = if (count _this > 2) then {_this select 2} else {120}; _respawns = if (count _this > 3) then {_this select 3} else {0}; _explode = if (count _this > 4) then {_this select 4} else {false}; _dynamic = if (count _this > 5) then {_this select 5} else {false}; _unitinit = if (count _this > 6) then {_this select 6} else {}; _haveinit = if (count _this > 6) then {true} else {false}; _hasname = false; _unitname = vehicleVarName _unit; if (isNil _unitname) then {_hasname = false;} else {_hasname = true;}; _noend = true; _run = true; _rounds = 0; if (_delay < 0) then {_delay = 0}; if (_deserted < 0) then {_deserted = 0}; if (_respawns <= 0) then {_respawns= 0; _noend = true;}; if (_respawns > 0) then {_noend = false}; _dir = getDir _unit; _position = getPosASL _unit; _type = typeOf _unit; _dead = false; _nodelay = false; // Start monitoring the vehicle while {_run} do { sleep (2 + random 10); if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true}; // Check if the vehicle is deserted. if (_deserted > 0) then { if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then { _timeout = time + _deserted; sleep 0.1; waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0}; if ({alive _x} count crew _unit > 0) then {_dead = false}; if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; if !(alive _unit) then {_dead = true; _nodelay = false}; }; }; // Respawn vehicle if (_dead) then { if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;}; if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;}; if (_explode) then {_effect = "M_TOW_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;}; sleep 0.1; deleteVehicle _unit; sleep 2; _unit = _type createVehicle _position; _unit setPosASL _position; _unit setDir _dir; //added by RK - adds specific damagetype to vehicle when respawned only when using dynamic respawn. //parts -- //"motor"=engine(ENG) //"pas_L"=left track //"pas_P"=right track //"vez"=turret //"zbran"=gun //"kola"=wheels //"velka vrtule"=top rotor(MROT) // "mala vrtule"=small rotor(ATRQ) //[["part",1],["part",damage]] damage is 0 perfect to 1 completely inoperable _fuelAmnt = 0; // this sets the fuel amount for the vehicle when respawned. 0=empty 1=full if (_dynamic)then{ _unit setdamage 0.8;//use this to add damaged textures then overide by setting parts damage _partsdmg = [];_p=0; if (_unit iskindof "tank")then { _partsdmg = [["pas_L",1],["pas_P",1],["vez",1],["zbran",1],["motor",0.5]]; }; if (_unit iskindof "car")then { _partsdmg = [["kola",1],["motor",0.5]]; }; if (_unit iskindof "truck")then { _partsdmg = [["motor",0.5],["zbran",1]]; }; if (_unit iskindof "air")then { _partsdmg = [["velka vrtule",1],["mala vrtule",1],["motor",0.5]]; }; {_unit sethit [(_partsdmg select _p)select 0, (_partsdmg select _p)select 1];_p=_p+1;}forEach _partsdmg; _unit setfuel _fuelAmnt; }; // end _unit if (_haveinit) then {_unit setVehicleInit format ["%1;", _unitinit]; processInitCommands;}; if (_hasname) then {_unit setVehicleInit format ["%1 = this; this setVehicleVarName ""%1""",_unitname]; processInitCommands;}; _dead = false; // Check respawn amount if !(_noend) then {_rounds = _rounds + 1}; if ((_rounds == _respawns) and !(_noend)) then {_run = false;}; }; }; RK
  4. Thanks Twirly, I tried this. I dont think I was clear in my explanation :) lol But what I mean by the marker gets left behind is that it stays where the unit has died / destroyed and when player is respawned has no marker as it has been left behind lol man im getting tired :) ?? RK
  5. Hi I was wondering if someone could help me, I have adapted the marker script by hogmason so it works for all units/vehicles/sides the problem is when the player or vehicle, choppa gets destroyed it leaves the marker behind could someone read through the script and tell me where i am going wrong?? I use this in conjuction with the simple vehicle respawn script set to respawn the vehicle (dynamic) where it was destroyed. // marker script by hogmason, edited by RKillah // All in one marker for any type of unit on any side with damaged/hurt/death text // init - null = [this] execVM "markers\aio_marker.sqf"; _unit = _this select 0; _unitname = vehicleVarName _unit; _theName = "";_hurt="";_hurttxt = "";_deathtxt ="";_mtype=""; _mrkname = format["%1m",_unitname]; _mrkr = createMarkerLocal [_mrkname, [0,0]]; _mrkname setMarkerShape "ICON"; _mrkname setMarkerSize [1,1]; _side = side _unit; switch (_side) do { case west: { _mrkname setMarkerColor "ColorBlue" ;}; case east: { _mrkname setMarkerColor "ColorRed" ;}; case resistance: { _mrkname setMarkerColor "ColorGreen" ;}; default { _mrkname setMarkerColor "ColorYellow" ;}; }; if (_unit iskindof "man")then { _mtype="Man";_deathtxt = "lost the will to live";_hurttxt = "is hurt";_theName = name _unit; }else{ if (_unit iskindof "tank")then {_mtype="Tank";}; if (_unit iskindof "car")then {_mtype="car";}; if (_unit iskindof "truck")then {_mtype="Vehicle";}; if (_unit iskindof "air")then {_mtype="air";}; _deathtxt = "needs repair & fuel";_hurttxt = "needs repair & fuel";_theName = _unitname; }; _mrkname setMarkerType _mtype; while {true} do { waitUntil {alive _unit;}; _side = side _unit; switch (_side) do { case west: { _mrkname setMarkerColor "ColorBlue" ;}; case east: { _mrkname setMarkerColor "ColorRed" ;}; case resistance: { _mrkname setMarkerColor "ColorGreen" ;}; default { _mrkname setMarkerColor "ColorYellow" ;}; }; _mrkname setMarkerDir getDir _unit; _mrkname setMarkerPos getPos _unit; if (getdammage _unit>0.1)then{_hurt= format["%1",_hurttxt]}else{_hurt=""}; _mrkname setMarkerText format["%1 %2",_theName,_hurt]; sleep 0.5; [_side,"base"] sideChat format["%1 %2",_theName,_deathtxt];//notification when vehicle is destroyed/player dies _mrkname setMarkerColor "ColorBlack";//player unit dead };
  6. Hi I too would like to know about this event handler, as I am using a respawn script to respawn a vehicle where it has been destroyed, ok this works fine, I setdammage 0.9 but the vehicle still drives, I would like to set the damage to say the wheels/tracks so the vehicle needs repair before it can be driven again. I have searched and this is the nearest I have gotten to finding some information on this subject. I am thinking that this script clipping by celery would this work for a vehicle are the legs the wheels/tracks or is this just specific to troops?? RK ---------- Post added at 03:20 AM ---------- Previous post was at 03:03 AM ---------- Me again, I was barking up the wrong tree just found a variable "sethit" this will do the job I want. thanks anyway :) RK
  7. I have been playing about with the exitWith statement in a Script and found that it works best passing variables to statements lower down in the script. But I found that it will not perform things such as addaction or to run another script to addaction and passing the variables, this may be me being a dumbass but I think its because it is still within the "while" "for" "if" scope so I did this. while {Loop_Statement} do { //loop code to execute vartoPass = blah blah if(Exit_Statement) exitwith{exited=true;passVar=varToPass};//exit loop and pass new variable to lower if statement you can pass several variables including the ones from within the "while" "for" "if" scope. }; if(exited)then{ //code to execute [object] addaction [("<t color='#FF4040'>" + "Title" + "</t>"), "script.sqf",passVar]; }else{ //code to execute if loop completes }; I found this a way to pass variables from within a while statement in one script to another script via an action added to an object. The variables within the loop scope need to be passed out to the script below the loop then passed to whatever, im going to shut up now lol. If I am wrong I stand corrected because I am new to scripting for Arma2. later RK
  8. Rkillah-Rye

    Trigger Problem!!

    Thx INK shall take a look tomorrow cus jus got off hols and im knackered :) L8tr RK
  9. Rkillah-Rye

    Trigger Problem!!

    Hi I set the trigger for blufor and the chopper blufor and Me as blufor ("I mistyped that the trigger was set for opfor in the explanation above") but when I(blufor player) shoots down the chopper this is when the trigger stops working and only works when set for "anyone" not opfor, blufor,independent or civilian it is as if your side(blufor player) becomes a traitor to all factions lol. I was just doing this as a test as the finished script will be constantly spawning opfor reinforcements with dynamic names to dynamic marker areas depending on where is being assaulted every so often until the radio stations are knocked out or the reinforcement base in the east in a coop mission for 30 players. I hope I can get this to work I shall try your suggestions next week as I gotta get my gaming fix now before I head off cus I is off on my hols until next weekend L8tr RK
  10. Hi thank for that I shall try it when I get back off on hols for a week early in the morn so Ill let you know then if this cures my problem L8tr RK
  11. My Aim is to create reinforcements that attack at several positions using several triggers with the vehicles and units being renamed if they all ready exist only using one dynamic script that increments the name. I have simplified my script so it will only create one helicopter and group(pilot) I have a trigger (OPfor present) that is set as repeatable which executes a script below: if (alive Heli1)then{Hint"im outta here you exist";exit;}; if (isNil("Heli1"))then{Hint"Heli1 dont exist";goto createhelo;}else{exit;}; if (!alive Heli1)then{Hint"Heli1 dead";goto createhelo;}else{exit;}; #createhelo groupALPHA1 = CreateGroup West; Heli1 = createVehicle ["MH60S", [(getMarkerPos "spawnPNT_1") select 0,(getMarkerPos "spawnPNT_1") select 1,100], [], 0, "FLY"]; Heli1 setDir 270; Heli1 setVelocity [-50, 0, 0]; veh_Pilot = groupALPHA1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"]; veh_Pilot moveInDriver Heli1; wp1 = groupALPHA1 addwaypoint [getMarkerPos "WPmove", 10]; wp1 setwaypointtype "MOVE";wp1 setWaypointSpeed "FULL"; wp2 = groupALPHA1 addwaypoint [getMarkerPos "WPdropoff", 10]; wp2 setwaypointtype "MOVE";wp2 setWaypointSpeed "FULL"; wp3 = groupALPHA1 addwaypoint [getMarkerPos "WPparkup", 10]; wp3 setwaypointtype "GETOUT"; wp3 setWaypointSpeed "NORMAL"; This works fine when the helicopter doesnt exist and the check if the helicopter is alive works fine aswell but when I destroy the helicopter all triggers on the map stop working all together anybody know why? I have even added a trigger with just a hint in it which also stops working? L8tr RK ---------- Post added at 01:11 AM ---------- Previous post was at 12:41 AM ---------- Right I have done a little testing and apparently when you destroy one of your own Vehicles/units you are no longer able to trigger blufor,opfor,civilian or independent but you can trigger a trigger that is set to anybody, So this still has not solved my dilemma as my helicopter still does not spawn :( L8tr RK
  12. Hi JDog I have found a problem with "setWaypointStatements" this I can not use because this is for stopping the current waypoint completing before a specific "condition" is met. If I put anything to execute in the condition field it executes it straight away hence the waypoint can now be completed. Such as if you had a waypoint set at an object,vehicle or unit "lets say a soldier named Bill" that you had to destroy until it has been destroyed the waypoint(KillBill) would still be active even if you had reached the waypoint. WPKillBill setWaypointStatements [true, !alive Bill] L8tr RK ps I have written it like this for newbies to scripting ---------- Post added at 09:51 PM ---------- Previous post was at 09:35 PM ---------- I have fixed my executing the script via a "trigger" using "BLUFOR present" with this && MH60S_1 in thislist in the condition which checks if a blufor vehicle or unit named MH60S_1 is in the trigger area and in the on Act I have put [OPrein_1,MH60S_1] exec "OPsquad.sqs"; To Execute the script It would have been easier for it to be called in the "on ACT" of the waypoint though so if you or anyone out there knows the solution to this please let me know. L8tr RK
  13. I think I have found my solution but I dont know how to pass the arguments I found it on the wiki http://community.bistudio.com/wiki/setWaypointScript here is what I want to happen at the waypoint activation MH60S_1 flyInHeight 90;[OPrein_1,MH60S_1] exec "OPsquad.sqs"; Any pointers from anyone :) L8tr RK hittin the sack work in mornin :mad: ---------- Post added at 01:59 AM ---------- Previous post was at 01:57 AM ---------- damn that was a quick reply thanx JDog L8tr RK ---------- Post added at 02:38 AM ---------- Previous post was at 01:59 AM ---------- OK I got the script firing off with that waypoint setWaypointStatements [condition, statement] but I have problems with my script that it is firing off, it doesnt seem to be passing the ;[OPrein_1,MH60S_1] over correctly more on this to follow.( but not 2nite :) ) Big shout goin out to JDog for the quick response. well I am outta here now Im quite tired but pleased with my progress L8tr All RK
  14. Hi this is my first post on here, I am quite new to scripting for arma 2, I have experience with other script languages but I am in need of help. OK I have got an MH60S spawning at a set marker position then it is moving to the next waypoint "move" order then it moves to the next waypoint with a "getout" order, my problem is when it reaches the first waypoint I need it to execute a script. so my question is how do I create the "on act" in the script? the code im using to spawn the units and create waypoints below OPHeliRein_1 = CreateGroup West; MH60S_1 = createVehicle ["MH60S", [(getMarkerPos "spawnPNT_1") select 0,(getMarkerPos "spawnPNT_1") select 1,100], [], 0, "FLY"]; OPPilot_1 = OPHeliRein_1 createUnit ["USMC_Soldier_Pilot", [0,0,1], [], 0, "CAN_COLLIDE"]; OPPilot_1 moveInDriver MH60S_1; wp1 = OPHeliRein_1 addwaypoint [getMarkerPos "WPmove", 0]; wp1 setwaypointtype "MOVE"; wp2 = OPHeliRein_1 addwaypoint [getMarkerPos "WPdropoff", 1]; wp2 setwaypointtype "GETOUT"; I have looked through a mission.sqm and could just find so I tried wp1 = OPHeliRein_1 addwaypoint [getMarkerPos "WPmove", 0]; wp1 setwaypointtype "MOVE"; wp1 expActiv="code to be executed here" but to no avail. :mad: Any help would be appreciated L8tr RK
×