Jump to content


Photo

Calling Custom Events Just Don't Work


  • Please log in to reply
4 replies to this topic

#1 Darth

Darth

    GMC Member

  • New Member
  • 436 posts

Posted 26 October 2007 - 04:24 PM

I am probably making an elementary mistake for the past 20 minutes:

Step event:
if(resizer_step())
{
    show_message("yes")
    event_user(0);
    with(all)
    {
        event_perform(ev_other, ev_user0)
    }
}

The message "yes" comes up. event_user(0) is not executed, neither is the event_perform.
Two of my objects have a User Defined 0.

The above code's object's User-Defined-0:
show_message("three")

The message does not come.
Also neither does the other user-defined 0 (the object IS in the room):

show_message("WORK FOR FLIPS SAKE!!!")
event_user(1);

event 1 is irrelevant.

HOWEVER: In the create event for the above object, event_user(1) does work.

I don't know what I am doing wrong.

Previously event_perform(ev_other, ev_user0) was event_user(0) but I changed it to see if it would work, the event_user(0) above the with() wasn't there and neither was the show_message.

erm... help?

Edit
The with() is being executed properly, previously i had a show_message() in there... but that came up 1 more time than there was objects...

Edit again
Erm, would calling a room_restart() in the resizer_step() event cause the user-defined events to not get executed? : whistle :

Apparently so... but the show_message() is executed and the event_user() is not, how come?

Edited by Darth, 26 October 2007 - 04:30 PM.

  • 0

#2 Daniel-Dane

Daniel-Dane

    GMC Member

  • New Member
  • 3581 posts

Posted 26 October 2007 - 04:33 PM

Apparently you found the answer yourself. When a room change or game end or similar is going to happen further events might be disabled until the new room has been loaded.
  • 0

#3 GearGOD

GearGOD

    Deus Verus

  • GMC Member
  • 2153 posts

Posted 26 October 2007 - 05:06 PM

shouldn't it be ev_user, ev_user0 ?
  • 0

#4 Darth

Darth

    GMC Member

  • New Member
  • 436 posts

Posted 26 October 2007 - 05:07 PM

I also tried ev_user0 (not ev_user) in both event_perform() and user_event().
  • 0

#5 Sinaz

Sinaz

    MCP Killer

  • Retired Staff
  • 2751 posts
  • Version:GM8

Posted 26 October 2007 - 07:02 PM

shouldn't it be ev_user, ev_user0 ?

<{POST_SNAPBACK}>

ev_user# is a sub-event of the ev_other variety.

So, it's ev_other, ev_user#

event_user(#) I'm not familiar with, but if you are trying to execute that particular event, you might want to just do an event_perform() like you do in the with() statements and see if that solves anything.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users