Is your feature request related to a problem?
From what I see, the value of event_type is the most immediate event type - for example, within an object's Create event code, event_type will always be ev_create. But if that instance is being created within another object's Step, or within a Collision event, etc. there isn't a clean way to get that info - and because of the event order, that information would let you know which events have passed and which are still to come, this step.
The particular case that led me to think about this was an instance sometimes moving between its creation and a 1-step alarm, and sometimes not. The game mechanic in question was a submunitioning mine that can detonate on collision or on a time fuse, and therefore sometimes the instance was created from Step > Destroy > Create (movement occurs after Step) and sometimes from Collision > Destroy > Create (movement does not occur after Collision).
Describe the solution you would like to see
Either or both:
- A variable similar to
event_type except it's for the current stage of the event order, maybe call it event_type_global
- A variable similar to
debug_get_callstack except it's the stack of events, simpler than strings and only dealing with events, not function calls
Describe alternatives you have considered
- Have every object's code deal with passing the event value forward, implementing this feature inelegantly through GML
- Parsing the strings within
debug_get_callstack, which I haven't actually tried to profile but I don't imagine this would be at all efficient
- Never write code that takes action immediately, but instead sets a state that defers the action to another consistent event
Additional context
Pretty niche use cases, I guess.
Is your feature request related to a problem?
From what I see, the value of
event_typeis the most immediate event type - for example, within an object's Create event code,event_typewill always beev_create. But if that instance is being created within another object's Step, or within a Collision event, etc. there isn't a clean way to get that info - and because of the event order, that information would let you know which events have passed and which are still to come, this step.The particular case that led me to think about this was an instance sometimes moving between its creation and a 1-step alarm, and sometimes not. The game mechanic in question was a submunitioning mine that can detonate on collision or on a time fuse, and therefore sometimes the instance was created from Step > Destroy > Create (movement occurs after Step) and sometimes from Collision > Destroy > Create (movement does not occur after Collision).
Describe the solution you would like to see
Either or both:
event_typeexcept it's for the current stage of the event order, maybe call itevent_type_globaldebug_get_callstackexcept it's the stack of events, simpler than strings and only dealing with events, not function callsDescribe alternatives you have considered
debug_get_callstack, which I haven't actually tried to profile but I don't imagine this would be at all efficientAdditional context
Pretty niche use cases, I guess.