Schmitzenbergh Posted September 5, 2015 Share Posted September 5, 2015 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 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 } } Quote Link to comment Share on other sites More sharing options...
Ruud033 Posted September 7, 2015 Share Posted September 7, 2015 This worked for me: http://prntscr.com/8do5vn Quote Link to comment Share on other sites More sharing options...
Schmitzenbergh Posted September 7, 2015 Author Share Posted September 7, 2015 I'll check this asap! Ty for the screen. I'll let you know if it worked and reveal my plan for my next map with this It's not that impressive but a nice touch that could be added to every map Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff kenz3001 Posted September 7, 2015 Totem Arts Staff Share Posted September 7, 2015 might be a good idea to add "player spawn" as players can change team mid game Quote Link to comment Share on other sites More sharing options...
Schmitzenbergh Posted September 7, 2015 Author Share Posted September 7, 2015 I thank you, it works! 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 Quote Link to comment Share on other sites More sharing options...
Ruud033 Posted September 8, 2015 Share Posted September 8, 2015 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 Quote Link to comment Share on other sites More sharing options...
Schmitzenbergh Posted September 8, 2015 Author Share Posted September 8, 2015 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! Quote Link to comment Share on other sites More sharing options...
Ruud033 Posted September 9, 2015 Share Posted September 9, 2015 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. Quote Link to comment Share on other sites More sharing options...
Totem Arts Staff Handepsilon Posted September 10, 2015 Totem Arts Staff Share Posted September 10, 2015 Technically it will, so you should just copy the thing up and put the same variable. 'Out' fires whenever something went 'In', which is the whole box on the left side Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.