No601_Swallow
Jan-29-2014, 09:54
Sorry again to be asking for help and contributing nothing. But I'm seriously crap at scripting.
I want my DF server to display the ongoing "score" after each aircraft is shot down. (This is just for my sqn's little team deathmatch knockabout sessions before we fly our ops, but I'd like to make it a bit more competitive).
What I'd like is for the script to keep a count of the red or blue aircraft that are destroyed, and then, after each aircraft is destroyed, display those counts in the HUD, eg. "Red: 3; Blue: 4".
This is all that I've got so far (mostly lifted from one of Bolox's scripts, I think):
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
int cRed = 0;
int cBlue = 0;
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> initiatorList)
{
if (actor is AiAircraft)
{
if (actor.Army() == 1)
{
cRed++;
GamePlay.gpHUDLogCenter("Red Team:" cRed "Blue Team:" cBlue);
}
if (actor.Army() == 2)
{
cBlue++;
GamePlay.gpHUDLogCenter("Red Team:" cRed "Blue Team:" cBlue);
}
}
}
}
Obviously, it doesn't work, and probably it's completely wrong. But since I really don't understand how to manipulate counter function thingies (hell, I don't even really understand chucking text up using the gpHUDLogCenter), I don't have a clue why.:(
Any help or hints would be greatly appreciated!
Cheers!
I want my DF server to display the ongoing "score" after each aircraft is shot down. (This is just for my sqn's little team deathmatch knockabout sessions before we fly our ops, but I'd like to make it a bit more competitive).
What I'd like is for the script to keep a count of the red or blue aircraft that are destroyed, and then, after each aircraft is destroyed, display those counts in the HUD, eg. "Red: 3; Blue: 4".
This is all that I've got so far (mostly lifted from one of Bolox's scripts, I think):
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
int cRed = 0;
int cBlue = 0;
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> initiatorList)
{
if (actor is AiAircraft)
{
if (actor.Army() == 1)
{
cRed++;
GamePlay.gpHUDLogCenter("Red Team:" cRed "Blue Team:" cBlue);
}
if (actor.Army() == 2)
{
cBlue++;
GamePlay.gpHUDLogCenter("Red Team:" cRed "Blue Team:" cBlue);
}
}
}
}
Obviously, it doesn't work, and probably it's completely wrong. But since I really don't understand how to manipulate counter function thingies (hell, I don't even really understand chucking text up using the gpHUDLogCenter), I don't have a clue why.:(
Any help or hints would be greatly appreciated!
Cheers!