![]() |
|
#1
|
|||
|
|||
![]()
Can't work in your ScrimBase.cs
GamePlay.gpRemotePlayers() has no Army() - member. If you use GamePlay.gpRemotePlayers() you get a player Array. AiPlayer[] players = GamePlay.gpRemotePlayers(); so you can use foreach and if-clause to look for the players Army or you can copy it in a List List<Player> players = new List<Player>(); if (GamePlay.gpPlayer() != null) players.Add(GamePlay.gpPlayer()); // to get the host-player in single or normal hosted multiplayer or the server on dedicated server if (GamePlay.gpRemotePlayers() != null) players.AddRange(GamePlay.gpRemotePlayers()); then you can use if (players.Exists(item => item.Army() == Army)) { } Last edited by FG28_Kodiak; 01-10-2012 at 08:16 AM. |
#2
|
|||
|
|||
![]()
There is a huge disconnect between "server" hosted games & "player server" games.
Objects appear in one but not appear in the other, scripts that work in one do not work in the other. The reason for the disparity is unclear, but it is extremely frustrating. There is no solution that I know of. I test my battles in "server" hosted games ONLY for this reason.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE |
#3
|
|||
|
|||
![]()
Thanks Kodak,
Ok I did try and replicate the messaging to players in multiplayer for this, but must of had syntax wrong when i tried. Can I use this as part of messaging aswell, or is it best to list separately for different jobs? (I hate repeating the same code, luv subs to do repeating stuff) Ok I think I have followed your advise, can you please check the following section. Not sure if I am asking this if question correctly. if (players.Exists(players => players.Army() == Chkarmy)) Code:
private void Playerlist() { List<Player> players = new List<Player>(); if (GamePlay.gpPlayer() != null) players.Add(GamePlay.gpPlayer()); if (GamePlay.gpRemotePlayers() != null) players.AddRange(GamePlay.gpRemotePlayers()); } //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) { Playerlist(); //list players ingame ScreenMsg(-1, shortName + " trigger stage 1");// rem out once checks complete Chkarmy = 1; if (players.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; } } } } |
#4
|
|||
|
|||
![]()
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. |
#5
|
|||
|
|||
![]()
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 |
#6
|
|||
|
|||
![]()
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. |
#7
|
|||
|
|||
![]()
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. |
![]() |
|
|