View Single Post
  #52  
Old 09-27-2011, 09:59 PM
klem's Avatar
klem klem is offline
Approved Member
 
Join Date: Nov 2007
Posts: 1,653
Default

Quote:
Originally Posted by Mington View Post
....................

I have succeeded in one test module to determine the sector I am in and report it to myself

Nice one, and any code you're working on would be valuable for inspection klem, this ..................

Ming
ok at the risk of being the blind leading the blind (I'm sure Ataros/Kodiak will shout if I am)....

I wanted to find out what sector a Tanker group is in (when I say 'group' I can't find a way to identify a few tankers as a Group, they are just a group to me because thay travel together waiting to be sunk or arrive at their destination). Now, bear in mind I'm new to all this and I'm feeling my way forward with my fingers so there may be better ways of doing it but if any of my Tanker group arrives in a certain "destination" sector it has "arived safely". I want to announce that but I also wanted to call up the grid it is in and Remove all objects in that sector as they are no longer relevant. Of course I know what that sector is but coding actual data like sector numbers into a module is anathema to me so I want the code to find out so that I can re-use the module whenever I like. I haven't got this far yet, I have only just worked out how to use GamePlay.gpSectorName(actor.Pos().x, actor.Pos().y).ToString() :surprise:
For testing I set it in the context of the player entering the cockpit and being told where he is:

public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
AiAircraft aircraft = actor as AiAircraft;
string sectors = "";
sectors += ' ' + GamePlay.gpSectorName(actor.Pos().x, actor.Pos().y).ToString() + ";";
GamePlay.gpHUDLogCenter(new Player[] { player }, "You are in Sector " + sectors);
}

So now I have to find out how to 'group' the Tankers or maybe work through all Tankers for those in the sector and then how to remove them.

The big plan is to create a mission that runs for a long time, measuring objectives (Tankers home safe or not etc) then start a new phase of the battle without loading a sub-mission (sub-missions cause the phantom dots problem), just send the pilots to rtb within a certain timeframe (or be destroyed), clear all old objects, create new ones and carry on from there.

Its a big project and probably causing the mission experts to wince but its all good learning stuff and if it nevers comes to fruition at least I'll have had an interesting time.
__________________
klem
56 Squadron RAF "Firebirds"
http://firebirds.2ndtaf.org.uk/



ASUS Sabertooth X58 /i7 950 @ 4GHz / 6Gb DDR3 1600 CAS8 / EVGA GTX570 GPU 1.28Gb superclocked / Crucial 128Gb SSD SATA III 6Gb/s, 355Mb-215Mb Read-Write / 850W PSU
Windows 7 64 bit Home Premium / Samsung 22" 226BW @ 1680 x 1050 / TrackIR4 with TrackIR5 software / Saitek X52 Pro & Rudders
Reply With Quote