Jump to content

frezinator

Member
  • Content Count

    128
  • Joined

  • Last visited

  • Medals

Posts posted by frezinator


  1. I really don't like to stuff complex code into the activation field of a trigger, but meh, here you have one possible solution:

    {if (_x isKindOf "Air") then {while {count (crew _x) > 0} do { ((crew _x) select 0) action ["eject", _x];};};} forEach thisList;

    The rest of the trigger's configuration is up to you :)

    it works!!! but the pilots ejects too >.< then the plane crash lol. How do you prevent the pilot from ejecting?

    ---------- Post added at 07:14 ---------- Previous post was at 07:13 ----------

    I dont think he wants the crew to bail out.

    plane is the name of the aircraft and grupp is the name of the group.

    I want everyone to be forced to eject out of the plane except the pilot.

    ---------- Post added at 07:15 ---------- Previous post was at 07:14 ----------

    {

    if (isPlayer _x) then {

    _x action ["eject", _mv22veh];

    };

    } forEach (crew _mv22veh);

    How do you prevent pilot from ejecting?


  2. How do you force eject all players out of the aircraft by using a trigger?

    For example: im using a MV-22 plane and set a waypoint called "move" somewhere on the map. Then I put a trigger before the waypoint "move". Then when the MV-22 plane is inside the trigger, all players will be forced to eject, or paradrop.

    It's like an automatic paradrop. I don't what to put in the trigger to make this work..


  3. I gonna have to test it out, ill give you an answere in an hour or so

    ---------- Post added at 15:42 ---------- Previous post was at 14:06 ----------

    OK.

    got it to work.

    I did not manage to make it with variables, so its a bit clumsy...

    SO, the Removeweapons.sqf is changed to "Removeweaponsp1.sqf", and inside there is this:

    while {true} do {
    waitUntil {!alive p1};
    waitUntil {alive p1};
    sleep 0.001;
    removeallweapons p1;
    sleep 0.001;
    };

    with p1 being your unit name.

    now you need to copy and paste it for every unit you want, and change the following things inside the script:

    while {true} do {
    waitUntil {!alive [name here]};
    waitUntil {alive [name here]};
    sleep 0.001;
    removeallweapons [name here];
    sleep 0.001;
    };

    and change the script name to "Removeweapons[name here].sqf".

    in the Init.sqf, you need to execVM all of those scripts. for example:

    execVM "Removeweaponsp1.sqf";
    execVM "Removeweaponsp2.sqf";
    execVM "Removeweaponsp3.sqf";
    execVM "Removeweaponsp4.sqf";

    sorry its so clumsy and complicated, but could not make it work anyway easier.

    P.S:

    it is very wierd, I have a very similiar script that does work with variables:

    _unit = _this select 0;
    
    while {true} do
    {
    waitUntil {!alive _unit};
    sleep 0.01;
    waitUntil {alive _unit};
    sleep 0.01;
    
    [_unit] call _setLoadout;
    
    sleep 0.1;
    };

    with the script being called with the following in the unit's init field:

    nul = [this] execVM "Removeweapons.sqf";

    but it doesnt work in this case, no metter what I did...

    hope you understand how to use that...

    THank you so much !!!! I finished testing it!! it works like a charm!!!

    I really appreciated for all the effort u put, just to figure, find, and make a script that works!!! THANK YOU SO MUCH!!!!!! it means a lot :)

    its not that complicated and clumsy, as long it works! it's all good!!! :) I don't know how to make or write scripts but I can read and understand some scripting language :)

    one more thing! This should work fine in dedicated server right?


  4. You got the first one (waituntil script) into a file and gave it the name "removeweapons.sqf"?

    Then, did you replace the [1,2,3] with the names you gave your units in the editor?

    If so, ill have to test it out...

    yes I did, I put all of that in notepad then I named it removeweapons.sqf. I also put the codes in the init.sqf and I named the players p1,p2,p3, including replacing [1,2,3,]. When I tested it, after I respawned I still have weapons..


  5. You run it through Init.sqf.

    ExecVM "Removeweapons.sqf";

    Im not really fimiliar with MP part of the script, but its is a very simple script, and it should be running ok in MP just as well as in SP...

    didn't work :(

    ---------- Post added at 06:22 ---------- Previous post was at 06:21 ----------

    try this, in each player init line:

    this addeventhandler ["respawn",{removeallweapons (_this select 0);}];

    not working :(


  6. You either place two trigger for Opfor and Blufor or use just one with "Anybody" and check which side the players are.

    Because the first attempt should be slightly easier to use, place two triggers on the same spot and set the activation BLUFOR and OPFOR, both repeatedly.

    In the activation field you've to add:

    {removeAllWeapons _x;} forEach thisList;

    There could be another solutions so if someone else has better ideas, just pop them :D

    Thank you so much Animus :) I love ur profile pic lol


  7. One must always provide a full explanation of the situation if one expects to be provided with a solution. Do not assume anything except an occasional air of intelligence and provide all relevant details.

    The solution is simple:

    (1) In the editor place an empty CRRC, name it boat and put in the init: this lock true; this lockdriver true;

    (2) Place a player character and put in the init field: this moveincargo boat;

    (3) Place another character, name it boat_driver and put in the init field: this moveindriver boat;

    (4) Place a Move waypoint just before the Get Out waypoint and on activation: boat lock false;

    (5) Place a trigger and set in the condition field (!(alive boat_driver)) and in on activation field: boat lock false;

    That way the boat gets unlocked either just before hitting the beach or when the driver gets kileld. Job jobbed.

    Sander

    I found another problem.... when I played in dedicated server, everyone was on the water swimming, not in the boat... :( is there a way I can fix this? I think it has something to do with locality problems? I have no experience doings locals..


  8. yourVehicle addEventHandler ["killed", {
       _vehicle = (_this select 0);
    
       // Spawn a new one on the exact same spot
       _newVehicle = (typeOf _vehicle) createVehicle (getPosATL _vehicle);
    
       // Delete the old one
       deleteVehicle _vehicle;
    
       _newVehicle addMagazine "2Rnd_GBU12";
       // .....
    }];

    This is one way you could achieve this, but it's not that practical because the vehicle spawns instantly after the other one got "killed", so you have to think of an appropriate way of respawning your vehicle.

    how do I run this?


  9. One must always provide a full explanation of the situation if one expects to be provided with a solution. Do not assume anything except an occasional air of intelligence and provide all relevant details.

    The solution is simple:

    (1) In the editor place an empty CRRC, name it boat and put in the init: this lock true; this lockdriver true;

    (2) Place a player character and put in the init field: this moveincargo boat;

    (3) Place another character, name it boat_driver and put in the init field: this moveindriver boat;

    (4) Place a Move waypoint just before the Get Out waypoint and on activation: boat lock false;

    (5) Place a trigger and set in the condition field (!(alive boat_driver)) and in on activation field: boat lock false;

    That way the boat gets unlocked either just before hitting the beach or when the driver gets kileld. Job jobbed.

    Sander

    Thank you so much!!!!! it worked!!!! Im really sorry for not explaining the whole details in the beginning >.< I thought there was like an easy and quick solution, that's why I didn't really explained the whole details.

    Thank you so much!!! I really appreaciated it!!! :)


  10. It works exactly as intended in my game running at default, which leads me to suspect that there are circumstances that you have failed to mention in your question, such as specifying addons and mods that alter the default behaviour of the game.

    (1) In the editor place an empty CRRC, name it boat and put in the init: this lock false; this lockdriver true;

    (2) Place a player character and put in the init field: this moveincargo boat;

    (3) Place another character and put in the init field: this moveindriver boat;

    (4) Press preview and try to change seats

    Regards,

    Sander

    My CRRC boat is not empty, there's a non-playable AI Driver in it. Im doing a boat insertion. I set a waypoint called "Getout" for my CRRC Ai drivers. So, when they reach the beach it will automatically eject the players. The problem is when we are halfway to our destination, when the enemies start shooting at us, the AI driver stops the boat or he get shot and get killed... then players are stuck in the boat because I set my CRRC boats to "locked", they can't eject out the boat.

    The reason I set my CRRC boat's to locked, is because I don't want players to get in the driver seat.

    Just to make it clear, im not using a empty Boat CRRC, I went to Blufor->Ships->CRRC.

    The CRRC has already have AI driver in it, which I set him to nonplayable.

    I hope you understand or it's clear enough to understand.

    ---------- Post added at 23:42 ---------- Previous post was at 23:29 ----------

    off the very top of my head

    {_x addaction ["Eject", "eject.sqf"]} forEach crew vehiclename

    "Eject" is what is shown in the action menu if you want a more fitting name for your action, and then you need to create an eject sqf - I'm utterly clueless with .sqf, but if we were to use the old, slightly defunct .sqs it might look like:

    _Vehicle = _this select 0
    _UnitToEject = _this select 1
    _Action = _this select 2
    
    _UnitToEject action ["eject", _vehicle]
    
    _UnitToEject removeaction _action
    
    exit
    

    [EDIT]

    can see that addaction has improved since ArmA when I last used it, so instead it might actually be better to use this in the boat's init field:

    this addaction ["Eject", "eject.sqf", "", 1, false, true, "", "_this crew _target"]

    as that is always attached to the vehicle, rather than my first example that attaches the action to the unit which is a bit clunky, and will only appear to those who are the crew of the vehicle, and not those standing outside it. Script would then update to:

    _Vehicle = _this select 0
    _UnitToEject = _this select 1
    
    _UnitToEject action ["eject", _vehicle]
    
    exit
    

    maybe someone here may be kind enough to conver that to an sqf, if not then update eject.sqf to eject.sqs

    I tried all of them including changing sqf to sqs, it still won't work :(

    ---------- Post added at 23:43 ---------- Previous post was at 23:42 ----------

    what happens if you lock it after you eject?

    when I locked it, I can't still eject out the boat.


  11. The boat must be unlocked if the passengers are to disembark the vehicle. To ensure that passengers can disembark, but cannot switch to the driver position explicitly define the vehicle as unlocked as well as having the driver position locked by putting in the init field of the CRRC:

    Regards,

    Sander

    didn't work.. I can eject but I can still switch to the driver seat :/ the driver seat won't lock..

    ---------- Post added at 09:00 ---------- Previous post was at 08:58 ----------

    lock the entire boat and create a custom eject action?

    How do you make a custom eject action?


  12. you could use a "killed" eventhandler on the vehicle. that way every time the vehicle is destroyed it fires the eventhandler and will recall the script. just use a "waituntil" command at beginning of script for vehicle to be present again. no use in re-arming a vehicle that hasn't respawned yet if your using respawn delay on it ;)

    how do you use killed eventhandler??? im not a pro scripter lol sorry T.T

    could you show me the steps?


  13. You can use addMagazine to, yeah, add magazines to units or vehicles, even if they don't have enough slots left for it.

    To add 2 more GBU's to the F35B:

    yourVehicle addMagazine "2Rnd_GBU12";

    And to add 2 more sidewinders:

    yourVehicle addMagazine "2Rnd_Sidewinder_F35";

    If you want much more of em, do it in a loop :D

    if the jet respawns, does the line "yourVehicle addMagazine "2Rnd_GBU12" disappears?

    ---------- Post added at 01:35 ---------- Previous post was at 01:32 ----------

    If you want unlimited ammo of everything aswell use this:

    this addEventHandler ["Fired","this setvehicleammo 1"];
    

    Where "this" is the plane. Edit with the appropriate name of the plane.

    thnx but I just want to increase the number of missiles not unlimited.

×