Page 1 of 1

Level Up Trigger

Posted: Mon Dec 26, 2016 3:17 pm
by Atrius
Hi Guys,

Just getting started with scripts and try to add a script that provides an additional skill point when leveling up.

Not sure on the exact syntax required for this.

Any help is appreciated.

Re: Level Up Trigger

Posted: Mon Dec 26, 2016 3:47 pm
by zimberzimber
You'll have to 'redefine' the party object, and add the appropriate function(referred to as hook) to it.
Here is a simple example that would play the "air_elemental_attack" sound every time the party moves:

Code: Select all

defineObject{
	name = "party",
	baseObject = "party",
	components = {
		{
			class = "Party",
			onMove = function(self, direction)
				playSound("air_elemental_attack")
			end,
		},
	},
}
What you need is the onLevelUp hook, and have it increase skill points by 1.
There are many more party hooks, you can find them here.

And a word of warning - If there is already a redefined party object that you got from an external source (GrimTK for example), you should merge them, otherwise only one of the definitions will be taken into account.