Jump to content

Kismet and teams


Schmitzenbergh

Recommended Posts

Hello Renegades,

I've been busy with kismet for the last 2 days and I'm getting the hang of it, but there is one thing I can't quite get...

Let's say we want to display a message or play a sound. The sound/message for Nod will have to be different than the sound/message for GDI. So my first approach was to compare integers. If the teamnumber of all the players in the game matches 0 the message(Let's call it "Cloaked units detected") for GDI gets played to all the GDI players. At the same time the counter message("Cloaking units vulnerable") will play for all of Nod. this also needs to work the other way around.

(Note: I'm not creating a cloaking detector, this is just an example)

But then comes the problem, I can't find out how to check the teamnumbers of all the players in kismet. I can only use all the players(Nod and GDI) or a specific player ID, but not a team as a whole.

Is there any way through kismet to perform an action to a specific team? The silo's are doing the same as they can generate credits for a specific team. But the silo's are not in kismet :rolleyes: But the possibility should be there, I think?

TL:DR for the techs.

Something like this if GDI gets the "Cloaked units detected" message.

Pseudocode:

foreach(players as player)
{
      int number = player.getTeamnumber();
      if(number == 0)//Team = GDI
      {
             hud.outputMessage("Cloaked units detected");
             //Do something
      }
      else //Team = Nod
      {
             hud.outputMessage("Cloaked units vurnerable");
             //Do something
      }
}

Link to comment
Share on other sites

I thank you, it works! :cool: In singleplayer at least. Ill fix some bits and bops and hopefully at the end of the week I can show you whats been cooking. I don't have that much time so don't expect some big ol kismet that can spawn an army of controllable cyborg reapers ;p

Link to comment
Share on other sites

might be a good idea to add "player spawn" as players can change team mid game

You could do that, but the 'players' variable sort of captures it all. What you're trying to do with the 'player spawn' is to create a group out of spawned players.. but that also means that every time a player spawns he will get added to the list. This means you also need to remove a specific player index from the list when he dies by using attach to event>death. This is not doable I think and really difficult to search for the correct player. You could also then delete the whole list and re-add the people, but then you'd still use the 'players' variable. So I think it's better to check upon the group at the moment it's needed and THEN sort out which message goes where.. (rather than having a jar of players set on standby)

/ontopic

I forgot to add a crucial piece! After every check you need to empty the list again, or else it will get fuller and fuller.. that's not what's supposed to happen. You could also connect the 'out' of the 'modify list' back to 'empty' with a delay of 1 second or so instead of what I did. Just don't do it instantly.

http://prntscr.com/8e0yh6

FFMw5yp.png

Link to comment
Share on other sites

Ah I'll change that now. Could get kinda messy when it runs to long(wouldnt this create an endless cycle of emptying though?). But.. I'm reinitializing it every call so that way it wont be filled, a new object variable will be created everytime. Ill check the performance and share the kismet when its done!

Link to comment
Share on other sites

Ah I'll change that now. Could get kinda messy when it runs to long(wouldnt this create an endless cycle of emptying though?). But.. I'm reinitializing it every call so that way it wont be filled, a new object variable will be created everytime. Ill check the performance and share the kismet when its done!

K all good, I don't know if it also fires the 'out'' if you empty the list, maybe it does, We'll see! you can set an announcement in between those connecting points and see if the console spams you mad. Then you know it's an infinite loop!

If you can't figure out stuffs post them here or send me a PM and we can screenshare on skype or use Teamviewer to get the kismet working.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...