Jump to content

Silderoy

Member
  • Content Count

    158
  • Joined

  • Last visited

  • Medals

Everything posted by Silderoy

  1. my thought is that you first of all need to edit the config file and the model of the aircraft, and basicly creating a new mod... but I guess youy could attach a 50 cal MG somewhere in the plane and use an addAction to get you into the gun...
  2. the problem is your script, is that "_player" is not defined. the script is expecting something, but as long as you dont define it, "_player" will return "null". In order for it to work, you just need to delete the underline before the player. so it looks like: "if ((getPlayerUID player) in _allowedPlayers) then...".
  3. The PBO contains anything that was inside the mission folder, including all scripts, pictures and other files.
  4. You can also use aimPos command. place a invisable marker in the middle of the compound, and mane it "reconMark". Place a trigger around the compound that needs to be reconed. size to your choice. Name it "reconTrig". Set condition to Bluefor present repeatedly. in the on act, write: null = [thisList, 20] execVM "seenCheck.sqf"; change the 20 to whatever you like, this is how far from the middle of the compound the player can look to complete the task. Create a new file in the mission folder and name it "seenCheck.sqf". Now open it with notepad and write this: _BlueforPlayers = _this select 0; _required = _this select 1; _targetPos = getMarkerPos "reconMark"; { while {_x in (list reconTrig)} do { _reconPos = aimPos _x; _distance = _targetPos distance _reconPos; if (_distance <= _required) then { RECONISDONE = true; }; sleep 1; }; } forEach _BlueforPlayers Now, in your Init.sqf (if you dont have one, create a new one), add this line: RECONISDONE = false; now to your task itself. create a new trigger. in the cond field, write this: RECONISDONE; and in the on act field write anything you want to happend when the compound is looked at. A bit long and complicated but Im pretty sure it will work (not tested though).
  5. add this line to the init field of the unit: this addEventHandler ["Respawn", {removeAllWeapons (_this select 0)};
  6. I dont know if you can literaly lock a door, but you can make it so if someone opens it, it closes up automaticly quick, by using animationPhase. http://community.bistudio.com/wiki/animationPhase
  7. its just a different method of making it work. take this code and put it in the init field of your instructors (or the men that will be able to use the manu): Dmenu = this addAction ["<t color='#FF4000'>Damage Menu</t>", "Damage_Menu.sqf",[],1,false,true,"","Local this && this in yourchoppername"]; Damage_Menu.sqf _target = _this select 0; _id = _this select 2; _target removeAction _id; Dtail = _target addAction ["Tail rotor Failure", "Damage_Tail.sqf",[],1,false,true,"","Local _target && _target in yourchoppername"]; Delek = _target addAction ["Destroy Electronics", "Damage_Elek.sqf",[],1,false,true,"","Local _target && _target in yourchoppername"]; Dreset = _target addAction ["Reset Aircraft", "Damage_Reset.sqf",[],1,false,true,"","Local _target && _target in yourchoppername"]; null = [_target] execVM "Damage_Close.sqf"; Damage_Tail.sqf _target = _this select 0; _target removeAction Dtail; _target removeAction Delek; _target removeAction Dreset; (vehicle _target) setHit ["mala vrtule", 1]; Dmenu = _target addAction ["<t color='#FF4000'>Damage Menu</t>", "Damage_Menu.sqf",[],1,false,true,"","Local _target && _target in yourchoppername"]; Damage_Elek.sqf: _target = _this select 0; _target removeAction Delek; _target removeAction Dtail; _target removeAction Dreset; (vehicle _target) setHit ["elektronika", 1] Dmenu = _target addAction ["<t color='#FF4000'>Damage Menu</t>", "Damage_Menu.sqf",[],1,false,true,"","Local _target && _target in yourchoppername"]; Damage_Reset.sqf _target = _this select 0; _target removeAction Delek; _target removeAction Dtail; _target removeAction Dreset; (vehicle _target) setHit ["mala vrtule", 0]; (vehicle _target) setHit ["motor", 0]; (vehicle _target) setHit ["velka vrtule", 0]; (vehicle _target) setHit ["elektronika", 0]; Dmenu = _target addAction ["<t color='#FF4000'>Damage Menu</t>", "Damage_Menu.sqf",[],1,false,true,"","Local _target && _target in yourchoppername"]; In Damage_Close.sqf _target = _this select 0; while {true} do { waitUntil {vehicle _target == _target}; _target removeAction Delek; _target removeAction Dtail; _target removeAction Dreset; Dmenu = _target addAction ["<t color='#FF4000'>Damage Menu</t>", "Damage_Menu.sqf",[],1,false,true,"","Local _target && _target in yourchoppername"]; you need to remove the eventhandlers from the init field of the chopper. and dont forget to put the name of the chopper instead of "yourchoppername" on all the scripts.
  8. thats all I could see. It should work now.
  9. Use that: Dmanu = _veh addAction ["<t color='#0000FF'>Damage Manu</t>", "Damage_Manu.sqf"]; found the (stupid) problem i did: Damage_Close.sqf: _veh = _this select 0; if ([color="#FF0000"]([/color]count (crew _veh)) == 0) then { _veh removeAction Dmanu; _veh removeAction Dtail; _veh removeAction Dreset; }; my fail, sorry. :p
  10. it depands on the model your using. if its a custom mod, not a defult one, then the hitpoints might not be initialized. the mod builder need to make those hit points...
  11. Silderoy

    Chopper Issues

    make sure they are not grouped to each other.
  12. that might be it: Damage_Close.sqf: _veh = _this select 0; if (count (crew _veh)) [color="#FF0000"]=[/color]= 0) then { _veh removeAction Dmanu; _veh removeAction Dtail; _veh removeAction Dreset; }; it will remove the actions when the chopper is empty. if there are gunners or riders in the back then it will still have the actions.
  13. ok there are a few scripts you need to create: Damage_Init.sqf Damage_Manu.sqf Damage_Close.sqf Damage_Tail.sqf Damage_Reset.sqf now, in the editor, add to the chopper init field the following: in = this addEventHandler ["GetIn", {_this execVM "Damage_Init.sqf"}]; out = this addEventHandler [""GetOut"", {_this execVM "Damage_Close.sqf"}]; this makes the scripts run when someone gets into the chopper. Damage_Init.sqf: _veh = _this select 0; if ((count (crew _veh)) < 2) then { Dmanu = _veh addAction ["Damage Manu", "Damage_Manu.sqf"]; }; Damage_Manu.sqf: _target = _this select 0; _id = _this select 2; _target removeAction _id; Dtail = _target addAction ["Damage Manu - Tail rotor Failure", "Damage_Tail.sqf"]; Dreset = _target addAction ["Damage Manu - Reset Aircraft", "Damage_Reset.sqf"]; Damage_Tail.sqf: _target = _this select 0; _target removeAction Dtail; _target removeAction Dreset; (vehicle _target) setHit ["mala vrtule", 1]; Dmanu = _target addAction ["Damage Manu", "Damage_Manu.sqf"]; Damage_Reset.sqf: _target = _this select 0; _target removeAction Dtail; _target removeAction Dreset; (vehicle _target) setHit ["mala vrtule", 0]; Dmanu = _target addAction ["Damage Manu", "Damage_Manu.sqf"]; Damage_Close.sqf: _veh = _this select 0; if (count (crew _veh)) = 0) then { _veh removeAction Dmanu; _veh removeAction Dtail; _veh removeAction Dreset; };
  14. so you say filling the area with flat objects would be the only way? and you have any idea of what object could fit the best?
  15. Hello. I want an action to be added to a plane once a specific unit is inside. Then once the unit exits, the action will bee removed. The code I use for now is: While {true} do { if (!(pf1 == vehicle pf1)) then { _vehicle = vehicle pf1; null = [_vehicle] execVM "IPscripts\IP_init.sqf"; waitUntil {pf1 == vehicle pf1}; _vehicle removeAction IPinit; _vehicle removeAction IPexit; _vehicle removeAction IPengine; _vehicle removeAction IPinstruments; _vehicle removeAction IPflaps; _vehicle removeAction IPgear; _vehicle removeAction IPall; _vehicle removeAction IPreset; }; sleep 5; }; but it does not remove the actions after the unit has exited... any ideas? Regards, Silderoy.
  16. Silderoy

    Move Object Over Time

    move it by a "for" loop. create a new script called opengate.sqf. in it put: _wall = _this select 0; _id = _this select 2; _wall removeAction _id; for [{_i = 0},{_i < 2},{_i = _i + 0.05}] do { _wall setpos [ getPos _wall select 0, getPos _wall select 1, (getPos _wall select 2) - 0.05]; sleep 0.05; }; close = _wall addAction ["Close Gate","closegate.sqf"]; and then create another script named "closegate.sqf": _wall = _this select 0; _id = _this select 2; _wall removeAction _id; for [{_i = 0},{_i < 2},{_i = _i + 0.05}] do { _wall setpos [ getPos _wall select 0, getPos _wall select 1, (getPos _wall select 2) + 0.05]; sleep 0.05; }; open = _wall addAction ["Open Gate","opengate.sqf"]; and in the init field of the wall in the editor write this: open = this addAction ["Open Gate","opengate.sqf"];
  17. yes, you can move it with very small steps. for example if you want to move it 2 meters up, you can use something like this: gate = _this select 0; id = _this select 2; button removeAction id; for [{_i = 0.05},{_i < 2.01},{_i = _i + 0.05}] do { gate setpos [ getPos gate select 0, getPos gate select 1, _i]; sleep 0.05; }; button addAction ["Close Door","closedoor.sqf"]; it will move 5cm every 0.05 seconds, until it gets to 2 meters. 40 small moves...
  18. I use the "fired" eventhandler to get the numbers of rounds fired, and I need to get te number of round hitting the target. The final result would be some kind of a test to check the percentage of hits.
  19. you are right, the syntax is wrong. you should use: _convoglio = ["mas_ita_veh_LR_cd","mas_ita_veh_LR_medv"]; _puntadilancia= _convoglio select 1; waitUntil {vialibera = true}; _puntadilancia setPos (getMarkerPos "asd"); if (!alive _puntadilancia) then { hint "Hanno distrutto il convoglio!"; }; EDIT: a small fail of myself... :p "setMarkerPos" is used for markers, and you vehicle is not a marker. in that case use "setPos"...
  20. thought about using this, but it works only on units... I have an area of group (the map's terrain) designated as "target". any way to do this without filling the area with objects? at the moment it looks like that: with the black lines being earthern ramps, the red star being a laser target, and the gray area being the target. there is a trigger covering the target area exactly. I need to check if a bullet hits the gray area...
  21. Thank you very much! I will check the ways you suggested! for the info thing. its not that I have a problem to show those scripts, but its an entire script system... there are 10 different scripts in there. well here are the main 3: IPinit.sqf: { While {true} do { if (!(_x == vehicle _x)) then { _vehicle = vehicle _x; null = [_vehicle] execVM "IPscripts\IP_init.sqf"; waitUntil {_x == (vehicle _x)}; _vehicle removeAction IPinit; _vehicle removeAction IPexit; _vehicle removeAction IPengine; _vehicle removeAction IPinstruments; _vehicle removeAction IPflaps; _vehicle removeAction IPgear; _vehicle removeAction IPall; _vehicle removeAction IPreset; }; sleep 5; }; } forEach [CO,XO,ins1,ins2,ins3,ins4]; IPscripts\IP_init.sqf: _ins = _this select 0; IPinit = _ins addAction ["<t color='#3333FF'>Open Instructor Panel</t>", "IPscripts\IP_main.sqf", [], 807]; IPscripts\IP_main.sqf: _target = _this select 0; _caller = _this select 1; _id = _this select 2; _target removeAction _id; IPexit = _target addAction ["<t color='#3333FF'>Exit Instructor Panel</t>", "IPscripts\IP_exit.sqf", [], 807]; IPengine = _target addAction ["<t color='#3333FF'> Engine Failure</t>", "IPscripts\IP_engine.sqf", [], 806]; IPinstruments = _target addAction ["<t color='#3333FF'> Instruments Failure</t>", "IPscripts\IP_instruments.sqf", [], 805]; IPflaps = _target addAction ["<t color='#3333FF'> Flaps Failure</t>", "IPscripts\IP_flaps.sqf", [], 804]; IPgear = _target addAction ["<t color='#3333FF'> Gear Failure</t>", "IPscripts\IP_gear.sqf", [], 803]; IPall = _target addAction ["<t color='#3333FF'> Combined Failure</t>", "IPscripts\IP_combined.sqf", [], 802]; IPreset = _target addAction ["<t color='#3333FF'> Reset Aircraft</t>", "IPscripts\IP_reset.sqf", [], 801]; and each of those scripts are used to simulate a failure. its built for a training map for my unit. for example the IP_engine.sqf: _target = _this select 0; _caller = _this select 1; _id = _this select 2; _veh = vehicle _caller; [-1, {(vehicle _veh) setFuel 0; _veh vehicleChat "Engine failure occured.";}] call CBA_fnc_globalExecute; btw this code works only as the pilot. as a gunner it doesnt work... any ideas? so those are the codes. I will try your ideas and let you know. Regards, Silderoy EDIT: OK! tested it and it works perfectly with the getIn and getOut eventHandlers! thank you very much Animus! now got just the same problem I had for the last month... how do I check if a bullet hit a specific area??? tried this, but it doesnt work... _shooterEH = currentunit addEventHandler [ "fired", { _Projectile = _this select 6; While {alive _Projectile} Do { _hit = [ _Projectile, "ctbtrig"] call CBA_fnc_inArea; Sleep 0.001; };
  22. Hey all. Is it possible to check if the flaps of an aircraft are up/middle/down? or 0/0.5/1? Regards, Silderoy.
  23. "crew" also counts the ride in back?
  24. FUEL: this is why I used "<=" and not "==". so if the fuel level is 90% OR LOWER at a certain cycle. if you have a "while" loop, always have a sleep in there, or it will take alot of server resources. heres a different method: _fuelLevel = fuel chopper1; for [{_i = 0.9},{_i = 0},{_i = _i - 0.1}] do { while {_fuelLevel > _i} do { _fuelLevel = fuel chopper1; sleep 2; }; hint format ["Fuel Level: %1 %", (_i * 100)]; }; if the chopper starts with less then 90% fuel, it will get you few hints very quickly, untill it gets to the corrent amount. for example you have 68% then you will see this: then it will get back to normal and wait untill the fuel level goes under 60%. RAIN: if (isServer) then { _rainLevel = rain; if (_rainLevel>0) then { hint "It IS raining"; } else { hint "It is NOT raining"; }; sleep 1; hint ["_rainLevel = %1",_rainLevel]; }; what doesnt work here? what you want to happen if it IS raining and what you want to happen if it is NOT raining? tell me what the final hint says, _rainLevel = ? Regards, Silderoy
×