Level Up Trigger

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Atrius
Posts: 1
Joined: Mon Dec 26, 2016 3:14 pm

Level Up Trigger

Post 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.
User avatar
zimberzimber
Posts: 432
Joined: Fri Feb 08, 2013 8:06 pm

Re: Level Up Trigger

Post 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.
My asset pack [v1.10]
Features a bit of everything! :D
Post Reply