Here is my contribution:
Naming scripts
When the number of managed scripts increases considerably, sometimes it is difficult to quickly find the one that you want to open. I decided to use the following naming convention, which helped me a lot.
<mod prefix><nnn>sc_<script type>_<script name>
"Script type" can take the following values depending on the resource it is attached to:
cr - Creature
ar - Area
pt - Plot
cs - Cutscene
tr - Trigger
ip - Placeable
dg - Dialog (or conversation)
im - Item
So I had scripts like,
ata100sc_cr_olias -> Just reading its name I know that it is a script attached to a creature.
ata100sc_cs_intro_end -> A script attached to a cutscene as ending script.
ata100sc_dg_olias_adds_pin -> A script used in a conversation branch.
Unnecessary switch statements
It is also common to copy-paste large "switch" statements from the campaign core scripts and then remove the events that we don't want to override. The problem here is that sometimes the "switch" ends having just one or two "case" statements. The code will work (same way that a bazooka will kill a fly
Comments
I got used to add the following comments at the beginning of all the scripts:
/*
Type: Script played when a cutscene ends.
Owner: ata102cs_corpses.cut
Desc: Move the player to a new position.
*/
For "Type" I used values like "Creature script", "Script triggered in a conversation", ...
"Owner" is the name of the resource to which the script is attached. In this example, it is a cutscene.
"Desc" is just a short description of what the script does.
I have some more good practices to share, but I'll continue later
Modifié par _L_o_B_o_, 30 janvier 2011 - 06:01 .





Retour en haut






