Jump to content
Murklor

Editor based AI spawn by trigger

Recommended Posts

Thanks a lot WulfyWulf for this update, it opens a whole new possibilities to us mission makers with this awesome script.

I would like to raise two points which would be nice to update as well:

- possibility to also import faces (setFace) and voices (setSpeaker) to reinforced units; for instance if I want to spawn vietcongs with Asian faces and russian voices using the traditional CSAT units as a base for my loadout script.

- including formations, unless mistaken, spawned units will only start/advance in wedge formations although you tell them otherwise in the waypoints. except for 'safe' stance where they will move in a slow column.

Many thanks for your help.

Share this post


Link to post
Share on other sites

Thanks guys! Awesome work Murk! I get undefined variables when implement this script, but it doesn`t actually seem to affect its ability to be carried out. Cheers!

Share this post


Link to post
Share on other sites

Question: Do units despawn again when you go away from the spawn range?

 

Also, what if they spawn in a base which gets bombed heavily before they do. Does  it kill them in some way or is there a way to make sure they dont spawn anymore?

 

And if i synch the units with a module, will they still be synched when they spawn? (For example the cba modules)

Share this post


Link to post
Share on other sites

No once the units are spawned they are on the map. 

 

I don't really understand. You can set the number of times the group respawn and a delay after all the units in the group are killed. Are you asking if you bomb and area before the spawn in do they get killed. No they are not on the map until the trigger is set off.

 

What module are you talking about the units need to be syn  to a trigger to spawn in. Avibird 

Share this post


Link to post
Share on other sites

Thanks for the answer.

 

What i meant is: When i have a module synched to the group (for example a CBA patrol marker from the mod CBA_A3) or have something in its init line, will it still work?

Share this post


Link to post
Share on other sites

Yes  you can use different AI behavior    scripts in different  groups all in the same OA all using  the same trigger to call this script to spawn them with no issues.

Share this post


Link to post
Share on other sites

Hmm, i cant figure out how to get this script to work...

 

I spawned an RHS squad and synched the squadleader to a trigger. I also put the texts into the triggers and units init.

It gives me some kind of error saying some lines in your script are wrong.

Share this post


Link to post
Share on other sites

Here's a tutorial I did years ago. Follow it and the script will work.

 

This is by far the most flexible and lightest respawn script IMHO. Like others, I get the errors but they don't kick up or show in game, or stop it from working.

 

 

 

EDIT

I think I may know why there could be a problem.

 

The script tells you to put a variation of this line in the group leaders init

nul = [this,"once"] execVM "murk_spawn3.sqf

 

However, the script updated by  WulfyWulf (the one featured more recently in this thread} is named 'murk_spawn.sqf'.  The name of the script called in the init command needs to match what the script is called.

 

If you've named the script "murk_spawn.sqf" then the line calling it would have to be

 

nul = [this,"once"] execVM "murk_spawn.sqf"

 

with all the other variants following suit.

  • Like 1

Share this post


Link to post
Share on other sites

I put nul = [this,"once"] execVM "murk_spawn.sqf"; in the group leaders init.

I put Trigger1 setVariable ["murk_spawn",true,true]; in the triggers on act.

I named the Trigger Trigger1.

I synched the trigger to the group leader.

 

I have downloaded the script, which had 2 folders, demo_1.utes and demo_2.utes.

I put every file from the first one except for the mission.sqm in my mission folder.

 

When i start the mission, i get a error message saying something like ...error: missing ; line 284... and it does not despawn the units or spawn them when i activate the trigger, they just stay there like normal editor placed units. And shoot me.

 

My mission folder contains an init.sqf, loader.sqf, mission.sqm, murk_spawn.sqf and murk_spawn_loaded.sqf. But theres only the mission.sqm and the murk_spawn.sqf in the video. I tried removing everything except for both files, nothing changed.

 

Is the script broken? If not, please tell me how to make it work, i really really really want to use this!

Share this post


Link to post
Share on other sites

Which script do you have, the update from Wulfywulf or the other? If you have the Utes demo, I would think it's the older one. If this is the case, and I clearly state this in the video, the execvm command should call murk_spawn3.sqf.

 

The only file you need the murk_spawn.sqf file, nothing else.

 

Double check the name of your murk_spawn sqf, as you in the video, mine has a three at the end.

 

If you go to the youtube page of the video, I put all the code used in the video in the description.

 

The following is copied from that page

Here are the codes used in the video
Name trigger - Trigger1
Trigger onact field - Trigger1 setVariable ["murk_spawn",true,true];
Group leader init - nul = [this,"once"] execVM "murk_spawn3.sqf";

 

Share this post


Link to post
Share on other sites

Renamed murk_spawn.sqf to murk_spawn3.sqf and changed the same in the init of the group leader.

 

And i still get: ...error: missing ; line 284...

 

Maybe the script does not work anymore?

 

 

EDIT: I TRIED WULFYWULFS version AND IT WORKED! Thanks for your help anyway.

Share this post


Link to post
Share on other sites

The script works great. This is one of the main spawn unit scripts I use. make sure when you link your trigger to the units are they not on the map.  If you see them before the trigger is set off then you are doing something wrong or have the wrong script. What are you using for AI  behavior? editor way points or something  else. If you are using something else like UPS you need to put the code on the way point init. Make sure you don't have any mod's when you are first trying to get script to work. Sometimes in the ARMA world somethings never get alone lol.

Share this post


Link to post
Share on other sites

Is there a way to spawn a unit only after two separate triggers have been activated?  For example one say you have two possible missions, one to secure a vehicle depo and another to secure a town. Is there a script that would allow me to spawn in armor support for the town mission if the depo had been secured? and for the armor not to be present otherwise?

 

Share this post


Link to post
Share on other sites

There is a simple way with triggers and using this script. Have a small area with a trigger that will spawn in a unit with a waypoint moving the unit to a second trigger the will spawn the  armor units with a waypoint back to the vehicle depo ie S@D  or guard waypoint works well. I would make the unit in the first trigger damage false and have a delete command at the end of his waypoint. This way you will always get the armor support if you reach the first trigger and the unit will be deleted from from the mission. This is a very simple way of doing this using triggers old school 

OFP Days.  Avibird.

Share this post


Link to post
Share on other sites

Anyone have an updated version of this wonderful spawning script?

 

I loved using these in IF and Arma 2 and wish there was something this easy to use in Arma 3.

 

Share this post


Link to post
Share on other sites
On 02/01/2018 at 3:58 AM, rowdied said:

Anyone have an updated version of this wonderful spawning script?

 

I loved using these in IF and Arma 2 and wish there was something this easy to use in Arma 3.

 

My script JEBUS is similar, with additional features like saving unit and vehicle loadouts.....

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

×