![]() |
#71
|
|||
|
|||
![]()
1st number = repeat i.e if it was 108000 - the map/ mission should load every 1hour...
2nd number = start time i.e. if it was 18000 = the map/mission should start within 10 minutes of the game start, or repeat interval... But i dont think it works 100%... but as i have been told 1800 ticks "roughly" equals a minute... |
#72
|
|||
|
|||
![]() Quote:
I actually did some offline testing and set the timings to minutes adn sped things up! It appears to work roughly as you say... it will do for now! |
#73
|
|||
|
|||
![]()
Yea i did offline testin as well... but x16 is just not fast enough lol! only went a couple of hours in...
|
#74
|
|||
|
|||
![]()
Ive tested and tested... its not working :S
Help ! |
#75
|
|||
|
|||
![]()
Just to have it all in one thread
Quote:
|
#76
|
|||
|
|||
![]() Quote:
However we should try: 1) make a mission with internal triggers without script 2) make a mission with script that loads the first mission in. 3) load more missions when needed. I will not have time to try this for a couple of days however (( Alternatively you can program all the triggers in a script by hand. Check links in the 1st message of this thread for examples. e.g. Code:
/ / $ Reference Campaign.dll / / - $ Debug using System; using maddox.game; using maddox.game.world; public class Mission: maddox.game.campaign.Mission { public override void OnTrigger (int missionNumber, string shortName, bool active) { if ("trigger". Equals (shortName) & & active) { GamePlay.gpHUDLogCenter ("Triggers trigger"); } } } Code:
using System; using maddox.game; using maddox.game.world; class Mission: maddox.game.AMission { public override void OnActorDead (int missionNumber, string shortName, AiActor actor, System.Collections.Generic.List <DamagerScore> damages) { base.OnActorDead (missionNumber, shortName, actor, damages); AiAction action = GamePlay.gpGetAction ("TestAction"); if (action! = null) { action.Do (); } } } Code:
using System; using maddox.game; using maddox.game.world; using System.Collections.Generic; public class Mission : maddox.game.AMission { private List<AiAction> actions = new List<AiAction>(); private int round = 1; private bool completed = false; public override void OnBattleStarted() { AiAction action = GamePlay.gpGetAction("startGroup2"); if (action != null) actions.Add(action); action = GamePlay.gpGetAction("startGroup3"); if (action != null) actions.Add(action); GamePlay.gpHUDLogCenter(String.Format("Раунд {0}", round)); } public override void OnActorDead(int missionNumber, string shortName, AiActor actor, System.Collections.Generic.List<DamagerScore> damages) { base.OnActorDead(missionNumber, shortName, actor, damages); if (!(actor is AiAircraft)) return; // Не самолет int army = (actor as AiAircraft).Group().Army(); if (army == 1) { if (!completed) { bool fail = (actor as AiAircraft).AirGroup().DiedAircrafts >= (actor as AiAircraft).AirGroup().InitNOfAirc; if (fail) { GamePlay.gpHUDLogCenter("Миссия провалена."); } } } else { bool next = (actor as AiAircraft).AirGroup().DiedAircrafts >= (actor as AiAircraft).AirGroup().InitNOfAirc; if (next) { if (round == 3) { completed = true; GamePlay.gpHUDLogCenter("Поздравляем, миссия пройдена!"); } else { round++; startNewRound(); } } } } private void startNewRound() { GamePlay.gpHUDLogCenter(String.Format("Раунд {0}", round)); if (actions.Count > 0) { actions[0].Do(); actions.RemoveAt(0); } } } http://translate.google.com/translat...hp%3Ft%3D68369 Would you tell us what exactly you are trying to do and what does not work. Run my script it loads missions on timing more or less. Does not always destroy planes on the server however. Last edited by Ataros; 04-30-2011 at 01:23 AM. |
#77
|
|||
|
|||
![]()
I have pretty much copied and pasted your scripting ...
I always right click and compile to see if the script is OK, which it is ... So when ever I try and test it ... My ai bots are still flying At the current time I am in the middle of making a new online map with less 'repeat mission' loading, and more internal triggers But as you have posted above, I will need script for 'triggers' to flash messages on the screen about incoming planes etc ... I shall give the above a try when I'm on my pc later! |
#78
|
|||
|
|||
![]()
Ahh, if you mean bot removal script, it works on my PC when I create a server, but does not work on a dedi server somehow ((
The issue reported to the devs already. Try the second script I copied from sukhoi.ru. Just uploaded a new mission into missions thread. http://forum.1cpublishing.eu/showpos...3&postcount=31 Last edited by Ataros; 04-30-2011 at 02:53 PM. |
#79
|
|||
|
|||
![]()
Do you try ABattle and not AMission?
|
#80
|
|||
|
|||
![]()
This is the latest script I used. Do you mean I should change
public class Mission : AMission to public class Mission : ABattle Should I? Every script I have seen uses AMission I think. Code:
// v.1.6.14 using System; using maddox.game; using maddox.game.world; using System.Collections.Generic; public class Mission : AMission { // loads my sub-missions public override void OnTickGame() { if (Time.tickCounter() % 72000 == 18000) // 40-10 { GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFv1_6Ground1.mis"); GamePlay.gpHUDLogCenter("Protect friendly shipping in the channel near France!"); } if (Time.tickCounter() % 72000 == 71999) // 40-40 { GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFv1_6Bombers1.mis"); GamePlay.gpHUDLogCenter("Intel: Enemy bombers are heading to blue airfields!"); } if (Time.tickCounter() % 72000 == 45000) // 40-25 { GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/128BoF/128BoFv1_6Bombers2.mis"); GamePlay.gpHUDLogCenter("Intel: Enemy bombers are heading to red airfields in France!"); } } // destroys aircraft abandoned by a player public void _DespawnEmptyPlane(AiActor actor) { if (actor == null) { return; } Player[] Players = GamePlay.gpRemotePlayers(); bool PlaneIsEmpty = true; foreach (Player i in Players) { if ((i.Place() as AiAircraft) == (actor as AiAircraft)) { PlaneIsEmpty = false; break; } } if ((PlaneIsEmpty) && (actor as AiAircraft).IsAirborne()) { (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsElevatorDisabled); (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsAileronsDisabled); (actor as AiAircraft).hitNamed(part.NamedDamageTypes.ControlsRudderDisabled); (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng0TotalFailure); //for 2mots (actor as AiAircraft).hitNamed(part.NamedDamageTypes.Eng1TotalFailure); //then wait 10min Timeout(600.0, () => { if (actor is AiAircraft) { (actor as AiAircraft).Destroy(); } }); } else if (PlaneIsEmpty) { if (actor is AiAircraft) { (actor as AiAircraft).Destroy(); } }; } public override void OnPlaceLeave(Player player, AiActor actor, int placeIndex) { base.OnPlaceLeave(player, actor, placeIndex); _DespawnEmptyPlane(actor); } // destroys crushlanded aircraft in 10 minutes public override void OnAircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft) { base.OnAircraftCrashLanded(missionNumber, shortName, aircraft); Timeout(600, () => { if (aircraft != null) { aircraft.Destroy(); } }); } } |
![]() |
|
|