Scripter's Guide
This will give a short overview about what scripting for Summoning Wars entails and how to do it yourself.
Contents
|
Getting started
A place to start when trying to get into scripting is to look at the existing quests. Take a small side quest, look into it's quest-file and try to understand how it works. Knowledge of script languages in general and Lua-Script in particular is necessary to understand what's going on. If you look into a quest-file and understand nothing at all, then you should probably learn a bit about Lua first.
Useful tools and skills
To script and edit quests you only need a text-editor of your choice and Summoning Wars. Prior knowledge in scripting or programming is useful, but not absolutely necessary, if you are willing to invest (a lot) of time into learning on the fly.
Format and quality standards
Scripts written for Summoning Wars should follow the standard guidelines for good coding: Use meaningful names for your variables, leave comments for those who will one day try to maintain or understand your script and only write one statement per line.
Since almost all scripting is done for quests there is another important thing to consider: Quests follow a timeline. You first talk to Mr. NPC, then go to The Dangerous Field to pick up some stuff, then talk to Mrs. NPC and then return to Mr. NPC for the reward. All those events take place in different regions. When scripting the quest:
- All events belonging to it should be in one file. It's possible to hide your quest entirely in other quests, but don't do it.
- Events should be found in your quest-file in chronological order. It may be tempting to order them by region or NPC or something like that, but don't. It's a nightmare for anyone else to read, and you likely won't understand what you did and why in three months either.
There is no real way to make sure a script is absolutely bug-free, but you should still test it as thoroughly as possible. That means you should not try to test if everything you did works (you should do that while developing the script), but you should try to break it on purpose. If you succeed in breaking the script then your work is not done.
Examples and tutorials
Work in progress
Test your script in-game
Testing your script in-game should be fairly easy. You just have to see whether all those little events you poured so much time into actually trigger if (and only if) the conditions you set are met.