increase stats (temporally) when wearing complete armor set

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

increase stats (temporally) when wearing complete armor set

Post by bongobeat »

Hi guys,

as i'm not a scripter (never) :D
Please can someone make me one, that give a champion some ability when he wears a complete armor set?

like that:
if champion wears: armor valor set (plate + greave + helmet + ...)
then champion gain (and only when complete armor set is wear - the bonus disappear if one of the element is removed)
strength +2
dexterity + 2

then play some sound and hubprint some text <--- but this only one time, exactly the first time when the champion wear all armor set

please, I really need this!
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: increase stats (temporally) when wearing complete armor

Post by Komag »

this is actually a concept I was maybe planning to implement in the next Master Quest update, but I haven't scripted anything for it yet
Finished Dungeons - complete mods to play
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: increase stats (temporally) when wearing complete armor

Post by bongobeat »

nice!
me <--- waiting for it :lol:
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: increase stats (temporally) when wearing complete armor

Post by JohnWordsworth »

I'm on my iPad at the moment so can't just bash out a script right now, but one clean way of doing this would be the following. Based on the fact that I try to put as much code as possible into script entities instead of in scripts.lua as it typically crashes less...

1. Create a script_entity called 'armour_scipt', you will want 3 functions in this script.

2a. applyFullSetBonus(champ) - A function that applies the bonuses you want to apply when the full set is worn.

2b. removeFullSetBonus(champ) - The inverse of 2a, to remove the bonuses from the full item set.

2c. onEquipUnequipCheck(champ) - This function will be called directly from the onEquipItem and onUnequipItem hooks from your object definitions. It should look for the item in each of the specific item slots on the champ to see if every piece of the armour is equipped. If yes, then check check a Boolean to see if it's already equipped, if not, set that value to true and call 2a. If no, then if the afore mentioned Boolean is true, call 2b and set the bool to false.

3. For every item that is a part of the set, you will need to add hooks in the defineObject call, and write a tiny onEquipItem hook and onUnequipItem hook that simply calls 2c. armour_script.onEquipUnequipItemCheck(champion);

If you literally just need a script and this sounds too complex, I will try to write one up for you tomorrow - but I would encourage that you give it a go so that you can learn to write your own scripts in the future!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: increase stats (temporally) when wearing complete armor

Post by bongobeat »

mhhh that sounds easy like that, but I expect some problem if I start to do something myself! :cry:
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
undeaddemon
Posts: 157
Joined: Fri Mar 02, 2012 3:38 pm

Re: increase stats (temporally) when wearing complete armor

Post by undeaddemon »

How does this come into play - in the game:

Code: Select all

defineObject{
armorSet = "valor",
}
User avatar
undeaddemon
Posts: 157
Joined: Fri Mar 02, 2012 3:38 pm

Re: increase stats (temporally) when wearing complete armor

Post by undeaddemon »

I also want to use something like this - using Pandafoxs' Black / Golden Armour -

;)
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: increase stats (temporally) when wearing complete armor

Post by bongobeat »

mhhh

never try, but.. dont think it's so easy for me!
please don't laugh :D

so if I read you:
this one in the editor:
SpoilerShow

Code: Select all

--script bonus_armor:

function onEquipUnequipCheck(champ)
  if partyHasItem("valor_ancient") and
     partyHasItem("helmet_kasrin") and
     partyHasItem("inquisitor_sword")
  then
    function applyFullSetBonus(champ)
  else
    removeFullSetBonus(champ)
  end

--
function removeFullSetBonus(champ)
-- ????
end
--
function applyFullSetBonus(champ)
	strength = 1,
	energy = 20,
	hudPrint("Congratulation, you have discover the full armor of valor set, you gain 1 strength and 20 energy")
	playSound("discover_spell")
end
end
and this one in the items.lua
SpoilerShow

Code: Select all

in items.lua

defineObject{
name = "valor_ancient",
armorSet = "extra",
bonus_armor.onEquipUnequipItemCheck(champion)
-- + all object definition etc…
}

defineObject{
name = "helmet_kasrin",
armorSet = "extra",
bonus_armor.onEquipUnequipItemCheck(champion)
-- + all object definition etc…
}

defineObject{
name = "inquisitor_sword",
armorSet = "extra",
bonus_armor.onEquipUnequipItemCheck(champion)
-- + all object definition etc…
}
can you be a little more precise pls? this looks like chinese for me, I m copying script from other script, that I konw how to do that, but to wrote a full new script?! :roll:

I dont know what to put in function removefullsetbonus

Code: Select all

function removeFullSetBonus(champ)
-- ????
end
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: increase stats (temporally) when wearing complete armor

Post by bongobeat »

undeaddemon wrote:I also want to use something like this - using Pandafoxs' Black / Golden Armour -

;)
well that was not the spirit too add effect particulary on this armor set, but I use the black armor too.
do you know something about 3d models monster? I m looking for someone who can do a new monster wich wears the black armor set (skeleton anything, dont care, I only want a monster looking as a black armor). I know i ask too much! ;)
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
undeaddemon
Posts: 157
Joined: Fri Mar 02, 2012 3:38 pm

Re: increase stats (temporally) when wearing complete armor

Post by undeaddemon »

bongobeat wrote:
undeaddemon wrote:I also want to use something like this - using Pandafoxs' Black / Golden Armour -
I m looking for someone who can do a new monster wich wears the black armor set (skeleton anything, dont care, I only want a monster looking as a black armor))
I think you are looking for this Genius -Leki -

viewtopic.php?f=14&t=5230&hilit=leki

:mrgreen:
Post Reply