Page 1 of 1

[Doc] LifePlay code convention for modding

Posted: Thu Oct 21, 2021 10:37 pm
by Raddeck
These are not rules but a recommended way to create your mods.


- The name of your mod always need to start with your name/nickname/initials preceded by a _ .
Example :

Code: Select all

rk_ = Raddeck, 
sb_ = SexyBastardo 
nn_ = NickNo
and so on...

- Always use the .zip extension when you compress your mod.


- The name of your mod when zipped, always need to have is version number at the end.
Example:

Code: Select all

rk_God_Mod-1.0.3.zip

- Try to include your name/nickname/initials preceded by _, at the beginning of your filenames.
Example:

Code: Select all

BD_myscene.lpscene
BD_myaction.lpaction
I recommend it because, maybe one day another modder will create a scene with the same names as your scene without any intention of wanting to change your scene, and it will start creating bugs or conflicts over time on both.
You can also do: nickname+mod initial+scene name.

Code: Select all

My nickname AB_ | Mod name: My Shop
AB_MS_myscene.lpscene

- Same goes for variables and globals.
Try to include your name/nickname/initials preceded by _, at the beginning of your variables or globals. For preventing bugs or conflicts.
Example:

Code: Select all

myvariable = getActorVar(sgT_myvariable)
myglobal = sgT_myglobal.getGlobal()

- Leave empty line after scene options
Write your scenes like this:

Code: Select all

"How are you?"
0:: "Good"
1:: "Bad"

If 0
    mood +=1
Endif
// Note the empty line between the last choice "Bad" and the If 0!


Not working example:
"How are you?"
0:: "Good"
1:: "Bad"
If 0
    mood +=1
Endif

- Use spaces not tabs for indentation. The game can't read Tab characters at all.

That's all! Happy coding!