Jump to content

majorpain1588

Member
  • Content Count

    11
  • Joined

  • Last visited

  • Medals

Posts posted by majorpain1588


  1. I am working with an artillery script and have got it to work with mortars, but if I use M119s they just point,but never shoot. I have entered the arty piece and they always have 0 ammo.

    I have placed: this addMagazine "ARTY_30Rnd_105mmHE_M119"; in all of the M119s init fields, but its still a no go. They still have no ammo.

    Anyone have any ideas on how add ammo to them?


  2. ok guys I've been working with this all night and could use some help.

    I am trying to make a script that works like this:

    1. All members of AI infantry group die

    2. after a short delay a new AI infantry group spawns at a marker

    3. the new group follows waypoints back to the battle.

    I've had it work where individual soldiers die and respawn by themselves, but I would like groups to respawn. The big thing is knowing when all group members are dead and then spawning the group. This is where I am at right now, but it doesn't work...

    In squad leaders init field:

    nul = [this, 3, 10, "east_spawn"]execVM "AI_respawn\AI_respawn_init.sqf"; 

    Script file:

    if (!isServer) exitWith {};
    
    _unit 			= _this select 0;
    _lives			= _this select 1;
    _delay 			= _this select 2;
    _respawn_point	= _this select 3;
    
    _name = call compile format ["%1", _unit];
    _type 			= typeOf _name;
    _group 			= group _name;
    _weapons 		= weapons _name;
    _mags 			= magazines _name;
    
    waitUntil ({alive _x} count units _group < 1);
    
    if (_lives == 0) exitWith {};
    
    _lives = _lives - 1;
    
    _wait = Time + _delay;
    waitUntil {Time > _wait};
    
    _randA = random 50;
    _randB = random 50;
    
    _posA = getMarkerPos _respawn_point;
    _posB = [(_posA select 0) + (_randA), (_posA  select 1) + (_randB)]; 
    
    _skill = [0.3, 0.5];
    _side = EAST;
    _units = ["RU_Soldier_SL", "RU_Soldier_TL", "RU_Soldier_AR", "RU_Soldier_MG", "RU_Soldier_LAT", "RU_Soldier_GL", "RU_Soldier", "RU_Soldier"];
    
    _newGroup = [_pos, _side, _units, [], [], _skill] call BIS_fnc_spawnGroup;
    
    sleep 1;
    
    _newGroup addwaypoint[getmarkerpos"East_WP1",0]
    [_newGroup,1] setwaypointtype"Move"; 
    _newGroup addwaypoint[getmarkerpos"East_WP2",1]
    [_newGroup,1] setwaypointtype"Move"; 
    
    
    if (true) exitWith {};

    Maybe that code can be fixed or maybe there is something way easier. I am new to this.

    Thanks


  3. Hey guys. I am new to Arma2 and to scripting.

    I have seen how to respawn the player with the whole description.ext, but not sure how it can be applied to AI.

    Is there a way the have an AI unit respawn after it dies and then have it follow waypoints after it has respawned? I would like to make a mission that spawns killed OPFOR back at their base and then when they respawn they travel back to the battle to create a kind of continuous battle.

    Thanks:)

×