Page 2 of 2

Re: Catchable tiny_rats

Posted: Sun Oct 26, 2014 10:00 pm
by NutJob
I like it crom, fun to see the interactivity develop.

Re: Catchable tiny_rats

Posted: Sun Oct 26, 2014 10:03 pm
by cromcrom
Glad you like it. It is not very elegant, but aww well... I LOVE interactivity, and to link it to skills. Everythings were interactive and linked to skills in The Lost Continent, and will be (bigger and better ^^) in the Lost Continent 2 :-)

Re: Catchable tiny_rats

Posted: Sun Oct 26, 2014 10:50 pm
by Dunkler
I like it too! i actually will use this in my mod if you dont mind..oh and i changed the script a littebit for my needs :)

Code: Select all

defineObject{
   name = "tiny_rat",
   baseObject = "tiny_rat",
   components = {
   {
      class="Clickable",
      onClick=function(self)
         local item = getMouseItem()
         if item then
            hudPrint("You can't catch a rat with an item in your hand!")
            return
         end
         self.go:destroy()
         setMouseItem(spawn('rat_swarm_shank').item)
         hudPrint("Not tasty but it serves it's purpose")
      end
   }
   }
}

Re: Catchable tiny_rats

Posted: Sun Oct 26, 2014 11:20 pm
by JKos
Of course anybody can use anything posted on these forums, and you can modify it as much as you like. I'm just glad you guys found this useful.

Re: Catchable tiny_rats

Posted: Mon Oct 27, 2014 12:55 am
by bitcpy
Well, if you know your way around a hex editor you can always dump the dat file there and type in an educated guess trying to find what you are looking for.
It can be quite tricky since what you will get won't be in plain text.

Anyways, i dropped the file in Frhed and made some queries and this seems to work.

Code: Select all

-- will return the 'base' stat without bonuses
party.party:getChampion(1):getBaseStat("dexterity")

-- will return and print the stat with all bonuses applied
party.party:getChampion(1):getCurrentStat("dexterity")
So, pretend base is 13, and character has Agile trait (+2 dex) and a pair of Rogue Boots on (+1 dex) then the current stat will say 16.

Edit: Wops, corrected some punctuation misstakes in the code block

Re: Catchable tiny_rats

Posted: Mon Oct 27, 2014 2:25 am
by NutJob
bitcpy wrote:Well, if you know your way around a hex editor you can always dump the dat file there and type in an educated guess trying to find what you are looking for.
It can be quite tricky since what you will get won't be in plain text.

Anyways, i dropped the file in Frhed and made some queries and this seems to work.

Code: Select all

-- will return the 'base' stat without bonuses
party.party:getChampion(1):getBaseStat("dexterity")

-- will return and print the stat with all bonuses applied
party.party:getChampion(1):getCurrentStat("dexterity")
So, pretend base is 13, and character has Agile trait (+2 dex) and a pair of Rogue Boots on (+1 dex) then the current stat will say 16.

Edit: Wops, corrected some punctuation misstakes in the code block

Thank you! Exactly what I needed [for days]! =)

Re: Catchable tiny_rats

Posted: Mon Oct 27, 2014 6:46 am
by cromcrom
Amazing, thanks a lot :-)

Re: Catchable tiny_rats

Posted: Mon Oct 27, 2014 9:57 am
by antti
I think you should be able to do this in a more "correct" manner by adding an item component on the monster. Or at least some point during development we did this to an ogre :lol:

Re: Catchable tiny_rats

Posted: Mon Oct 27, 2014 10:39 am
by cromcrom
Thanks Antti. I wish we could try that by ourselves, if you see what I mean :-). This has been a very loooong WE....

Re: Catchable tiny_rats

Posted: Tue Oct 23, 2018 8:18 am
by KhrougH
i'm using this script but i noticed that if i spawn these tiny rats on elevation 0 they recognize walls , but if i spawn them at an higher elevation than they falls to the ground but they walk through walls. i wonder why.