![]() |
|
|
|
#1
|
|||
|
|||
|
I had a think about it. I do have the BOOL's for each trigger to check.
You think this would work? I am checking each Bool that they are True. Then reseting htem to False if they are true and sending out the messges. I have OnTrigger set and that works fine. I am hoping the code below will give me the update every 10 mins that the objective is complete IF the BOOL's are True. Code:
public class Mission : AMission
{
bool BGTarget2 = false; //German Bomber group 1 of 6
bool BGTarget2_1 = false; //German Bomber group 2 of 6
bool BGTarget2_2 = false; //German Bomber group 3 of 6
public override void OnTickGame()
{
base.OnTickGame();
{
if (Time.tickCounter() % 18000 == 17990) //check every 10 mins
//if (Time.tickCounter() % 68 == 1) ///Check every 2 seconds
{
if ((BGTarget2 == true) && (BGTarget2_1 == true) && (BGTarget2_2 == true))
{
BGTarget2 = false;
BGTarget2_1 = false;
BGTarget2_2 = false;
GamePlay.gpLogServer(null, "Team scores - RAF {0}: LW {1}", new object[] { ScoreRed,ScoreBlue });
GamePlay.gpLogServer(null, "Team Objectives Completed - RAF {0} of 2: LW {1} of 2", new object[] { ScoreRed,ScoreBlue });
Timeout(10, () =>
{
GamePlay.gpHUDLogCenter("Red Objective 11 Completed!!!");
});
}
}
}
}
}
__________________
__________________ Win7, 64bit Ultra Asus P8P67Pro MB Intel i7-2600K Coursair 16GB (4x 4GB), DDR3-1600MHz Gainward Nvidia 580GTX 3GB DDR5 850-Watt Modular Power Supply WIN7 and COD on Gskill SSD 240GB 40" Panasonic LCD TrackIR5 + Thrustmaster Warthog stick, throttle & pedals |
|
#2
|
|||
|
|||
|
Should work
Btw. You use bools so its not nessesary to write: if ((BGTarget2 == true) && (BGTarget2_1 == true) && (BGTarget2_2 == true)) you could also use: if (BGTarget2 && BGTarget2_1 && BGTarget2_2) |
|
#3
|
|||
|
|||
|
I am such a bool!
Cheers Kodiak Seems to run through MS Visual Express with out errors also. Thanks
__________________
__________________ Win7, 64bit Ultra Asus P8P67Pro MB Intel i7-2600K Coursair 16GB (4x 4GB), DDR3-1600MHz Gainward Nvidia 580GTX 3GB DDR5 850-Watt Modular Power Supply WIN7 and COD on Gskill SSD 240GB 40" Panasonic LCD TrackIR5 + Thrustmaster Warthog stick, throttle & pedals |
|
#4
|
|||
|
|||
|
Question if anyone can help. I am using MS Visula express c#
When I click 'Start Debugging' It runs but I get an error warning 'A Project with an Output Type of Class Library cannot be started directly. In order to debug this, add an executable project to this solution which references the library project. Set the executable project as the Startup Project." I am not sure how to do this. I gather it wants the Launcher.exe which I have, but unsure how to adde it. If it is to hard to explain the steps don't waist your time. I can get by. Thanks
__________________
__________________ Win7, 64bit Ultra Asus P8P67Pro MB Intel i7-2600K Coursair 16GB (4x 4GB), DDR3-1600MHz Gainward Nvidia 580GTX 3GB DDR5 850-Watt Modular Power Supply WIN7 and COD on Gskill SSD 240GB 40" Panasonic LCD TrackIR5 + Thrustmaster Warthog stick, throttle & pedals |
|
#5
|
|||
|
|||
|
You create a DLL a DLL must be called by a programm to work. A DLL is never standalone.
BTW the debugger is worthless in this situation, you cannot run it in Cliffs of Dover. |
|
#6
|
|||
|
|||
|
LOL well that answers that. Won't waste my time. Cheers buddy!
__________________
__________________ Win7, 64bit Ultra Asus P8P67Pro MB Intel i7-2600K Coursair 16GB (4x 4GB), DDR3-1600MHz Gainward Nvidia 580GTX 3GB DDR5 850-Watt Modular Power Supply WIN7 and COD on Gskill SSD 240GB 40" Panasonic LCD TrackIR5 + Thrustmaster Warthog stick, throttle & pedals |
|
#7
|
|||
|
|||
|
Btw a other aproach to the problem, with counters:
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
const int MinSubMissionsforBlueSucces = 3;
const int MinSubMissionsforRedSucces = 3;
int BlueMissionSuccesses = 0;
int RedMissionSuccesses = 0;
int ScoreRed = 0;
int ScoreBlue = 0;
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
if (BlueMissionSuccesses < MinSubMissionsforBlueSucces && RedMissionSuccesses < MinSubMissionsforRedSucces)
{
if ("RedPartWin".Equals(shortName))
{
RedMissionSuccesses++;
ScoreRed += 10;
}
if ("BluePartWin".Equals(shortName))
{
BlueMissionSuccesses++;
ScoreBlue += 10;
}
}
else if (BlueMissionSuccesses >= MinSubMissionsforBlueSucces)
{
GamePlay.gpLogServer(null, "Blue already win this Battle", null);
}
else if (RedMissionSuccesses >= MinSubMissionsforRedSucces)
{
GamePlay.gpLogServer(null, "Red already win this Battle", null);
}
}
public override void OnTickGame()
{
base.OnTickGame();
if (Time.tickCounter() % 18000 == 17990) //check every 10 mins
{
if (BlueMissionSuccesses >= MinSubMissionsforBlueSucces || RedMissionSuccesses >= MinSubMissionsforRedSucces)
{
GamePlay.gpLogServer(null, "Team scores - RAF {0}: LW {1}", new object[] { ScoreRed, ScoreBlue });
GamePlay.gpLogServer(null, "Team Objectives Completed - RAF {0} of {1}: LW {2} of {3}", new object[] { RedMissionSuccesses, MinSubMissionsforRedSucces, BlueMissionSuccesses, MinSubMissionsforBlueSucces });
Timeout(10, () =>
{
if (BlueMissionSuccesses >= MinSubMissionsforBlueSucces)
GamePlay.gpHUDLogCenter("Blue Objective 11 Completed!!!");
else if (RedMissionSuccesses >= MinSubMissionsforRedSucces)
GamePlay.gpHUDLogCenter("Red Objective 11 Completed!!!");
});
BlueMissionSuccesses = 0;
RedMissionSuccesses = 0;
}
}
}
}
Last edited by FG28_Kodiak; 03-27-2012 at 11:14 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|