PDA

View Full Version : Stopping a Battle



moomat
Jul-29-2016, 08:37
I'm messing around with some mission scripting, but I'm having a hard time seeing how, for example like in ATAG missions, I could stop the current battle, load a new mission, and restart the battle upon certain conditions of my choosing being met. I am able to handle the aspect of the script that pertains to my conditions, but it seems GamePlay.gpBattleStop() doesn't do anything. I also tried writing to the server console with Console.Write() to no avail. Any hints on how ATAG ends missions when bomb targets are complete? Thanks in advance!

ATAG_Freya
Jul-29-2016, 09:50
I'll send you an example mission tonight, moomat. (12hrs from this post is my tonight..)

:thumbsup:


edits it: sent already, slow day..

Nephilim
Jul-29-2016, 15:36
Hi. If You consider stopping battle its not big deal just use process kill from c# library, however the big deal is to restart the mission where you are being forced to use some 3rd party GUI to control steam and clod console. Why? Simply because clod was designed to run everlasting mission. There is Colanders clod mission watch dog http://theairtacticalassaultgroup.com/forum/showthread.php?t=8034 somewhere in stickies which u can use for free, also You will find Wild Willie's IL 2 commander at 1c forums, but this one require MySql database to run.

If it comes to meeting objectives it really depends what are u looking for, planes shoot down, areas bombed, specific units destroyed, bridges etc.. And if u specify what You need I am sure someone will have it for You... Like a candy but wrapped :)

moomat
Jul-29-2016, 16:39
Hi. If You consider stopping battle its not big deal just use process kill from c# library, however the big deal is to restart the mission where you are being forced to use some 3rd party GUI to control steam and clod console. Why? Simply because clod was designed to run everlasting mission. There is Colanders clod mission watch dog http://theairtacticalassaultgroup.com/forum/showthread.php?t=8034 somewhere in stickies which u can use for free, also You will find Wild Willie's IL 2 commander at 1c forums, but this one require MySql database to run.

If it comes to meeting objectives it really depends what are u looking for, planes shoot down, areas bombed, specific units destroyed, bridges etc.. And if u specify what You need I am sure someone will have it for You... Like a candy but wrapped :)

Thanks for the info. Killing the process seems like it would work fine for me; just have to look into how to approach that.

moomat
Jul-29-2016, 16:44
Actually, brainstorming along those lines, let's say I had a method for rebooting the process after it has been killed. How could I go about running like an "f mystartupscript" console command after the process is run? Is there a command line option on Launcher.exe -server that allows for that?

ATAG_Lewis
Jul-29-2016, 19:16
Welcome to the community and forums moomat ...~S~

Checkout the 'Beginners Guide'...for info and tips...It will save you a heap of time in getting up to scratch.....and its a really fun learning curve anyway..

Beginners Guide Link Here (http://theairtacticalassaultgroup.com/forum/showthread.php?t=5058&p=52711)

Windows Management Guide (http://theairtacticalassaultgroup.com/forum/showthread.php?t=3273)

Also try youtube for startup procedures on all the aircraft...

I recommend getting in the online server as soon as you can take off if that's ultimately where you'd like to fly...I flew single player for 30 minutes before I took the plunge...The ATAG online server is a great environment to learn and there's not really any damage you can do in there as a new player.....It is also mission based just with real players trying to foil your objectives...If you are concerned then pick an airstrip furthest from the front line (there always is one or two on every map) and get some alt before you go hunting...You'll get tagged a lot but there are tricks you learn out of pure desperation in those first few weeks that you'll be able to use later...I know cos I still use the same tricks I learned then too because they work...and never underestimate the stall to get you out of a tight fix...That sometimes works too...

TeamSpeak is optional but you'll learn a whole lot faster with it even if you say very little once you are on the server...You are quite welcome to just listen if you feel more comfortable with that....so you don't actually need a mic either...Try it and see!...

How to set up Teamspeak (http://theairtacticalassaultgroup.com/forum/showthread.php?t=732)


Here are a few fun, helpful and interesting links amongst these forums

Most Watched CLOD Videos (http://theairtacticalassaultgroup.com/forum/showthread.php?t=10582&p=137316)

Easy Allied CEM for New Players (http://theairtacticalassaultgroup.com/forum/showthread.php?t=9111&p=100118#post100118)

Joystick and Hardware Thread (http://theairtacticalassaultgroup.com/forum/showthread.php?t=7000)

ATAG Forum Age Poll Results (http://theairtacticalassaultgroup.com/forum/showthread.php?t=7744&highlight=poll)

Nvidea Control Panel Settings (http://theairtacticalassaultgroup.com/forum/showthread.php?t=6534&highlight=control+panel)

Downloads (http://theairtacticalassaultgroup.com/forum/Downloads.php)

Contact Spotting Test (http://theairtacticalassaultgroup.com/forum/showthread.php?t=13915&highlight=spotting+contact)

and....Don't forget to keep up with the latest on the TeamFusion new aircraft and patch news...You could well be AMAZED!

TeamFusion Facebook Updates (https://www.facebook.com/teamfusionmod?fref=ts)


Any questions then you've come to the right place....

Good to have you with us buddy...and remember its all about the Fun!!!

...Lew...

SoW Reddog
Jul-30-2016, 07:32
Congrats Lewis. Must unhelpful and inappropriate cut and paste job yet. Crack on!

Moomat, the issue you will have is that by killing the process, any other code after that is stopped as well. Hence the reason we have utilities like the CloD commander and ATAG watchdog which monitors the process and starts the next mission when there's no launcher process running.

Nephilim
Jul-30-2016, 07:40
Actually, brainstorming along those lines, let's say I had a method for rebooting the process after it has been killed. How could I go about running like an "f mystartupscript" console command after the process is run? Is there a command line option on Launcher.exe -server that allows for that?

Well how u imagine method to reboot process after it has been killed?

There is another way to stop battle with using




if (GamePlay is GameServerDef)
{
GameServerDef gameServer = (GameServerDef)GamePlay;
gameServer.consoleInput("battle stop");
}



This can work with sending anything to console...

Artist
Jul-30-2016, 09:54
Congrats Lewis. Must unhelpful and inappropriate cut and paste job yet. Crack on!Even so this might be true in this case, this was quite unneccessary, too - regarding Lewis' usually more personalized welcomes to new posters here.

SoW Reddog
Jul-30-2016, 13:42
Even so this might be true in this case, this was quite unneccessary, too - regarding Lewis' usually more personalized welcomes to new posters here.

Except my post contained pertinent info also to the OP's question. Something which happens when you read a post and don't just blindly post the same repetitive crap everytime someone new posts. If Lewis really wanted to be personal, he could PM the person couldnt he?

@Vogler, interesting. I hadn't spotted that console command, thanks. I can see a couple of applications that might be useful for.

Nephilim
Jul-30-2016, 13:49
@Vogler, interesting. I hadn't spotted that console command, thanks. I can see a couple of applications that might be useful for.

No problem, I am still around... will be a bit more now


Lew... this is a off the topic... read post titles... people actually looking for help in here...


Welcome to the community and forums moomat ...~S~

Checkout the 'Beginners Guide'...for info and tips...It will save you a heap of time in getting up to scratch.....and its a really fun learning curve anyway..

Beginners Guide Link Here (http://theairtacticalassaultgroup.com/forum/showthread.php?t=5058&p=52711)

Windows Management Guide (http://theairtacticalassaultgroup.com/forum/showthread.php?t=3273)

Also try youtube for startup procedures on all the aircraft...

I recommend getting in the online server as soon as you can take off if that's ultimately where you'd like to fly...I flew single player for 30 minutes before I took the plunge...The ATAG online server is a great environment to learn and there's not really any damage you can do in there as a new player.....It is also mission based just with real players trying to foil your objectives...If you are concerned then pick an airstrip furthest from the front line (there always is one or two on every map) and get some alt before you go hunting...You'll get tagged a lot but there are tricks you learn out of pure desperation in those first few weeks that you'll be able to use later...I know cos I still use the same tricks I learned then too because they work...and never underestimate the stall to get you out of a tight fix...That sometimes works too...

TeamSpeak is optional but you'll learn a whole lot faster with it even if you say very little once you are on the server...You are quite welcome to just listen if you feel more comfortable with that....so you don't actually need a mic either...Try it and see!...

How to set up Teamspeak (http://theairtacticalassaultgroup.com/forum/showthread.php?t=732)


Here are a few fun, helpful and interesting links amongst these forums

Most Watched CLOD Videos (http://theairtacticalassaultgroup.com/forum/showthread.php?t=10582&p=137316)

Easy Allied CEM for New Players (http://theairtacticalassaultgroup.com/forum/showthread.php?t=9111&p=100118#post100118)

Joystick and Hardware Thread (http://theairtacticalassaultgroup.com/forum/showthread.php?t=7000)

ATAG Forum Age Poll Results (http://theairtacticalassaultgroup.com/forum/showthread.php?t=7744&highlight=poll)

Nvidea Control Panel Settings (http://theairtacticalassaultgroup.com/forum/showthread.php?t=6534&highlight=control+panel)

Downloads (http://theairtacticalassaultgroup.com/forum/Downloads.php)

Contact Spotting Test (http://theairtacticalassaultgroup.com/forum/showthread.php?t=13915&highlight=spotting+contact)

and....Don't forget to keep up with the latest on the TeamFusion new aircraft and patch news...You could well be AMAZED!

TeamFusion Facebook Updates (https://www.facebook.com/teamfusionmod?fref=ts)


Any questions then you've come to the right place....

Good to have you with us buddy...and remember its all about the Fun!!!

...Lew...

Nephilim
Jul-30-2016, 15:15
Ok, tested... this will stop battle after timeout of 10 seconds




//$reference parts/core/gamePlay.dll


using maddox.game;
using maddox.GP;
using part;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


using maddox.GP;


public class Mission : AMission
{


public override void Init(ABattle battle, int missionNumber)
{
base.Init(battle, missionNumber);
this.MissionNumberListener = -1; // listen for all game events
}


public override void OnBattleStarted()
{
base.OnBattleStarted();




if (GamePlay is GameServerDef)
{
GameServerDef gameServer = (GameServerDef)GamePlay;
Timeout(10, () => gameServer.consoleInput("battle stop"));
}



}

}