Jump to content

Papyrus Naming Conventions


fireundubh

Recommended Posts

Generally:

  • a --> function argument
  • k --> object
  • b --> boolean
  • i --> integer
  • f --> float
  • s --> string
  • p --> pointer (carryover from internal code, inconsistency, should not be used)
  • r --> reference (carryover from internal code, inconsistency, should not be used)

SmkViper, who I believe created or leads programming on Papyrus at Bethesda Game Studios, helped flesh out this list.

 

There doesn't appear to be any conformity to conventions with regard to local and script variables.

 

However:

  • Properties tend to be upper CamelCase.
  • Script variables tend to be upper CamelCase.
  • Local variables tend to be lower camelCase.
  • ReferenceAlias properties always have the "Alias_" prefix.
Link to comment
Share on other sites

Thanks :) Always wondered what the "k" was for.

 

Some "unofficial conventions" you'll find in several Skyrim mods :

 

ALL_CAPS_WITH_UNDERSCORE are usually used for read-only properties like SkyUI's flags (it make more sense to pass "FLAG_DISABLED" to a function than "0x01" when reading the code), node path, texture/model path, ...

 

Scripts variables also often have an underscore prefix, though this is probably a leftover from python dev who decided to use papyrus :P

Make a nice way to differentiate var from properties though.

Link to comment
Share on other sites

 

There doesn't appear to be any conformity to conventions with regard to local and script variables.

 

Unless they increase the string counter in saves to 32 bit, it would benefit everyone to use the same variable names across scripts.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...