Skip to content
DoDoCat edited this page Jun 17, 2020 · 9 revisions

Welcome to the Wardeclarer wiki!

Scripting

You need to follow these steps if you want to create your own script

1. Create your custom script class inherit from WDCScript

For example, you have a project named CustomScript, you need to make this class inherit from WDCScript like this:

class CustomScript : WDCScript
{
    ....
}

2. Implement the methods

There are four methods you need to implement in your Custom Script class yourself:

Method Name Parameters Description
BeforeRunScript None Before running the script
Init #1 Windown Height (type: Int32)
#2 Window Width (type: Int32)
Initizate the script
Update Graphic object (type: System.Drawing.Graphic) Called by the app when update each frame
SetRenderPanel frmRenderPanel class object If you need to change the canvas background

3. Run

Once you finish writing your codes, compile it into a dll and copy it into the Wardeclarer Scripts folder

After that, double-click the wardeclarer.exe and your script will showup in the script selector if your script dll is correct

Contribution

Post a pull request: https://github.com/cookgreen/Wardeclarer/pulls

See Also

Guide