Aller au contenu

Photo

The purpose of "int bResult"


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Sonmeister

Sonmeister
  • Members
  • 167 messages
Please explain the purpose of "int bResult" - anyone...

Modifié par Sonmeister, 05 mai 2010 - 02:16 .


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
Unlike regular scripts, plot scripts' main function is int StartingConditional(). This means that the code within that function has to return an integer.
That is the reason there is always a 'int bResult' (or something similar) is defined in the plot script. It usually is defined with a default value of FALSE since the EVENT_TYPE_SET_PLOT events do not expect anything to be returned. In cases where EVENT_TYPE_GET_PLOT is used, the appropriate integer is returned

If your plot script has only EVENT_TYPE_SET_PLOT events, you can skip the declaration and just do a 'return FALSE' at the end of the StartingConditional block.

Edited :)

Modifié par TimelordDC, 05 mai 2010 - 03:19 .


#3
Sonmeister

Sonmeister
  • Members
  • 167 messages
Thank for the new response Timelord, that helps clarify the purpose of int bResult for me!

Modifié par Sonmeister, 05 mai 2010 - 12:52 .