scripting new skill / class

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!
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

scripting new skill / class

Post 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.
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
Baddock
Posts: 12
Joined: Tue Nov 04, 2014 8:28 pm

Re: scripting new skill / class

Post 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?
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: scripting new skill / class

Post 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
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: scripting new skill / class

Post 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 :(.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: scripting new skill / class

Post 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*
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: scripting new skill / class

Post 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!! :lol:
SpoilerShow

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,
}	
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: scripting new skill / class

Post by akroma222 »

Although... defining this in init.lua
SpoilerShow

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 -
SpoilerShow

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.
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: scripting new skill / class

Post 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?
I'm the Gate I'm the Key.
Dawn of Lore
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: scripting new skill / class

Post 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.
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: scripting new skill / class

Post 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.
Last edited by Leki on Fri Nov 07, 2014 3:46 pm, edited 1 time in total.
I'm the Gate I'm the Key.
Dawn of Lore
Post Reply