Jump to content
Murklor

Editor based AI spawn script by trigger

Recommended Posts

Hey guys, i am having trouble with this script, i have been asking murklor but i think he is getting tired of me lol. I finally got the script working, but now i am having multiple problems. I have a group of three helis, that ARE working, that is it though. Whenever i put the init line on a infantryman, nobody would spawn, if i did it on a tank, they would all spawn. But now if i put the init line on a vehicle, it does a CTD, so i started to put it back on the infantry and the tanks no longer move, and the infantry does not spawn. The only thing working is the heli's and those have worked from the start. This is the error im getting when i get the CTD... anybody think they have an answer??

szAppName : arma2.exe szAppVer : 1.4.0.59026 szModName : hungapp

szModVer : 0.0.0.0 offset : 00000000

C:\DOCUME~1\HELOPO~1\LOCALS~1\Temp\WERc3da.dir00\a rma2.exe.mdmp

C:\DOCUME~1\HELOPO~1\LOCALS~1\Temp\WERc3da.dir00\a ppcompat.txt

Share this post


Link to post
Share on other sites

Well as I have said to Helepolis before (yes I'm getting a bit tired of him ;)), I really have no idea what could be causing the erratic behaviour.

HOWEVER there is good news. I have FINALLY gotten the local dedicated server to work without CTDing, now I should be able to make and test a true multiplayer version of the spawn script.

Edit: Woohoo! I successfully tested it on the local dedicated server with a new design, now with a single file so no messy group scripts or external functions (starting to learn how to use getVariable and setVariable). Well, sort of succesfully, a weird bug with deleting infantry as I had poor unarmed men running about, lol.

Edited by Murklor

Share this post


Link to post
Share on other sites

Truely great script Murklor!

  • Did you get a chance to look at mission and see why plane crashes when starting position moved? is it a bug or user (me) error? :)

  • Could you please clairfy how to spawn group 3 times instead of once (once group is terminated another spawns to replace?

Keep up the good work.

Edit: Regarding the loading troops in vehicle perhaps spawn vehicle first then spawn troops and have them move into vehicle with moveInCargo in their first WP. I will try this eve and I hope it works.

Edited by CaptainBravo
Add

Share this post


Link to post
Share on other sites

well after countless hours...actually about 20. i finally got this stupid thing to work, the stupid part not being the script. but my computer. Either the script is very very technical on where you put the script, or my computer just sucks. I had the script in a teamleader, it didnt work. i deleted the team leader and put it in the rifleman and it worked. I tried the tank again, CTD, so then i tried putting the line in both the rifleman and the tank, and no CTD but the tank didnt move. Now, i copied and pasted the group so i can have people coming in at different sides with the same spawn group, the copied group lets the tank work, but the original doesnt.

Share this post


Link to post
Share on other sites

Decided I might as well bring this thread up from the dead, because finally, after so much time scratching my head I've ended up with a new version:

Editor Based AI Spawn V5

Pretty much final, I've learned so much making this script so I suppose it's served its purpose :)

- Change: Removed group and function scripts, everything done in a single file

- Change: Spawn trigger variable is now a setVariable of the trigger instead of a global variable

- Add: Option to enable removal of dead units, eventhandler attached to everyone spawning

- Fix: Should now work in multiplayer on a dedicated server (only tested on a local dedicated/join setup however)

- Fix: Performance issues with helos from V4 resolved, was a mistake on the example mission and not the script

- Fix: Some minor bugs with the optional parameters

- Fix: Now properly support crews in turrets-on-turrets (had to bring in some BIS made functions)

For some reason however, the paradroppers in the example mission do NOT work when trying on a local dedicated server... They do some sort of clone s**t where they are both in parachutes (which look empty) and fall to the ground at the same time, lol!!! The rest seems pretty much identical to running in SP from what I can tell.

Share this post


Link to post
Share on other sites

Very nice. Huge improvements everywhere. You really come a long way with this coding and I have also been learning from reading it.

I need to tweak a few things for this mission I'm still toiling on. For example the body handling is well done but its something I like to do centrally as my centralized script is a single running queue and has more layers of checking in it. Also I still want to capture each individual unit's init so I can rerun the various scripts and settings applied to the units I place down.

Hope you don't mind if I customize it a bit?

Share this post


Link to post
Share on other sites

I dont mind at all, but there will be yet another version anyway. Xeno has given me some interesting advices :)

Regarding capturing each units init, I'm not sure that's possible. You can always use the squadleaders init though, set it to run a script which does what you want with all his units (if using names it would have to be "once" or "repeated" mode as the others dont restore them because of the duplicate units)

Edit: Oops I see I forgot some debug hints in the body removal event handler... My bad lol. Fixed sqf download

Edited by Murklor

Share this post


Link to post
Share on other sites

i tried to combine this with UPS script .... the units are spawning but they dont patrol with UPS ...

Whats wrong ?

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

nul=[this,"alpha","random","showmarker","trigger",

"track"]

execVM "ups.sqf";

Edited by tobmic

Share this post


Link to post
Share on other sites

Are you doing all that in the init of a unit if so then of course it wont work. The spawn script delete the unit: UPS need the unit.

You could try using the init string instead by doing nul = [this,triggerfive,"once", 1, 1, 'nul=[this,"alpha","random","showmarker","trigger", "track"] execVM "ups.sqf"'] execVM "murk_spawn.sqf";

(not guaranteed to work, just an idea)

Share this post


Link to post
Share on other sites

that works ! thanks

---------- Post added at 09:18 PM ---------- Previous post was at 09:04 PM ----------

Works fine but first time the unit spawns gets deleted and then it gets spawned again then its running the UPS script

[this,triggerfive,"once", 1, 1,

Share this post


Link to post
Share on other sites

Can you please clairfy the different types of spawns?

I am trying to get a group to spawn 5 times but ONLY when the original group has been killed?

Any idea on?

Also how does "reset" mode work? how do you call units at will?

Thanks for your help.

Share this post


Link to post
Share on other sites

I am trying to get a group to spawn 5 times but ONLY when the original group has been killed?

Use the "repeat" mode, that will respawn all units once the group is dead.

nul = [this,triggername,"once", 5,10] would respawn them 5 times (10 seconds after the group dies)

Also how does "reset" mode work? how do you call units at will?

Reset flip the trigger back to false so that setting it to true again trigger the spawn. This can repeat for as many times specified, same init as above. In the example map, the lower right one of the triggers use repeat.

Share this post


Link to post
Share on other sites

Hi Murklor can you upload the script on a diffrent server? Armahloic has only version 2 and I can't download it from mediafire becouse of some bs txt that appears and says that the file is not on any server... and your script would help me a lot whit my mission.

Thanks.

Share this post


Link to post
Share on other sites

Try

This link to a reuploaded V5 and V6

I'm no longer working on the script and cant remember whether V6 was bug free or not. If the link doesnt work I'm guessing a mediafire issue on your end... The V6 folder accidentally include a crappy zone control script I experimented with long ago, ignore that.

Edited by Murklor

Share this post


Link to post
Share on other sites

A quick clarification as I was trying to respawn group 5 times at 10 seconds apart as you mentioned. For some reason they on spawn one time and that is it.

I used:

nul = [this,triggerone,"once", 5,3] execVM "murk_spawn.sqf";

Can you please point on what I am missing?

Thanks :)

Share this post


Link to post
Share on other sites

Use "repeated" if you want them to respawn after death or "wave" if you simply want them to continously spawn.

As I said I'm no longer really supporting it, so you're lucky I stumbled in here ;)

Share this post


Link to post
Share on other sites

Thanks Murklor for your response. I realized I had "repeat" instead of repeated.

One of the most useful scripts out there. Thanks for the great work.

Share this post


Link to post
Share on other sites

sry but does this work with objects or buildings i place on editor ? and if yes how do i make that

Share this post


Link to post
Share on other sites

Nevermind, I think I figured out what was happening. Ignore this post.

Murklor,

I love your spawner. It is wonderful for doing ambushes.

I was wondering if you chould tell me what this error is

2010/03/26, 20:10:07 Error in expression <ts _newGroup;

_spawnUnit = (_unitsGroup select _loop);

if (_spawnUnit == leader>

2010/03/26, 20:10:07 Error position: <select _loop);

if (_spawnUnit == leader>

2010/03/26, 20:10:07 Error Zero divisor

2010/03/26, 20:10:07 File mpmissions\__cur_mp.isladuala\scripts\murk_spawn.sqf, line 286

I found it alot in my .RPT when I was checking a mission for errors.

Nomadd

Edited by Nomadd

Share this post


Link to post
Share on other sites

i probably wont get a response from murk but i'll post a Q anyway and leave it open for others to answer if he doesnt.

Been using this quite a lot to control units spawning based on triggers. But i've come up against a problem (it would seem) with using it in conjunction with probability of presence. If the unit has a prob of presence, the script will work as intended when the units prob of presence = true. But as soon as the units prob of presence is false, the unit spawns immediately anyway irrespective of the script and not under its control.

example: prob of presence set to 0, every time i start mission the unit spawns immediately.

prob presence set to 100. every time mission start, the unit will conform to the trigger activation and spawn script.

Thoughts? how is probability of presence (and the removal of the units that have a false return for presence via the editor) handled. And how is it affecting the script?

---------- Post added at 06:43 AM ---------- Previous post was at 04:46 AM ----------

oh well in the meantime i'm editting murks script (hope thats ok murk, credits to u still!)

to include the probability of presence calculations.

This means i leave all units as 100prob on the map, and instead include a new parameter in _this select 7 slot, a number 1-10 to define the probability of it actually spawning via the script.

if anyone wants the revised version when i finish just let me know.,

Edited by chappy

Share this post


Link to post
Share on other sites

You can edit it all you like, I havent even used it in a mission lol.

I dont really know why the unit would spawn when prob is set to 0 - the unit should be skipped by the mission loading sequence and not even load the init, obviously.

It was a long time since I worked on it, so I dont really remember all its quirks. As I'm on OA only at the time, I cannot check it either - my single script file weighing in at a whooping 12kb spits out over 80,000 error lines into a 5mb rpt (clean). Apparently Arrowhead does not even like the comments. Comments are evil.

I am impressed.

Share this post


Link to post
Share on other sites

Murklor

Any chance of bringing this script up to date with OA? I have used your script in most of my missions and I hate thinking of scraping them or trying to redo them now. I could post my .rpt but I think you already know what it will look like.

This is a wonderful script and I hate to see it not used. It is well beyond my ability at scripting. Maybe someone else can fix it up and link for the rest of us.

Nomadd

Share this post


Link to post
Share on other sites

If anyone want to fix it, be my guest. I might get around to do it myself this week if I'm bored. I'm fairly sure its a simple design glitch that Arrowhead doesnt like, not actual coding issues since Arma2 and OA is pretty much the same.

Share this post


Link to post
Share on other sites

Lol, turns out I was that glitch. The script is working fine with OA from what I can see, I just forgot to write the VM part of "execVM" in my little comment-readme and of course, I followed my own instructions to the letter. No wonder it spazzed out.

I suppose it doesnt support backpacks, since the script remove all things before it restores saved weaponry.

Edited by Murklor

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

×