Jump to content

Auto-Script


Raf

Recommended Posts

Here is a thing I've worked the last weeks.

It's a tool to be loaded at startup, and it requires MIST too, before it.

It should save time for triggers and radio items creation on the mission editor.

 

How to load it, I'm attaching a screenshot.

 

As for how to use it, this is how it works.

The script scans all the zones/groups searching for particular 'tags', basically identifiers bracketed by double-underscores, and based on the identifier used, does something specific at them.

 

__ACTIVABLE__ : a radio item will be available to activate the group (you still need to check the LATE ACTIVATION on the group)

 

__AIOFF__ : this group will have the AI off at script loaded

 

__SPAWNZONE__ & __SPAWNGROUP__ : one for a zone name, another for the group name. You'll have a radio item to spawn all the spawngroups into the spawnzones, selectable.

 

__RESPAWN__ : automatically respawns the group after a determined period of time.

 

Example: I can create a fighter Ai group, named "__ACTIVABLE__Bandits #001", in LATE ACTIVATION, and i'll have a radio item to activate it, with no triggers to write. By default the script enables the radio items only for the red coalition, since I'm used to put game masters there, but some of the variables can be customized, just as the DEBUG variable in the screenshot. To check which, read the top of the script file.

autoscript_v2.0.lua

example.jpg.809964651709413319747753736b7c4f.jpg

Link to comment
Share on other sites

Pretty awesome idea- I think there's some good potential there to help make things more dynamic.

 

Question- as we talked about briefly in another thread... is this going to be broken in the MP environment what with the teleporting / cloning issues in the current version?

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Yes, that's what I'm waiting to be fixed. It works though, and by the way, as for now at least, we're making the game master create lots of spawns at once to reduce attempts, and then disconnect/reconnect to view the new units.

Will attach a sample mission too.

Link to comment
Share on other sites

  • 1 month later...

Refactored in a more 'classy' format. At least now it should be more 'contained' and less invasive for function declaration, constants etc.

Not much else, added a __SAM__ tag to add groups to IADS (if present and loaded before).

 

And also renamed it to Automan (someone remembers that old TV series?)

 

attaching v3.0

automan_v3.0.lua

  • Like 1
Link to comment
Share on other sites

Raf,

 

Awsome job ! I do have a quick question. Does the __RESPAWN__ work with AI helicopters? I tried putting one in with a __RESPAWN__ trigger zone with the same name as the group, but he doesn't respawn when I kill him. By kill him, I set him up with no fuel and let him fall and hit some powerlines. The goal is to create a dynamic medevac mission that randomly respawns within a trigger zone so that our medevac units have something to do while the others blow stuff up.

 

v/r

 

(A/229) del Taco


Edited by Xillinx

[sIGPIC][/sIGPIC]

 

http://1stcavdiv.conceptbb.com/

Link to comment
Share on other sites

  • 1 month later...

I'm guessing it's not possible to restrict some groups for activation by radio to a certain coalition? I wanted to make it so red side can only activate blue fighters and vice versa.

 

If not then I'd at least want to separate the red and blue fighter groups to different radio submenus in order to make it easier to navigate. Is this possible?

 

Also, thanks for your great script.

Link to comment
Share on other sites

Great script thanks. I am using this for our squad for dogfighting P-51 vs 190. I have four flights setup 1 for one plane 2 for two planes 3 for 3 planes and 4 four 4planes. I notice that when you Activate one group it drops out of the menu so if the unit dies you cant respawn the same group. Any way to set it up so you can respawn a group after the group dies beside the auto respawn?

Thanks Again

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • 1 month later...

Use the spawning function, not the activating one.

Activating means that the group must be present in the mission editor statically, but in late activation, just removes the hassle to build yuor own radio item triggers.

You'll have to define an area and group with the "__SPAWNZONE__" and "__SPAWNGROUP__".

Link to comment
Share on other sites

I'm guessing it's not possible to restrict some groups for activation by radio to a certain coalition? I wanted to make it so red side can only activate blue fighters and vice versa.

 

If not then I'd at least want to separate the red and blue fighter groups to different radio submenus in order to make it easier to navigate. Is this possible?

 

Also, thanks for your great script.

 

Just give them a prefix with '(blue)' and '(red)' so they're ordered alphabetically.

Link to comment
Share on other sites

  • 4 weeks later...

This script is great but I notice it doesn't work with a couple of F-16's that I'm wanting to respawn. I have their name as __RESPAWN__F-16 Flight and they are picked up in the debugging text at the start.

 

When they are shot down the group dead isn't shown though (possibly because they ejected?)

 

Is there something I should do for aircraft?

Lyndiman

AMD Ryzen 3600 / RTX 2070 Super / 32G Ram / Win10 / TrackIR 5 Pro / Thrustmaster Warthog HOTAS & MFG Crosswind Rudder Pedals

Link to comment
Share on other sites

I've setup SU-27's and MIG-29's as SPAWNGROUP and a SPAWNZONE that F-15C can trigger via the radio menu (after changing the radio config to be available to side BLUE).

 

It's working well so far.

 

Thanks!

Lyndiman

AMD Ryzen 3600 / RTX 2070 Super / 32G Ram / Win10 / TrackIR 5 Pro / Thrustmaster Warthog HOTAS & MFG Crosswind Rudder Pedals

Link to comment
Share on other sites

  • 1 month later...
This script is great but I notice it doesn't work with a couple of F-16's that I'm wanting to respawn. I have their name as __RESPAWN__F-16 Flight and they are picked up in the debugging text at the start.

 

When they are shot down the group dead isn't shown though (possibly because they ejected?)

 

Is there something I should do for aircraft?

 

Hi, same here.

It seems it does not work for aircraft?

"ARGO" DCS UH-1H DLC SP Campaign

373vFS DCS World squadron (Greece) - www.buddyspike.net

"ARGO 2.0 Project Phoenix" UH-1H DLC Campaign - WIP

Link to comment
Share on other sites

  • 1 month later...

I think the issue is that the event being checked is S_EVENT_DEAD where when aircraft hit the ground it's S_EVENT_CRASH. Probably you want to also respawn if the aircraft lands too which is event S_EVENT_LAND. So I've been trialling a small change which seems to make it work for aircraft.

 

If you edit the script using Notepad ++ and scroll down to line 325 (function add_respawnable_hooks) and make it look like:

 

if (event.id == world.event.S_EVENT_DEAD) or

(event.id == world.event.S_EVENT_CRASH) or

(event.id == world.event.S_EVENT_LAND) then

it seems to work ok for aircraft although I've not yet tried it for ground units to see if the above breaks something.

 

Cheers,

Stoney

Link to comment
Share on other sites

  • 2 weeks later...

Running into a problem with auto respawns after a longish time into a large mission. I have some recon aircraft set up with __RESPAWN__ and eventually I start to see red recon planes spawning at blue bases but seemingly with a blank name as the first symptom I got was a different script failing a nil value error on a Unit.getByName. Anyway I'll try to debug it when I have time but wondered if anyone else had seen this too?

 

Thanks,

Stonehouse

Link to comment
Share on other sites

  • 9 months later...

Great Work!

Is it possible to make a radio item to spawn a random group?

Even better, is it possible to make it spawn a random group, and not attempt to spawn it again?

That way, I could have 3 groups of enemy fighters, and spawn them in a random order, but not have it attempt to spawn the same group twice?

I'd like this option for a trainging mission I'm doing where I can spawn a random group, then have to find and destroy them, then spawn the next random group.

Link to comment
Share on other sites

  • 3 months later...

Hi RAF,

 

I've dowloaded Automan, i needed to get a radio option to spawn targets, your script does it weel using the __SPAWNGROUP__ and __SPAWNZONE__ tags, using the spawn_disperse_radius = 50, my question is, i want to also be able to get spawn from the same target but at different altitude, more likley randomend, so what is the best way to go, creat a groupe for a specific aircraft, ie the IL-78, and inside this groupe creating a few units with diff altitude ans when spawning with the radio it can randmomize which unit will be spawn? Or i need to make different groups with one unit but all diff altitude? Or simply a single group or unit and there is an option like the disperse, but spawning it at random altitude? In other workds, using the ME is not that bad, but as using or creating script, this is way too complicated for me and i'm not patient enough for this :) or if you can simply type in the code which i can add to my mission with the 'DO SCRIPT' inside the ME?

 

Thanks

Link to comment
Share on other sites

  • 1 month later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...