Author Topic: Mission_GetNextEventType  (Read 4551 times)

Offline LJ

  • Retired Staff
  • Posts: 1661
  • Cookies: 1139
Mission_GetNextEventType
« 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

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Mission_GetNextEventType
« Reply #1 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()
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline LJ

  • Retired Staff
  • Posts: 1661
  • Cookies: 1139
Mission_GetNextEventType
« Reply #2 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.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Mission_GetNextEventType
« Reply #3 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.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline LJ

  • Retired Staff
  • Posts: 1661
  • Cookies: 1139
Mission_GetNextEventType
« Reply #4 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

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Mission_GetNextEventType
« Reply #5 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.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.