Jump to content
rucker.mark

Auto Restart AI Only Mission

Recommended Posts

I'm trying to create a mission that will automatically restart at the end of the mission and only has AI controlled units. Basically I'm trying to use Arma as a simulator. Does anyone know if this is possible? Creating a mission with only AI controlled units is easy enough but getting the mission to restart and play again on its own at the end is proving to be much harder. I'd really like it if this could be done locally but I'm open to using a dedicated server with a custom configuration (something like mission rotation and skip the lobby, though that didn't work for me).

Share this post


Link to post
Share on other sites

Welcome to the BI Forums! 

 

I never tried such thing, I know, there are:

 

https://community.bistudio.com/wiki/playMission

https://community.bistudio.com/wiki/playScriptedMission

 

but no idea, if/how they work exactly. There's also:

 

https://community.bistudio.com/wiki/runInitScript

 

but this does not exactly that. 

 

Question is, do you really need to actually restart the mission. Maybe just try resetting everything to initial conditions within same mission (in such case best, if everything is placed/initialized via SQF script). If this is about repetitive simulating something, such solution should suffice (and you don't need any multiplayer set up for it, just plain, local singleplayer). But depends, what exactly you're trying to do.

Share this post


Link to post
Share on other sites

Thanks! Yeah I've tried the top two commands without any luck and had briefly considered your final idea though didn't try it. I hadn't seen runInitScript.

 

I think your last idea is a really good idea one and I need to experiment with it more. Given my lack of success with other methods it's probably my best bet and might work well with runInitScript.

Share this post


Link to post
Share on other sites

One of my coworkers said they had tried #restart and it hadn't worked for them... Have you used it before with success?

Share this post


Link to post
Share on other sites

Yes. At least I did something similar some years ago.

The bad thing is that you need a server.cfg file to get it work:

 

 

Share this post


Link to post
Share on other sites

Oh yeah, I didn't have a server.cfg. I tested it myself after your recommendation (and to make sure my coworker hadn't made a mistake). It didn't seem to work so that was probably why.

 

In the end the solution I went with was to setup the mission how I wanted then run export to sqf to get a script that created the mission. I then wrote a script that removed all entities from the game (this was a little tricky but I got there.) Then I added a trigger that activated on the mission completion condition and ran both the script to clear the map and the script to create the mission. This allows the mission to replay over and over again with ever actually leaving the mission.

  • Like 2

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

×