The main question is "How to flag an event to be processed during pause ?".
I am using SignalEvent function inside EVENT_TYPE_EQUIP.
EVENT_TYPE_EQUIP can be processed while the game is in pause but the custom event I send to the same character is processed only after the pause.
case EVENT_TYPE_EQUIP:
{
event ev = Event(CUSTOM_EVENT);
SignalEvent(OBJECT_SELF, ev);
break;
}
Events processing during pause
Débuté par
anakin5
, févr. 03 2010 01:58
#1
Posté 03 février 2010 - 01:58
#2
Posté 03 février 2010 - 05:13
Did you try setting the process immediately paramater on SignalEvent to TRUE? If that doesn't work, I suspect events created by scripting can't be processed while the game is paused.
#3
Posté 03 février 2010 - 12:46
I did it and that makes the event beeing processed immediately. The problem is that I don't want to process it before the end of EVENT_TYPE_EQUIP.
It is not a whim, it is just that doing it immediately or after EVENT_TYPE_EQUIP change the behavior of my event.
When you switch your weapon set, the game seems to switch your weapons, then effectively update your weapon set.
Assume I am switching from weapon set 0 to weapon set 1, GetActiveWeaponSet return 0 in EVENT_TYPE_EQUIP if the switch triggered this event (if you have a weapon in weapon set 1).
GetActiveWeaponSet will return 1 in my custom event.
So that's why I need to process my event after EVENT_TYPE_EQUIP, to let the active weapon set being updated. I have no problem with it outside of game pause.
By the way, I am sending the event to OBJECT_SELF with SignalEvent. But I can send it to an other object if needed. My idea is that maybe the player is affected by "pause" while and other object is not. I tried with GetModule but the module doesn't process event during pause as well.
It is not a whim, it is just that doing it immediately or after EVENT_TYPE_EQUIP change the behavior of my event.
When you switch your weapon set, the game seems to switch your weapons, then effectively update your weapon set.
Assume I am switching from weapon set 0 to weapon set 1, GetActiveWeaponSet return 0 in EVENT_TYPE_EQUIP if the switch triggered this event (if you have a weapon in weapon set 1).
GetActiveWeaponSet will return 1 in my custom event.
So that's why I need to process my event after EVENT_TYPE_EQUIP, to let the active weapon set being updated. I have no problem with it outside of game pause.
By the way, I am sending the event to OBJECT_SELF with SignalEvent. But I can send it to an other object if needed. My idea is that maybe the player is affected by "pause" while and other object is not. I tried with GetModule but the module doesn't process event during pause as well.
#4
Posté 03 février 2010 - 06:59
If you're looking for a hack, maybe you can use the equip event with a custom parameter and check for it in the handler. ^^
#5
Posté 05 février 2010 - 02:25
It is like I solved my problem. Well, I didn't find a way to process an event as soon as this event is queue during pause, it seems that only the engine has the right to do that.
The engine function I wanted to call cannot be called during pause as well
So it doesn't matter if I succeed or not to send this event.
The engine function I wanted to call cannot be called during pause as well
#6
Posté 05 février 2010 - 05:32
Darn, it looks like you made a quickbar mod too. I wish I'd found this before wasting the time lol
BTW, even if you had found a way to process the event immediately it wouldn't matter. Quickbar does not swap during pause.
BTW, even if you had found a way to process the event immediately it wouldn't matter. Quickbar does not swap during pause.
Modifié par SuperD-710, 05 février 2010 - 05:33 .
#7
Posté 05 février 2010 - 05:49
In a quick test, the bProcessImmediate parameter is doing the difference for me, even for custom events.
SignalEvent(OBJECT_SELF, ev, TRUE);
Nice. At least, I know now what this parameter is good for.
SignalEvent(OBJECT_SELF, ev, TRUE);
Nice. At least, I know now what this parameter is good for.





Retour en haut






