how to modify a champion skill while wearing an armor

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

how to modify a champion skill while wearing an armor

Post by bongobeat »

Hello guys,

I wonder if someone can explain how to script an armor, which add a bonus to a skill of a champion when the armor is worn and remove the bonus when the armor is "unworn".
(unworn -> not wear, not sure if it is correct english!)

I'm trying to define a special armor,
which give + 10 in assassination, of course only for a ninja:
and it remove the 10 bonus if removed
I have try this one, but it always give + 10 in assassination and it keeps the value, any times it is worn
the (-) in the unequip function didnt change anything when I remove the armor
SpoilerShow

Code: Select all

defineObject{
		name = "ninja_mail",
		class = "Item",
		uiName = "Shadow Armor",
		model = "assets/models/items/lurker_clothes.fbx",
		description = "Light, fine, strong, this armor suits for the best ninja.",
		slot = "Torso",
		armorSkill = "light_armor",
		gfxIndex = 17,
		gfxAtlas = "mod_assets/oliveitem/retexture/icone/oliveitem.tga",
		protection = 12,
		evasion = 10,
		weight = 4.75,
		onEquipItem = function(champion, slot) 
		if ( slot == 2 ) then
                champion:trainSkill("assassination", 10, true)
		end
	end,
		onUnequipItem = function(champion, slot)
		if ( slot == 2 ) then
		champion:trainSkill("assassination", -10, true)
		end
	end,
		}
Last edited by bongobeat on Tue Sep 10, 2013 11:03 pm, edited 1 time in total.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: how to modify a champion skill while wearing an armor

Post by Dr.Disaster »

I fear this will never work. Reason is that one can only raise a skill but not lower it; there is no un-train possibility.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: how to modify a champion skill while wearing an armor

Post by bongobeat »

mhh what a shame! :(
thanks for your reply
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Post Reply