Jump to content
Sign in to follow this  
-ami- mofo

help with this spawn script please

Recommended Posts

Hi guys,

I have this little .sqf file spawn script which as a newb mission maker is great. It's spawns 4 guys and a HMG Ifrit on a couple of markers activated by blufor detected via a trigger.

Trouble is I'd like the group to spawn and then start doing a random patrol rather than just stand there picking noses.

I'm not a scripter whatsoever so I guess I'm asking if anyone here has got some code that I can just paste into the .sqf file that will also make the group start to walk around an area (given radius of their spawn marker?) after they spawn.

I honestly don't know if I'm asking too much here? I hope not as I don't want to be getting into having to go the way of spawn script packs or anything heavy.

Anyway here is what is in the .sqf...

GroupOne_X = [getMarkerPos "spawn1", EAST, ["O_Soldier_F", "O_Soldier_F", "O_Soldier_AR_F", "O_Soldier_AT_F"]] call BIS_fnc_spawnGroup; 
{_x allowFleeing 0} forEach units GroupOne_X; 
mrapSpawn = [getMarkerPos "spawn2", 0, "O_MRAP_02_hmg_F", EAST] call bis_fnc_spawnvehicle; 
MRAP = mrapSpawn select 0; 
MRAPcrew = mrapSpawn select 1; 
MRAPgroup = mrapSpawn select 2; 
{_x allowFleeing 0} forEach units MRAPgroup; 

Thank you. ;)

Share this post


Link to post
Share on other sites

GroupOne_X = [getMarkerPos "spawn1", EAST, ["O_Soldier_F", "O_Soldier_F", "O_Soldier_AR_F", "O_Soldier_AT_F"]] call BIS_fnc_spawnGroup; 
{_x allowFleeing 0} forEach units GroupOne_X; 
mrapSpawn = [getMarkerPos "spawn2", 0, "O_MRAP_02_hmg_F", EAST] call bis_fnc_spawnvehicle; 
MRAP = mrapSpawn select 0; 
MRAPcrew = mrapSpawn select 1; 
MRAPgroup = mrapSpawn select 2; 
{_x allowFleeing 0} forEach units MRAPgroup;

[MRAPgroup, getPos leader MRAPgroup, 1000] call bis_fnc_taskPatrol;
[GroupOne_X, getPos leader MRAPgroup, 1000] call bis_fnc_taskPatrol;

Works a treat. ;)

Share this post


Link to post
Share on other sites
Hi guys,

I have this little .sqf file spawn script which as a newb mission maker is great. It's spawns 4 guys and a HMG Ifrit on a couple of markers activated by blufor detected via a trigger.

Trouble is I'd like the group to spawn and then start doing a random patrol rather than just stand there picking noses.

I'm not a scripter whatsoever so I guess I'm asking if anyone here has got some code that I can just paste into the .sqf file that will also make the group start to walk around an area (given radius of their spawn marker?) after they spawn.

I honestly don't know if I'm asking too much here? I hope not as I don't want to be getting into having to go the way of spawn script packs or anything heavy.

Anyway here is what is in the .sqf...

GroupOne_X = [getMarkerPos "spawn1", EAST, ["O_Soldier_F", "O_Soldier_F", "O_Soldier_AR_F", "O_Soldier_AT_F"]] call BIS_fnc_spawnGroup; 
{_x allowFleeing 0} forEach units GroupOne_X; 
mrapSpawn = [getMarkerPos "spawn2", 0, "O_MRAP_02_hmg_F", EAST] call bis_fnc_spawnvehicle; 
MRAP = mrapSpawn select 0; 
MRAPcrew = mrapSpawn select 1; 
MRAPgroup = mrapSpawn select 2; 
{_x allowFleeing 0} forEach units MRAPgroup; 

Thank you. ;)

I was stuck in a very similar position as yours. I was using the ALiVE system to build a huge battle but it didn't provide the "ambush along the road" scenarios I really wanted. I messed with scripting something myself for days until someone finally pointed me towards BangaBob's Enemy Occupation System. Why reinvent the wheel if you don't have to?

http://forums.bistudio.com/showthread.php?153100-Enemy-occupation-system-(eos)&highlight=EOS

You can limit or customize the unit pools all you like... basically creating a system that will randomly place any units in any vehicle. Use a marker for your group(s) to spawn in, set the spawn distance a player must be from the marker to cause the spawn and presto! I believe EOS uses UPS or UPSMON to handle AI patrolling so they will do clever things like flanking, using cover, etc. Best part? The patrol(s) *cache* so they are only "in the game" when a player has activated them. Not that big a deal if it's a small mission with one AI patrol... but my mission uses over 40 of these spawning zones with a total of about 1200 AI. ;)

Share this post


Link to post
Share on other sites

@ Grumpy old man: thanks mate I just didn't know how to incorporate that into the existing script (it's actually more simple than I thought) maybe my fault for over thinking it. But you're right it works fine lol

@ Oktyabar: I'm also going to try what you've suggested as the stock AI patrols seem really basic and stupid, lots of "derrr there's a building what now?" kind of thing with vehicles just useless around towns. Hopefully using EOS the patrol behaviour will be more realistic. Thanks.

Share this post


Link to post
Share on other sites
@ Grumpy old man: thanks mate I just didn't know how to incorporate that into the existing script (it's actually more simple than I thought) maybe my fault for over thinking it. But you're right it works fine lol

@ Oktyabar: I'm also going to try what you've suggested as the stock AI patrols seem really basic and stupid, lots of "derrr there's a building what now?" kind of thing with vehicles just useless around towns. Hopefully using EOS the patrol behaviour will be more realistic. Thanks.

Overthinking things is a common issue with arma3 editing ;)

As far as I know EOS doesn't use UPSMON but shukos patrol script (might have changed, I'm not up to date)

You can also try UPSMON, it's always fun to set up a huge upsmon controlled fortified base and trying to take it out with a player commanded rifle squad.

It's hilarious how fast you're getting outflanked if you don't constantly move when facing an enemy force that's outnumbering you by far.

I have to try EOS sometime because it looks like a valid alternative to DAC which isn't working for arma3 yet.

Cheers

Share this post


Link to post
Share on other sites
Overthinking things is a common issue with arma3 editing ;)

As far as I know EOS doesn't use UPSMON but shukos patrol script (might have changed, I'm not up to date)

You can also try UPSMON, it's always fun to set up a huge upsmon controlled fortified base and trying to take it out with a player commanded rifle squad.

It's hilarious how fast you're getting outflanked if you don't constantly move when facing an enemy force that's outnumbering you by far.

I have to try EOS sometime because it looks like a valid alternative to DAC which isn't working for arma3 yet.

Cheers

No, you are right. It does use shk_patrol. I think I got the idea that it used UPS from an RPT that seemed to call it and as I don't run UPS/UPSMON in any of my current missions I guess I assumed it must be EOS. EOS is still a super nice way to generate patrols in a marker that will cache. And I guess I have to offer a tip of the hat to BIS then, for AI reactions, because they've always been quite a handful in my missions! :)

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  

×