suggestion: on_event

Started by Goldmund, Sun 07/12/2003 01:08:16

Previous topic - Next topic

Goldmund

Is it possible that in - for example - on_event (enter_room, data) data could mean ANY room? And similarly with other on_events?
It would be very useful and time-saving feature!
I may elaborate on this later, if others don't see the rewards of having this feature.

Pumaman

I'm not sure what you mean.

on_event is called whenever the player enters any room, and the data parameter has the room number in case you need to know it. If you don't care, just ignore the data parameter.

Goldmund

Ooh, sorry, I mistook everything with everything!
I wanted to make the game do something everytime the character enters a new room and though that data has to be always specifed... now I know how to do it.
Delete this thread, sorry to harras you.

Pumaman

Hehe no worries, I'll post the solution in case anyone searches for this in future.

function on_event(int event, int data) {
 if (event == ENTER_ROOM) {
   Display("You've just entered a new room! Room %d!", data);
 }
}

SMF spam blocked by CleanTalk