Jump to content
Murklor

Editor based AI spawn script by trigger

Recommended Posts

Anyone know how to insert this command in spawned group:

wair1 addeventhandler ["fired", {(_this select 0) setvehicleammo 1}];

into the init field of spawned unit?

nul = [this,triggerone,"repeated",10,180] execVM "murk_spawn.sqf";

I basically want a unit with unlimited ammo every time it spawns.

Thanks for your help.

Share this post


Link to post
Share on other sites

Try this...

nul = [this,triggerone,"repeated",10,180,"wair1 addeventhandler ['fired', {(_this select 0) setvehicleammo 1}];"] execVM "murk_spawn.sqf";

PS: I have no chance to test it ATM.

/KC

Share this post


Link to post
Share on other sites
Try this...

nul = [this,triggerone,"repeated",10,180,"wair1 addeventhandler ['fired', {(_this select 0) setvehicleammo 1}];"] execVM "murk_spawn.sqf";

PS: I have no chance to test it ATM.

/KC

Thanks KeyCat. It worked perfecctly. Thanks for your help.

Share this post


Link to post
Share on other sites

Is there likely to be an update for this script?

I'm designing a MP Mission for my Arma II Clan, and while the spawn script works fine in the

editor, it doesn't work at all on the server.

Share this post


Link to post
Share on other sites

In testing your sample mission, I wanted to try something a little different, but an error occurred.

I placed an unnamed enemy Russian pilot in the sample mission and gave him 3 move waypoints and a cycle waypoint.

I then placed an empty UH-1H "Takistani Locals" chopper named "ch1" and set it to "Flying".

I put this in the init of the Russian pilot:

this assignAsdriver ch1;

[this] orderGetIn true;

this moveInDriver ch1;

nul = [this,"trigger1","wave",2,30] execVM "murk_spawn.sqf";

When I step into the trigger zone it spawns the enemy and the chopper in the air flying to their waypoints.

30 seconds later another chopper spawns and does the same. Everything seems to be working fine, but I receive this error:

File C:\Users\SUICIDAL\Documents\ArmA 2 Other Profiles\SUICIDAL\missions\demo_1.utes\murk_spawn.sqf, line 206
Error in expression <Turret = _path + [_turretIndex];
(_crew select _currentCrewMember) moveInTurret >
 Error position: <select _currentCrewMember) moveInTurret >
 Error Zero divisor

So my question is... is there a way to fix this so the error will not appear? Maybe add some extra bit of script to detect a situation where the ai was moved into an empty vehicle? I thought maybe there might be a way to change the spawn script a little so the error won't appear, but I wouldn't know how to change it nor would I feel right in doing so.

I'm making a coop mission with Russian enemy, but I want to let them use the Takistani Locals chopper and the Takistani mi-8 chopper to transport troops. I'd rather not have Takistani pilots in this particular mission, lol.

Also, on another note, I noticed that the script did not work for spawning boats, so I added "Ship" to the list of vehicles in the spawn script. I think it's line 85. I changed it to look like this:

	if ( (vehicle _unit) isKindOf "LandVehicle" OR (vehicle _unit) isKindOf "Air" OR (vehicle _unit) isKindOf "Ship") then { 

It worked great so I thought I would mention it to you in case you might want to add it to your next update.

Also, I had problems when trying to paradrop enemy from more than 1 chopper in my mission. Your sample mission uses a C130. I had to do a bit of poor-mans scripting to get it to work in my mission. I was wondering if maybe in your next update you could also maybe try to add to your sample mission a chopper that drops troops and then after like 30 seconds another chopper spawns and does the same. I know that is asking a lot, but it would be extremely helpful. I'd like to be able to have 1 chopper drop troops and then another single chopper wave spawns and does the same, but the only way I could get it working was to place 2 choppers in the editor and 2 groups of para troops (paras1 & paras2) - and I had to make them eject using an sqf eject script, which is also something I would rather not have to use, but I could not get them to eject correctly by using the eject script in the waypoint. It worked for 1 chopper, but it did not work when I tried adding 2 choppers. And I did change the name "paras" to "paras1" and "paras2" in both the group names and waypoint eject activations. So then I tried using 1 sqf file and executing that when they reach their bail out waypoint and it worked, but sometimes online their chutes are empty and the ai fall to the ground while their chutes float slowly to the ground without them. Makes no sense, sometimes it works and other times it doesn't. The most important part of the mission is the para dropped enemy. Without it working correctly, the mission kind of sucks. That's one main reason why I am asking you to make a sample of a chopper dropping enemy and then wave spawning and doing it a 2nd time. I have 10 random AO tasks and 2 transport choppers that drop 16 troops each at each of the 10 objective areas. So that's 20 transport choppers that I would prefer to reduce to 10 and have them spawn in waves of 2. Any help would be much appreciated. Thanks Murklor. I honestly don't think I would bother making missions at all if your murk_spawn.sqf didn't exist.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

Does anyone know how to get the units that were spawned to unload from a vehicle that was also spawned because whenever the helicopter lands it takes off like 5 seconds later and all the troops are still inside.

Share this post


Link to post
Share on other sites

Use leaveVehicle to tell them to get out or first unassign them then eject them. Also make sure you give the helo a Transport Unload waypoint. Or limit them from moving till their cargo is gone.

Share this post


Link to post
Share on other sites

Hey guys I am having an issue with the spawned AI units.

They dont shoot at bluefor forces once respawned with trigger.

They just follow the waypoint and ignore everyone.

Anyone have any ideas why?

Thanks

ravsun

Share this post


Link to post
Share on other sites
Use leaveVehicle to tell them to get out or first unassign them then eject them. Also make sure you give the helo a Transport Unload waypoint. Or limit them from moving till their cargo is gone.

Kylania how to use that command please? I just cant get my units to unload once I start using this script :(

I tried using the command a few ways but just still cant get it to work :S

Thanks

Share this post


Link to post
Share on other sites
Kylania how to use that command please? I just cant get my units to unload once I start using this script :(

I tried using the command a few ways but just still cant get it to work :S

Thanks

In your previous thread I wrote a quick script to create the helo,crew, and cargo. Aswell as a WP and ejecting the cargo etc.

Share this post


Link to post
Share on other sites

Can someone share some examples of working scripts with the murkspawner.

Things that work:

-When I want to run an action that isn't a script works in the Way point ACC line just fine.

EX:

{deleteVehicle _x} forEach units group this;

Effect: Deletes all infantry in the group when the unit approaches a waypoint.

Issues:

-The script makes the units run to 0,0,0 when you don't give the spawning units orders/waypoints.

-When I add a script execVM into ACC of a waypoint the script wont spawn the units back via the Loader.sqf. (Will work with out loader, but I need to put thousands of units on the map.)

This is what I put into the ACC:

nul=[this,"Alpha"] execVM "ups.sqf"

Script resource: (http://www.armaholic.com/page.php?id=6053)

Desired effect: Unit spawns in, reaches way point, runs patrol script.

Also tried:

nul = [this,25,true] execVM "Garrison_script.sqf";

Script resource: (http://www.armaholic.com/page.php?id=17677)

Desired effect: Unit spawns in, reaches way point, runs garrison script.

None of these would re-spawn the units after removing them. It works perfectly fine with out any of these in the ACC of a way point. Until they finish the way points and do issue #1.

What I'm trying to do:

-Make a groups saved and deleted from the map to be recalled when specific triggers fire, When the groups returns make it run a patrol or garrison script. This is to work around the 144 or 146 group limit the editor wont allow. The reason why I want multiple units on the map is to give a diversity in the missions choices and progression. Either you go left or right there will be people, enemies, and objectives will appear.

If you can fully help me out with these issue I will gladly share the map with you to enjoy!

BTW: I've read and tried everything on this forum regarding rewriting the script within the group leader's init line to accommodate the congruently running scripts.

Respectfully,

Edited by LCLdark

Share this post


Link to post
Share on other sites

LCLdark try it this way:

{deleteVehicle _x} forEach (crew jet1); deleteVehicle jet1

jet1 being the name of the vehicle or group you are wanting to delete at the waypoint. Just rename it to what you want and then name the leader of the group or vehicle the same.

I am still figuring out how to do this. :(

Share this post


Link to post
Share on other sites

DarkXess thanks man, but that was under "Things that work" :D

Things that work:

-When I want to run an action that isn't a script works in the Way point ACC line just fine.

EX:

{deleteVehicle _x} forEach units group this;

Effect: Deletes all infantry in the group when the unit approaches a waypoint.

It's when I use different scripts instead of parts of a script that comes with the game. That wont work.

Issues:

-The script makes the units run to 0,0,0 when you don't give the spawning units orders/waypoints.

-When I add a script execVM into ACC of a waypoint the script wont spawn the units back via the Loader.sqf. (Will work with out loader, but I need to put thousands of units on the map.)

This is what I put into the ACC:

nul=[this,"Alpha"] execVM "ups.sqf"

Script resource: (http://www.armaholic.com/page.php?id=6053)

Desired effect: Unit spawns in, reaches way point, runs patrol script.

Also tried:

nul = [this,25,true] execVM "Garrison_script.sqf";

Script resource: (http://www.armaholic.com/page.php?id=17677)

Desired effect: Unit spawns in, reaches way point, runs garrison script.

None of these would re-spawn the units after removing them. It works perfectly fine with out any of these in the ACC of a way point. Until they finish the way points and do issue #1.

This is all in reference to the Murkspawner.sqf

Share this post


Link to post
Share on other sites

Is there going to be any later updates for this great script? I have some problems like spawning choppers, it doesnt drop off the group that are inside then just stay at the waypoint.

This - Many waypoints supported, unfortunetly not all types and combos (synching a get in and load wont work and I dont really know why ). I recommend keeping it simple.

Any ideas how to fix it? thanks.

Share this post


Link to post
Share on other sites
Is there going to be any later updates for this great script? I have some problems like spawning choppers, it doesnt drop off the group that are inside then just stay at the waypoint.

This - Many waypoints supported, unfortunetly not all types and combos (synching a get in and load wont work and I dont really know why ). I recommend keeping it simple.

Any ideas how to fix it? thanks.

Hey I have used this script many times in the past. It works. Make sure the units are in cargo in the helo use the units inti box then give the helo a waypoint unload it works with this. If iceman was nice to write you a little sample script do what he is telling you. Good luck.

Share this post


Link to post
Share on other sites
Hey I have used this script many times in the past. It works. Make sure the units are in cargo in the helo use the units inti box then give the helo a waypoint unload it works with this. If iceman was nice to write you a little sample script do what he is telling you. Good luck.

Mind showing me how then with an example of your own please... ive been at this now for almost 2 weeks trying EVERY single way possible! I very much doubt you have it working as even

the author has said its bugged with unload/unload cargo etc... Its really getting on my nerves now, everything works apart from the squad does not get out and unloads how it should do.

Share this post


Link to post
Share on other sites

Use a Transport Unload waypoint with an Invisible H exactly where you want the chopper to land. As soon as the Helicopter lands it will kick out any cargo and fly away. You can then give the Infantry waypoints etc.

Share this post


Link to post
Share on other sites
Use a Transport Unload waypoint with an Invisible H exactly where you want the chopper to land. As soon as the Helicopter lands it will kick out any cargo and fly away. You can then give the Infantry waypoints etc.

I know that! BUT what im trying to say is... with using this script, YOU CANT use a unload/transport unload action as its not working! OR can someone please show me how because its peeing me off now.

Share this post


Link to post
Share on other sites

Hey dark are you using any other script or mod in your mission. Yes or no.

Share this post


Link to post
Share on other sites

Yes! but... only on the way point from "transport unload". How it is now, chopper is on the editor, then a squad of men that are in that chopper. They are both synced to this script to not spawn

until I hit the trigger. Now when I hit the trigger, ALL spawn fine! they come to the way point but hover and within seconds fly away. Now at the drop off point ive got it so the chopper unloads transport

and then the men of scripted with the Ultra Simple Patrol Script. It obviously doesnt even work to this point, BUT without this script Editor based AI spawn script by trigger being synced - IT WORKS! though this

is defeating the object of my point. I want my units scripted to join the fight by trigger like this script should do... but it doesnt want to work for me :(

Anyone can make me a working example of what im trying to do please? it ... thanks

EDIT: Here is the example mission on Exactly what im wanting to do... please can someone tell me what im doing wrong? thanks.

Edited by DarkXess

Share this post


Link to post
Share on other sites

Is it possible to be able to stop the Repsawn i.e "Repeated" or "Wave" with a True / False variable ? so i can have a little more control over the Re spawns ?

Solved sorry Ignore !

Edited by psvialli
Worked it out

Share this post


Link to post
Share on other sites

hey sry about that stupid question i had earlyer, this script is indeed a piece of art is it possible to get it portet to arma3? i had it running but after this last update it wont work anymore :(

tryed some spawning scripts and none of them work:(

Edited by baloo666

Share this post


Link to post
Share on other sites

this indeed is an amazing script can someone with more experience (than I) please update this script to work again?

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

×