Page 1 of 1

SpaceBoundaries

Posted: Thu Mar 24, 2011 2:55 pm
by kmaurus
I'm trying to display a text message to inform the player that he's leaving the allowed region. Now I'm wondering how (or if) this can be done without including the GametypeInfo.h-File.

Re: SpaceBoundaries

Posted: Thu Mar 24, 2011 4:24 pm
by Mozork
Yes, as soon as the notifications module is back in orxonox (instead of the modules) you can just send a notification, which is rather straight forward. I'm actually working on making the notifications better and once that is done they'll be moved into the orxonox directory again.

Re: SpaceBoundaries

Posted: Thu Mar 24, 2011 7:24 pm
by x3n
have a look at the KillMessage class. it displays a message whenever you kill someone. it inherits from the GametypeMessageListener-interface which is used by GametypeInfo to send the actual message. you could add a new function to the interface to send your message.

notifications may work as well, but maybe rather work with interfaces instead of moving it all to the orxonox library?


edit: the way I described works also in multiplayer matches (the message is sent to the client using a network function call). I don't know if this works with notifications as well

Re: SpaceBoundaries

Posted: Thu Mar 24, 2011 8:03 pm
by Mozork
Notifications should work over the network, at least they did, last time i checked.

Maybe I could think up some kind of interface.
I think that it would be a good idea to unfiy all these GamteypeMessages under notifications, to make things a little simpler and more generic, for that classes in orxonox need to have access to them, whether I do that by moving the notifications back into orxonox or by some kind of listener, I haven't thought about how to do it, yet. I'm not sure, which makes more sense.