Bridge Commander Central

BC Forums => BC Scripting => Topic started by: LJ on August 22, 2006, 07:16:42 PM

Title: Mission_GetNextEventType
Post by: LJ on August 22, 2006, 07:16:42 PM
Heya :)

I have a question about the usage of:
Code: [Select]

App.Mission_GetNextEventType()

and:
Code: [Select]

App.Mission_GetNextEventType() + 333

Which is a fix, i assume to give out event types larger than the ones the game gives out.  (would throwing away the first few events of each mission would do the same?)

Inorder to get event ID's which are not already given out at the start by other mods/fixes/versions of this fix I am throwing away 1000 event types at the launch of each instance of the Immersion Framework.  This is messy and I don't like it.  What can I do to make this work better? (and yes I have tried adding + 333 but still gives out the same event more than once.

Code: [Select]

        ## Throw away 1000 events
        for i in range(0, 1000):
            App.Mission_GetNextEventType()



Any Ideas?

LJ
Title: Mission_GetNextEventType
Post by: MLeo on August 23, 2006, 07:45:32 AM
You can only use App.Mission_GetNextEventType() when you are _sure_ you are in a mission (in the init function of QB Autostart for example).
Or when you use a trigger to get the time when there is a player created.

If you put it in the module directly (or call a function in the global namespace) then it will return 0, because there isn't a mission going on.

In those cases, use App.UtopiaModule_GetNextEventType()
Title: Mission_GetNextEventType
Post by: LJ on August 24, 2006, 03:45:15 PM
I'm only calling it from within a Mission. :) lol - it's not that it returns's 0 but that the event ID's seem to trigger events which don't belong to them.
Title: Mission_GetNextEventType
Post by: MLeo on August 24, 2006, 04:00:36 PM
I suppose that on specific events, you could also try the Game and Episode versions.

If all else fails, try the Utopia version.

[EDIT] I must say, I do admit that I use the Utopia version for almost all my needs.
Title: Mission_GetNextEventType
Post by: LJ on August 26, 2006, 09:49:31 AM
hmm yea i suppose if all else fails.. i really think it would be nice to fix/figure out what is causing the problem though
Title: Mission_GetNextEventType
Post by: MLeo on August 26, 2006, 10:56:19 AM
I have so far deduced that the replacement of the functions would cause atleast the keys to be needing rebinding by the user.


[EDIT] Thinking about it some more, the impact would be limited.
Most events in game are already generated.