Jump to content

MuffEater

Member
  • Content Count

    9
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by MuffEater


  1. hi guys,

    so there's a code I wrote to be able to use a "medic ability" without being a medic (I placed an addAction in the init. sqf which is : "player addAction ["Use a medikit","healing.sqf"];"):

    cnt = 0;
    if (cnt <= 3) then {
    player playMove "AinvPknlMstpSnonWrflDnon_medic1";
    sleep 2;
    player setDamage 0;
    hintSilent "Good to go.";
    cnt = cnt +1;
    };

    I wanted it to be usable only 3 times, but it is unlimited ATM...

    Any ideas?


  2. hi guys,

    so there is my problem (i'm a beginner to scripting):

    I want to simulate a random bombing over a city, and I ended up with this code:

    _v1 = position target_bomb; // game logic in the editor
    _radius = 450; 
    _type = random 4; 
    _mun = "";
    
    if(_type < 1) then {_type = 1} else {if(_type < 2) then {_type = 2} else {if(_type < 3) then {_type = 3} else {_v4 = 4}}}};
    
    switch (_type) do {
    case 1: {_mun = "Bo_FAB_250"};
    case 2: {_mun = "Bo_GBU12_LGB"};
    case 3: {_mun = "Sh_120_HE"};
    case 4: {_mun = "G_40mm_Smoke"};
    };
    
    
    _coord = getPos target_bomb;
    _tx = _coord select 0;
    _ty = _coord select 1;
    
    while {alive player} do {
    
    _x = random _radius;
    _y = random _radius;
    _z = random 1;
    _z2 = random 1;
    
    if(_z < 0.5) then {_x = -_x};
    if(_z2 < 0.5) then {_y = -_y};
    
    _mine = _mun createVehicle [_tx+_x,_ty+_y,-0.1];
    
    _v3 = random 15; 	
    Sleep _v3;
    };
    
    if (true) exitWith {};

    the problem is that no bomb never get spawned! /*===> me = sad:'( */

    any ideas??


  3. @ aqui

    It still not working but I'll try Monsada's solution when I'll get time (what isn't the case right now)

    again, thx for your help guys

    EDIT: Monsada, if I well understood your script, it assign the vehicle to the new group, but I only need several units to get in the cargo part of the chopper, is it possible to just remove this part ?

    //Si el vehiculo pertenece al grupo asignamos posiciones de piloto, sinó solo de carga

    if ( _vehgrpid == _grpid ) then {

    //Asignamos el conductor

    if ( _Drivercount > 0 && count (_units) > 0 ) then {

    _driver = _units select 0;

    [_driver,_vehicle,20] spawn MON_assignasdriver;

    _units = _units - [_driver];

    };

    //Asignamos el artillero

    if ( _Gunnercount > 0 && count (_units) > 0 ) then {

    _gunner = _units select 0;

    _gunner assignAsGunner _vehicle;

    _units = _units - [_gunner];

    };

    //Asignamos el comandante

    if ( _Commandercount > 0 && count (_units) > 0 ) then {

    _Commander = _units select 0;

    _Commander assignAsCommander _vehicle;

    _units = _units - [_Commander];

    };

    };


  4. hi,

    I've been working for a while on a little mission, where we need an extraction at the end.

    Since the other guys with us are AI, I need to tell them to get in the chopper when it's arrived.

    I made something like this:

    if (alive unit_0) then {

    _grp0 = group unit_0;

    _wp0 = _grp0 addWaypoint [position heli1, 0];

    _wp0 setWaypointType "GETIN";

    _wp0 setWaypointBehaviour "CARELESS";

    _wp0 setWaypointCombatMode "GREEN";

    _wp0 setWaypointSpeed "FULL";

    _grp0 setCurrentWaypoint [_grp0, _wp0];

    }

    else {exitWith{}};

    };

    and copy and paste it for the others AI (eventually not without changing all the "0" in "1", "2",etc...).

    The point is that it doesn't work, and I think I may commit suicid soon if I keep on going like this....:pet13:

    So, if anyone has an idea why it doesn't work (I mean they just stay here and carry on shooting on the bad Zombies), he (or she, no sexism) might become my god(dess).:notworthy:

    Thank you by advance.

×