Page 1 of 3
scripting new skill / class
Posted: Wed Nov 05, 2014 4:00 pm
by Drakkan
Hello script masters,
somebody here around to script how to define new class / skill / trait, maybe even new race ? If am not wrong , definition is already avaiable. just an idea.
Re: scripting new skill / class
Posted: Wed Nov 05, 2014 7:07 pm
by Baddock
I would love to know how to do this as well, and to add to the list; is there a way to script new spells?
Re: scripting new skill / class
Posted: Wed Nov 05, 2014 8:30 pm
by Doridion
Drakan, i already can say to you that the
defineRace and
defineCharClass are present in the grimrock2.dat. But didn't search about arguments . In the case of
defineTile, there's no argument/class that can be set after. Wiaiting for asset definition in the modding part of the main site.
Here after is the list i found in the grimrock2.dat
Code: Select all
defineAnimationEvent
defineCharClass
defineMaterial
defineObject
defineParticleSystem
defineProxyClass
defineRace
defineRecipe
defineSkill
defineSound
defineSpell
defineTile
defineTrait
Re: scripting new skill / class
Posted: Wed Nov 05, 2014 8:40 pm
by JohnWordsworth
It's in the official scripting reference too - with the parameters.
However, I can't get it to work at the moment. I have tried defining a race, a class and the corresponding traits with the same name, but they don't seem to appear in the character generation window on starting a new game
![Sad :(](./images/smilies/icon_e_sad.gif)
.
Re: scripting new skill / class
Posted: Wed Nov 05, 2014 8:48 pm
by Doridion
*Off-topic : ON*
JohnWordsworth wrote:It's in the official scripting reference too - with the parameters.
Sadly not all (( The defineTile is not yet there.
*Off-topic : OFF*
Re: scripting new skill / class
Posted: Fri Nov 07, 2014 5:13 am
by akroma222
@Baddock - Yes new spells can and will be scripted up. The defining of spells has been updated in the scripting reference, I am sure a thread with some fine examples will be created soon.
I have had similar defeat with defining a new class + trait for the class
I tried exporting, playing and creating characters with these definitions in init.lua, but I could not select New Class at char creation.
Im obviously missing something!!
Code: Select all
defineCharClass{
name = "new_class",
uiName = "New Class",
traits = {[1] = "tough"},
skillPoints = 5,
}
defineTrait{
name = "new_class",
uiName = "New Class",
priority = 10,
icon = 0,
description = "Description of skill",
gameEffect = "Some game Effect",
charGen = true,
hidden = false,
}
Re: scripting new skill / class
Posted: Fri Nov 07, 2014 8:55 am
by akroma222
Although... defining this in init.lua
Code: Select all
defineCharClass{
name = "newclass",
uiName = "New Class",
skillPoints = 5,
charGen = true,
}
defineTrait{
name = "newclass",
uiName = "New Class",
priority = 10,
icon = 0,
description = "Description of skill",
gameEffect = "Some game Effect",
charGen = true,
hidden = false,
}
Then creating a plate connected to a script entity in dungeon with -
Code: Select all
function changeClass()
local c = party.party:getChampion(1)
c:setClass("newclass")
end
will indeed change your first characters class to New Class.
Re: scripting new skill / class
Posted: Fri Nov 07, 2014 3:31 pm
by Leki
@petri: Is it possible to load custom dungeon init.lua (or let me say custom_character_creation.lua stored in my_assets scripts) after selecting custom dungeon from custom dungeon game menu (by clicking "chose" button) to get custom character class and race and skills as part of the character creation?
Re: scripting new skill / class
Posted: Fri Nov 07, 2014 3:36 pm
by petri
Leki wrote:@petri: Is it possible to load custom dungeon init.lua (or let me say custom_character_creation.lua stored in my_assets scripts) after selecting custom dungeon from custom dungeon game menu (by clicking "chose" button) to get custom character class and race and skills as part of the character creation?
It already works like this, but you need build 2.1.15 or later.
Re: scripting new skill / class
Posted: Fri Nov 07, 2014 3:41 pm
by Leki
petri wrote:Leki wrote:@petri: Is it possible to load custom dungeon init.lua (or let me say custom_character_creation.lua stored in my_assets scripts) after selecting custom dungeon from custom dungeon game menu (by clicking "chose" button) to get custom character class and race and skills as part of the character creation?
It already works like this, but you need build 2.1.15 or later.
It's not presented in char creation menu,
and I'm getting crash in console typing party.party:getChampion(1):setClass("my_custom_class")
party.party:getChampion(1):setClass("rogue") for example works
Code: Select all
defineCharClass{
name = "my_custom_class",
uiName = "My Class",
skillPoints = 5,
skillLevel = 2,
charGen = true,
}
I tried to "improve definition", because it crashed at champion.lua getSkillLevel as log said.