![]() |
|
#1
|
|||
|
|||
![]()
Corrected:
Code:
private List<Player> Playerlist() { List<Player> players = new List<Player>(); if (GamePlay.gpPlayer() != null) players.Add(GamePlay.gpPlayer()); if (GamePlay.gpRemotePlayers() != null) players.AddRange(GamePlay.gpRemotePlayers()); return players; } //example of side specific overflight trigger response, message indicator public override void OnTrigger(int missionNumber, string shortName, bool active) { base.OnTrigger(missionNumber, shortName, active); int Chkarmy; /*===================de triggered mis=====================*/ if ("de1".Equals(shortName) && active) { ScreenMsg(-1, shortName + " trigger stage 1");// rem out once checks complete Chkarmy = 1; if (Playerlist().Exists(players => players.Army() == Chkarmy)) { switch (de1S) { case 1: ScreenMsg(-1, shortName + " trigger switch stage 2");// rem out once checks complete de1M();//trigger for map load break; case 2: ScreenMsg(-1, shortName + " trigger already in action");// rem out once checks complete break; } } } } private void Playerlist() voids doesn't have any value. so i changed private List<Player> Playerlist() { . . return players; } Now Playerlist() includes all players in the game. so you can use if (Playerlist().Exists(players => players.Army() == Chkarmy)) Last edited by FG28_Kodiak; 01-11-2012 at 04:40 AM. |
#2
|
|||
|
|||
![]()
Thanks Kodak.
re edited full cs script as per your update. Unfortunately as previous attempts I have made, it runs perfectly when player is hosting mission as server. But when run on server mode where I join the server across LAN the triggers fail. I note that the messages I have to check stage progression 1 and 2 both fail, which seems to mean the trigger shortname and condition may not be met or not being checked? Could this be like triggers and actions where a DO is needed to activate the trigger? attached is full re edit mis set and cs |
#3
|
|||
|
|||
![]()
At the moment i can not check your mission (not at my gaming PC), will take a look at it at evening.
but you get the current trigger state with GamePlay.gpGetTrigger("Triggername").Active true if active, false if disabled. you can enable the trigger with: GamePlay.gpGetTrigger("Triggername").Enable = true; and disable with GamePlay.gpGetTrigger("Triggername").Enable = false; if ("de1".Equals(shortName) && active) btw. you use tpassthru triggers, so active is true if you enter the area and false if you leave the area. |
#4
|
|||
|
|||
![]()
Ok, I'll let you have a play around see what you can come up with.
Some notes: I have avoided using trigger enable true/false , my intension is leave triggers live at all times and let the random timer switch define time out period for trigger, hence the test message "trigger already in action". Also I have found if you have "&& active" in the, if ("de1".Equals(shortName) && active) the second "leaving trigger area" trigger is avoided. I note some ppl have reported double triggers, this happened when I just had, if ("de1".Equals(shortName)) Yes I am using pass thru triggers for player in mis, then check for army in script(they need to add player and army combination option) This is so triggers activate for players and side only, thus Ai won't cause triggers to respond. |
![]() |
|
|