Meanings behind Papyrus script variable naming conventions?

Post » Thu Jun 21, 2012 4:51 pm

A good number of the default Papyrus function and event parameters (but certainly not all) are prefixed in the old Microsoft fashion. Despite my hatred of the Hungarian naming convention (especially the "systems" version), I'm familiar enough with it. But some of the Bethesda developers apparently haven't heard that even Microsoft has finally seen the folly of encoding the types into the variable names.

What I can't figure out is the specific meanings behind the set used for Papyrus. Are they documented anywhere?

I've come to the conclusion that the a in front of most parameter names must mean argument (which is backwards to my old programmer brain since they are parameter variables, but since they hold arguments I can see the twisted logic).

So here's the list of prefixes I've seen. Can anyone fill in the rest for me?

ab - boolean argument
ai - integer argument
af - float argument
as - string argument
ak - ?
ae - ?
ap - ?
ar - ?
User avatar
Helen Quill
 
Posts: 3334
Joined: Fri Oct 13, 2006 1:12 pm

Post » Fri Jun 22, 2012 12:26 am

I believe 'k' is to denote a constant (a form with a FormID), like in chemistry. kForm will always be kForm no matter what you do to it. 'p' is probably for 'Property' and 'r' for 'Reference'. No ideas about 'e' prefixes or instances of *'u'.

*auiItemCount
User avatar
Natalie Harvey
 
Posts: 3433
Joined: Fri Aug 18, 2006 12:15 pm

Post » Thu Jun 21, 2012 5:53 pm

u = utility?
e = event?
User avatar
NIloufar Emporio
 
Posts: 3366
Joined: Tue Dec 19, 2006 6:18 pm

Post » Thu Jun 21, 2012 10:10 pm

u - unsigned? I realize Papyrus doesn't have unsigned integers, but it might be used as a signal that the value should not be negative.
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Thu Jun 21, 2012 4:08 pm

I believe 'k' is to denote a constant, like in chemistry. kForm will always be kForm no matter what you do to it. 'p' is probably for 'Property' and 'r' for 'Reference'. No ideas about 'e' prefixes or instances of *'u'.

*auiItemCount
You're probably right, but those akForm variables aren't any more of a constant than the aiCount variables. I can change both of them within the function itself and nothing will happen to the corresponding variables (if any) on the outside. Ironically, if anything akForm is far less of a constant than the integers, but cause as a reference variable if I modify one of it's properties those changes will be visible outside of my function. That's why the k puzzles me.

One of the places ae gets used is for an "int aeCombatState". If "au" is unsigned (which is a good guess Ingenue), then maybe "ae" is for for enumerated value?

At least I feel better that we're all just guessing and you didn't reply that it's obvious to you guys. :)
User avatar
m Gardner
 
Posts: 3510
Joined: Sun Jun 03, 2007 8:08 pm


Return to V - Skyrim