I suspect this has already been accomplished, but I can not find it through Google or Forum Search so I figure I will ask here...
I have a mission.cs script that I have been using, it starts with the usual:
Code:
using System;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
using maddox.GP;
public class Mission : maddox.game.AMission
What I would like it to do is write (append actually) to a file named 'destroyed.ini' (in the same directory as my mission) as static objects get destroyed so during the course of a mission the file may fill up like:
Code:
[Static]
Stationary.Environment.JP3_Generator_15_KW_UK1 gb 178768.08 197313.52 105.00, 2
Artillery.3_inch_20_CWT_QF_Mk_I_StandAlone2 gb 136914.39 198372.09 -60.00, 2
Stationary.Ammo_Vehicles.3inch_QF_AA_composition3_UK1 nn 136921.30 198377.00 -90.00, 2
THe coordinates are important because they will be used later to determine if it is the exact same static object that was destroyed. The suffix ',2' is just a placeholder but I would like it to end up in the file as well.
I would then like to use a separate script (my overall campaign.cs) to parse the file and use the list to not create static objects in the next mission.
I used to do C programming (command line), but the object model of C# is taking me some time to wrap my head around. If someone could help me write the objects to a file I believe I have the skills to parse the file and use the data in my own (campaign) script.
The reason I would like it in a mission script is because it is for single player use.
Thanks,
von Pilsner
p.s. - I have read through the basic tutorials and script examples so if that is all you are able to suggest, I'm doing that right now...