Jump to content

2RGT Niko

Member
  • Content Count

    13
  • Joined

  • Last visited

  • Medals

Posts posted by 2RGT Niko


  1. Well not, it doesn't totally work, AI spawns correctly but they're totally not going on marker "attack", they move somewhere on southeast, probably to coordinates 0,0, or the map's center, maybe. The problem is here i guess

    
    	_wp = _groupname addWaypoint [position attack,0,0];

    how can i fix it?

    P.S. actually attack is a folding chair, not a marker :huh2:


  2. spawngroup = {
    	params ["_marker"];
    
    	_groupname = createGroup EAST;
    
     	"Terrorista1" createUnit [getMarkerPos "_marker",_groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista2" createUnit [getMarkerPos "_marker",_groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista3" createUnit [getMarkerPos "_marker",_groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista4" createUnit [getMarkerPos "_marker",_groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista5" createUnit [getMarkerPos "_marker",_groupname,"this allowFleeing 0",random 1, "Private"];
    
    
    	_wp = _groupname addWaypoint [position attack,0,0];
    	_wp setWaypointType "DESTROY";
    
    
    	_groupname setCurrentWaypoint [_groupname, 0];
    
    };
    
    ["spawn1"] call spawngroup;
    

    That's the actual code, and it WORKS, thanks a lot guys <3


  3. 2 minutes ago, Midnighters said:

    why not just create the group inside the function? That way, regardless of what groups exist: you'd be able to assign the units to the group and execute the waypoint without having to create more and more groups if you decide to make any more units. 


    In that case, ArmA create each time a new group? Or overwrite the current one?


  4. 4 minutes ago, giallustio said:

    Is TerroristaN a cfg entry?


    TerroristaN are unit's class names

     

    5 minutes ago, giallustio said:

    Why do you create the group outside of the fnc? Do you need it for something specifically?
     

    Because I need to do that with a lot of new groups during the mission, that's why I wanted a func, or I'd need to copy paste the block of code one time for every group, and it'd be an huge amount of code

     


  5. Hi all, i'm creating a scenario in which I'd need some (a lot actually) groups of AIs to spawn in certain markers and follow a waypoint assigned after their creation. Since I need to do that a lot of times, i tried to create an Inline function inside of the .sqf file I use to control all the processes and spawns during the mission.

     

    spawngroup = {
    	params ["groupname", "marker"];
    
     	"Terrorista1" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista2" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista3" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista4" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"];
    	"Terrorista5" createUnit [getMarkerPos "marker",groupname,"this allowFleeing 0",random 1, "Private"];
    
    
    	wp = groupname addWaypoint [position attack,0,0];
    	wp setWaypointType "DESTROY";
    
    
    	groupname setCurrentWaypoint [groupname, 0];
    
    };
    
    gruppo1 = createGroup EAST;
    [gruppo1,"spawn1"] call spawngroup;
    
    gruppo2 = createGroup EAST;
    [gruppo2,"spawn2"] call spawngroup;
    
    etc...
    
    

     Obviously (because I suck) this does not work, inside the missions it returns an error like local variable in global space..

    Anyone can make this work properly? I just want a func that given a groupname and a marker, create those AI and send them to destroy anything on marker "attack"
     

×