Catchable tiny_rats

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!
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Catchable tiny_rats

Post by NutJob »

I like it crom, fun to see the interactivity develop.
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Catchable tiny_rats

Post 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 :-)
A trip of a thousand leagues starts with a step.
Dunkler
Posts: 73
Joined: Thu Jul 10, 2014 3:20 pm

Re: Catchable tiny_rats

Post 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
   }
   }
}
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Catchable tiny_rats

Post 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.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
bitcpy
Posts: 39
Joined: Tue Apr 24, 2012 7:43 pm

Re: Catchable tiny_rats

Post 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
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: Catchable tiny_rats

Post 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]! =)
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Catchable tiny_rats

Post by cromcrom »

Amazing, thanks a lot :-)
A trip of a thousand leagues starts with a step.
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Catchable tiny_rats

Post 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:
Steven Seagal of gaming industry
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Catchable tiny_rats

Post 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....
A trip of a thousand leagues starts with a step.
User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

Re: Catchable tiny_rats

Post 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.
[...]
All those moments will be lost in time, like tears in rain.
Time to die.
Post Reply