(Mod) Character Skill Points Reallocation Tome

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
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

(Mod) Character Skill Points Reallocation Tome

Post by Jgwman »

So, I made a simple script mod in LoG 1 which added a tome which, when used, allowed you to respec your character (reallocate all skill points); but I made it really late. So I thought I'd go ahead and port it for LoG 2 so some modders can actually use it this time if they want :)

As far as we know, we still don't have a plugin system for LoG 2, where scripts can be added to affect all dungeons globally; so I have provided a small room with 4 tomes for non-modders to use for respeccing by importing the party into the dungeon (but clearly this has to be done between dungeons). I am hoping some of you guys might want to include it in your dungeons.

Steam Workshop: http://steamcommunity.com/sharedfiles/f ... =330364958

My item script is here:
SpoilerShow

Code: Select all

--items.lua:
-- This file has been generated by Dungeon Editor 2.1.9

-- TODO: place your custom item definitions here

defineObject{
   name = "tome_memories",
   baseObject = "tome_wisdom",
   components = {
      {
         class = "Item",
         uiName = "Tome of Memories",
         gfxIndex = 30,
         description = "You feel as if the thick volume is drawing you in...perhaps to relieve your mind of its heavy burdens?",
      },
	  {
		 class = "UsableItem",
		 sound = "level_up",
		 onUseItem = function(self,champion)
			
			local skills = {}
			skills[1] = "alchemy"
			skills[2] = "athletics"
			skills[3] = "concentration"
			skills[4] = "light_weapons"
			skills[5] = "heavy_weapons"
			skills[6] = "missile_weapons"
			skills[7] = "throwing"
			skills[8] = "firearms"
			skills[9] = "accuracy"
			skills[10] = "critical"
			skills[11] = "armors"
			skills[12] = "dodge"
			skills[13] = "fire_magic"
			skills[14] = "air_magic"
			skills[15] = "earth_magic"
			skills[16] = "water_magic"
			
			local traits = {}
			traits[1] = "double_throw"
			traits[2] = "improved_alchemy"
			traits[3] = "bomb_expert"
			traits[4] = "air_mastery"
			traits[5] = "dual_wield"
			traits[6] = "improved_dual_wield"
			traits[7] = "earth_mastery"
			traits[8] = "firearm_mastery"
			traits[9] = "fire_mastery"
			traits[10] = "backstab"
			traits[11] = "assassin"
			traits[12] = "uncanny_speed"
			traits[13] = "pack_mule"
			traits[14] = "piercing_arrows"
			traits[15] = "light_armor_proficiency"
			traits[16] = "heavy_armor_proficiency"
			traits[17] = "reach"
			traits[18] = "two_handed_mastery"
			traits[19] = "water_mastery"
			traits[20] = "meditation"

			for i = 1, 16 do
			champion:trainSkill(skills[i], -(champion:getSkillLevel(skills[i])))
			end
			
			for i = 1, 20 do
			champion:removeTrait(traits[i])
			end
			  
			  --This message is most likely mod specific
			  hudPrint("A more persistent wind blows through the chamber, tugging at your garments. You feel fresh and strong anew.")
              return true 
         end
	  }
   },
}
--
Known Bugs
--

- None, at the moment (Thanks to Skuggasvein)

Hope this is useful to somebody. I'd like to hear feedback from anyone who messes with it :)
Last edited by Jgwman on Thu Oct 23, 2014 1:29 am, edited 2 times in total.
User avatar
Skuggasveinn
Posts: 561
Joined: Wed Sep 26, 2012 5:28 pm

Re: (Mod) Character Skill Points Reallocation Tome

Post by Skuggasveinn »

just a thought, since Alchemy trait is called improved_alchemy have you tried to call improved_dual_wield to remove that trait ?

Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.
User avatar
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

Re: (Mod) Character Skill Points Reallocation Tome

Post by Jgwman »

That was it, I can't believe I never thought of that :lol: Thanks a bunch! Updating now
User avatar
sapientCrow
Posts: 608
Joined: Sun Apr 22, 2012 10:57 am

Re: (Mod) Character Skill Points Reallocation Tome

Post by sapientCrow »

Is it possible at all to mod in new items and items such as this into already existing games.
Or does everything have to be in a new dungeon/map or campaign?

I am trying to figure out if it is possible just to edit some attributes on items or the amount of exp bonus to a certain medallion etc. etc.
thanks for making this available.
User avatar
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

Re: (Mod) Character Skill Points Reallocation Tome

Post by Jgwman »

sapientCrow wrote:Is it possible at all to mod in new items and items such as this into already existing games.
Or does everything have to be in a new dungeon/map or campaign?

I am trying to figure out if it is possible just to edit some attributes on items or the amount of exp bonus to a certain medallion etc. etc.
thanks for making this available.
Glad to do it. As I said in my original post, I think it must still be new maps only as in Grimrock 1; since the dungeons (campaign & mods) are .dat files and not raw files, the scripts cannot be edited, and there is no plugins system I am aware of. Not sure about this, and I hope the devs prove me wrong when they release the scripting reference, but for now, I would say it isn't possible.
User avatar
sapientCrow
Posts: 608
Joined: Sun Apr 22, 2012 10:57 am

Re: (Mod) Character Skill Points Reallocation Tome

Post by sapientCrow »

I would really love to just take a gander at the exp tables and other formula and make some minor tweaks.
That is more of my modding style.
thanks again
User avatar
SnowyOwl47
Posts: 148
Joined: Fri Sep 12, 2014 10:41 pm

Re: (Mod) Character Skill Points Reallocation Tome

Post by SnowyOwl47 »

There is something kinda like a plugin system but its not for all dungeons if you make a .lua script you can import it through script_entities. You can change embedded to external and put the name of your script in but I mean the path like mod_assets/scripts/party_hooks.lua
User avatar
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

Re: (Mod) Character Skill Points Reallocation Tome

Post by Jgwman »

Yes. I meant a system which would import the script globally.
User avatar
Drakkan
Posts: 1318
Joined: Mon Dec 31, 2012 12:25 am

Re: (Mod) Character Skill Points Reallocation Tome

Post by Drakkan »

I like this, thanks for tome script !
Breath from the unpromising waters.
Eye of the Atlantis
User avatar
Jgwman
Posts: 144
Joined: Thu Jun 28, 2012 10:14 pm

Re: (Mod) Character Skill Points Reallocation Tome

Post by Jgwman »

Glad it can be useful Drakkan!
Post Reply