Page 1 of 2

(Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 1:06 am
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 :)

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 1:19 am
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.

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 1:26 am
by Jgwman
That was it, I can't believe I never thought of that :lol: Thanks a bunch! Updating now

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 2:20 am
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.

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 2:26 am
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.

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 4:27 am
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

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 4:38 am
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

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 4:48 am
by Jgwman
Yes. I meant a system which would import the script globally.

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 7:48 am
by Drakkan
I like this, thanks for tome script !

Re: (Mod) Character Skill Points Reallocation Tome

Posted: Thu Oct 23, 2014 6:39 pm
by Jgwman
Glad it can be useful Drakkan!