Jump to content


order of arguments in functions

2 replies to this topic

#1 subtledoctor

  • Modders
  • 2775 posts
  • Gender:Male

Posted 08 September 2018 - 10:18 AM

Simple, almost silly question:


In a typical function like ALTER_EFFECT or something, I always see and write it like this:

LPF FUNC_TION INT_VAR variable = # STR_VAR string = ~text~ END


Can the INT_VAR and STR_VAR be reversed?  Does it matter?  Can I do

LPF FUNC_TION STR_VAR string = ~text~ INT_VAR variable = # END



Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE

#2 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6792 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 08 September 2018 - 10:50 AM

I don't see any problems with this.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#3 argent77

  • Modders
  • 823 posts
  • Gender:Male

Posted 08 September 2018 - 11:44 AM

Order of parameter types for both DEFINE_(ACTION|PATCH)_FUNCTION and LAUNCH_(ACTION|PATCH)_FUNCTION is fixed at INT_VAR -> STR_VAR -> RET -> RET_ARRAY. Changing order will trigger a syntax error. See WeiDU Documentation for more details.


Edit: You can specify the parameters themselves within a section in any order though.

Edited by argent77, 08 September 2018 - 11:55 AM.

Reply to this topic


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users