Jump to content
Sign in to follow this  
frankiie

Freshly spawned AI to move to marker?

Recommended Posts

I'm having a mission where Ai spawn in basically waves. I have it where once a trigger has gone off a set of markers spawns Ai, but I need them to move towards the base they're assaulting.

I've seen this so many times, but when I search nonstop for 30min I can't find the answer lol :/

This is what I have in the trigger to make the AI spawn, and then of course the marker's where they spawn:

GroupOne_X = Creategroup EAST; "O_Soldier_F" createUnit [getMarkerPos "spawn300",GroupOne_X,"this allowFleeing 0",random 1, "Private"];

Does anyone know how to make them move to a marker, like a waypoint once they spawn? Thanks :)

Share this post


Link to post
Share on other sites
why u insist on marker ?

u can create waypoint and then setCurrentWaypoint

https://community.bistudio.com/wiki/setCurrentWaypoint

I feel like it would be easier to just have a command to move to a certain marker. I've seen the SetCurrentWaypoint command but I can't figure it out for the life of me. :u haha

Wiki doesn't seem to be very noob friendly do you mind explaining what I put in the trigger and stuff?

Like I'm not suer what to do with the "_grp" part..

Share this post


Link to post
Share on other sites

AM1 = spawn marker+group name /basemarker = attack marker/0.6 = skill

if (!isServer) exitWith {};   
waituntil {!isnil "bis_fnc_init"};




//create AI Group 1
AM1 = createGroup east; sleep 0.5;

"O_soldier_TL_F" createUnit [getMarkerPos "AM1", AM1,"AM1_1 = this", 0.6, "sergeant"]; sleep 0.2;
"O_soldier_AR_F" createUnit [getMarkerPos "AM1", AM1,"AM1_2= this", 0.5, "corporal"]; sleep 0.2;
"O_soldier_GL_F" createUnit [getMarkerPos "AM1", AM1,"AM1_3 = this", 0.5, "corporal"]; sleep 0.2;
"O_soldier_F" createUnit [getMarkerPos "AM1", AM1,"AM1_4 = this", 0.5, ""]; sleep 0.2;
"O_soldier_F" createUnit [getMarkerPos "AM1", AM1,"AM1_5 = this", 0.5, ""]; sleep 0.2;

[AM1, getMarkerPos "basemarker", 600 ] call bis_fnc_taskAttack;
[AM1, 1] setWaypointSpeed "FULL";
[AM1, 1] setWaypointCombatMode "RED";
[AM1, 1] setWaypointBehaviour "AWARE";
sleep 0.2;

trigger

nul1 = [] execVM "ambush.sqf";
Edited by Blitzer134

Share this post


Link to post
Share on other sites
AM1 = spawn marker+group name /basemarker = attack marker/0.6 = skill
if (!isServer) exitWith {};   
waituntil {!isnil "bis_fnc_init"};




//create AI Group 1
AM1 = createGroup east; sleep 0.5;

"O_soldier_TL_F" createUnit [getMarkerPos "AM1", AM1,"AM1_1 = this", 0.6, "sergeant"]; sleep 0.2;
"O_soldier_AR_F" createUnit [getMarkerPos "AM1", AM1,"AM1_2= this", 0.5, "corporal"]; sleep 0.2;
"O_soldier_GL_F" createUnit [getMarkerPos "AM1", AM1,"AM1_3 = this", 0.5, "corporal"]; sleep 0.2;
"O_soldier_F" createUnit [getMarkerPos "AM1", AM1,"AM1_4 = this", 0.5, ""]; sleep 0.2;
"O_soldier_F" createUnit [getMarkerPos "AM1", AM1,"AM1_5 = this", 0.5, ""]; sleep 0.2;

[AM1, getMarkerPos "basemarker", 600 ] call bis_fnc_taskAttack;
[AM1, 1] setWaypointSpeed "FULL";
[AM1, 1] setWaypointCombatMode "RED";
[AM1, 1] setWaypointBehaviour "AWARE";
sleep 0.2;

trigger

Hello, thanks for replying. Was wondering if there was any different way to create them a waypoint because I didn't want to have to make a extra sqf file in the mission, since I already have a way to spawn the AI just need them to move to a waypoint. :/

Share this post


Link to post
Share on other sites
GroupOne_X = Creategroup EAST; "O_Soldier_F" createUnit [getMarkerPos "spawn300",GroupOne_X,"this allowFleeing 0",random 1, "Private"];
[GroupOne_X, getMarkerPos "waypoint", 600 ] call bis_fnc_taskAttack;
[GroupOne_X, 1] setWaypointSpeed "FULL";
[GroupOne_X, 1] setWaypointCombatMode "RED";
[GroupOne_X, 1] setWaypointBehaviour "AWARE";
sleep 0.2;

Share this post


Link to post
Share on other sites
GroupOne_X = Creategroup EAST; "O_Soldier_F" createUnit [getMarkerPos "spawn300",GroupOne_X,"this allowFleeing 0",random 1, "Private"];
[GroupOne_X, getMarkerPos "waypoint", 600 ] call bis_fnc_taskAttack;
[GroupOne_X, 1] setWaypointSpeed "FULL";
[GroupOne_X, 1] setWaypointCombatMode "RED";
[GroupOne_X, 1] setWaypointBehaviour "AWARE";
sleep 0.2;

Works great! Thanks!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×