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.
Level Up Trigger
- zimberzimber
- Posts: 432
- Joined: Fri Feb 08, 2013 8:06 pm
Re: Level Up Trigger
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:
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.
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,
},
},
}
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.