![]() |
#1
|
|||
|
|||
![]()
Hi, there is my cuestion.
I create a scrip to launch message wen a 1 objetive is destroy. But how can i launch test message if all target all destroyed?. There is my scrip Quote:
|
#2
|
|||
|
|||
![]()
There are different approches to this problem, in these i use a counter
Code:
using System; using System.Collections; using System.Collections.Generic; using maddox.game; using maddox.game.world; public class Mission : AMission { const int MinSubMissionsforBlueSuccess = 2; //two Objectives successfull to win this Battle int BlueMissionSuccesses = 0; public override void OnTrigger(int missionNumber, string shortName, bool active) { base.OnTrigger(missionNumber, shortName, active); AiAction Action = GamePlay.gpGetAction(shortName); if (Action != null) Action.Do(); if ("calaiscompleto".Equals(shortName) && active) { GamePlay.gpHUDLogCenter("objetivo este de calais completado"); GamePlay.gpGetTrigger(shortName).Enable = false; GamePlay.gpGetTrigger("dunkerkecompleto").Enable = false; BlueMissionSuccesses++; // Added } if ("dunkerkecompleto".Equals(shortName) && active) { GamePlay.gpHUDLogCenter("objetivos este de dunkerke completado"); GamePlay.gpGetTrigger(shortName).Enable = false; GamePlay.gpGetTrigger("calaiscompleto").Enable = false; BlueMissionSuccesses++; // Added } if (BlueMissionSuccesses >= MinSubMissionsforBlueSuccess) { GamePlay.gpHUDLogCenter("Blue Win!"); } GamePlay.gpGetTrigger(shortName).Enable = false; } } |
#3
|
|||
|
|||
![]()
Thank.
I go to test it this afternoon. |
#4
|
|||
|
|||
![]()
Hi Kodiak.
Frist thx for the scrip Second. I have a problem. When I destroy frist target, message target destroy run well, but wen i destroy second target, no appears message on screen and not show blue won. ![]() |
#5
|
|||
|
|||
![]()
Hm seems a it's a problem with the trigger, can you show me your mission please?
|
#6
|
|||
|
|||
![]()
I solved it, and add a new condition to red won message.
Code:
using System; using System.Collections; using System.Collections.Generic; using maddox.game; using maddox.game.world; public class Mission : AMission { const int MinSubMissionsforBlueSuccess = 2; //two Objectives successfull to win this Battle int BlueMissionSuccesses = 0; public override void OnTrigger(int missionNumber, string shortName, bool active) { base.OnTrigger(missionNumber, shortName, active); AiAction Action = GamePlay.gpGetAction(shortName); if (Action != null) Action.Do(); if ("centro".Equals(shortName) && active) { GamePlay.gpHUDLogCenter("centro completado"); GamePlay.gpGetTrigger(shortName).Enable = false; BlueMissionSuccesses++; // Added } if ("grupo2".Equals(shortName) && active) { GamePlay.gpHUDLogCenter("grupo2 completo"); GamePlay.gpGetTrigger(shortName).Enable = false; BlueMissionSuccesses++; // Added } if ("tiempo".Equals(shortName) && active) { GamePlay.gpHUDLogCenter("red win"); GamePlay.gpGetTrigger(shortName).Enable = false; GamePlay.gpGetTrigger("centro , grupo2").Enable = false; } if (BlueMissionSuccesses >= MinSubMissionsforBlueSuccess) { GamePlay.gpHUDLogCenter("Blue Win"); } GamePlay.gpGetTrigger(shortName).Enable = false; } } Code:
[PARTS] core.100 bob.100 [MAIN] MAP Land$Online_Map BattleArea 0 0 40960 40960 10000 TIME 12 WeatherIndex 0 CloudsHeight 1000 BreezeActivity 10 ThermalActivity 10 [GlobalWind_0] Power 3.000 0.000 0.000 BottomBound 0.00 TopBound 1500.00 GustPower 5 GustAngle 45 [splines] [AirGroups] BoB_RAF_F_FatCat_Early.01 [BoB_RAF_F_FatCat_Early.01] Flight0 1 Class Aircraft.SpitfireMkIIa Formation VIC3 CallSign 26 Fuel 100 Weapons 1 Scramble 1 SpawnFromScript 1 Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 [BoB_RAF_F_FatCat_Early.01_Way] NORMFLY 19904.00 23573.33 500.00 300.00 NORMFLY 24320.00 29823.10 500.00 250.00 LANDING 25664.00 30143.10 500.00 250.00 [CustomChiefs] [Stationary] Static5 Stationary.Austin_K2_Ambulance gb 19573.80 20469.03 0.00 Static4 Stationary.Austin_K2_Ambulance gb 19631.32 20529.08 0.00 Static3 Stationary.Austin_K2_Ambulance gb 19691.38 20571.60 0.00 Static2 Stationary.Austin_K2_Ambulance gb 20438.89 20873.56 0.00 Static1 Stationary.Austin_K2_Ambulance gb 20433.95 20898.26 0.00 Static0 Stationary.Austin_K2_Ambulance gb 20433.95 20922.96 0.00 [Buildings] [BuildingsLinks] [Trigger] paso TPassThrough 5 2 24309 24881 1250 grupo2 TGroundDestroyed 33 19641 20530 300 tiempo TTime 300 centro TGroundDestroyed 32 20431 20894 100 [Action] paso ASpawnGroup 1 BoB_RAF_F_FatCat_Early.01 [BirthPlace] BirthPlace_0 1 24000 24597 0 16 1 1 . . . BirthPlace_1 2 23023 21822 1000 5 1 1 . . . [BirthPlace1] Aircraft.Bf-110C-7 Aircraft.Bf-109E-1 Aircraft.Ju-87B-2 Aircraft.Bf-109E-4 Last edited by melasuda; 03-28-2012 at 06:49 PM. |
#7
|
|||
|
|||
![]()
Yes I over come this problem a while back. But I was not getting the second "obective complete" because I was spawning my groups off a ttime and the trigger for the groups was already triggered. You have to hard code the spawn not have it in the Mis file. Well this works for me anyway.
Code:
if ("BG2_1".Equals(shortName) && active) //name of the Ttime spawn [trigger] { AiAction action = GamePlay.gpGetAction("BGSpawn2_1"); //name of the [action] spawn if (action != null) { action.Do(); } GamePlay.gpGetTrigger(shortName).Enable = false; //Added section to generate new trigger ISectionFile f = GamePlay.gpCreateSectionFile(); string sect = "Trigger"; //dont touch string key = "Trigger name here"; //put tgroupDestroy [Trigger] name here string value = " TGroupDestroyed BoB_LW_KuFlGr_606.02 50"; //just add the flight or chief name here f.add(sect, key, value); GamePlay.gpPostMissionLoad(f); }
__________________
__________________ 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 |
#8
|
|||
|
|||
![]()
uf, If i use this scrip... i get same actión?
because,my English regular and I no hunderstand you good. |
![]() |
|
|