A list of what hooks i've found.

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!
User avatar
Leki
Posts: 550
Joined: Wed Sep 12, 2012 3:49 pm

Re: A list of what hooks i've found.

Post by Leki »

Prozail wrote:@leki: Monsters actually doesn't have a separate HealthComponent, its handled in MonsterComponent
Sure, health is designed for obstacles. My idea was just to try to 'hack it' in that way...

In other words: mesh node is blocking, as it was in LoG1, but he will also get console errors with capsule, ingame errors with sounds, drop loot, imunities, exp, monster evasion... so in the end, he can rebuild Monster definition using LoG1 defs, run it in engine in some way, but it's pain atm... and finally, there is really not reason to rip out dat file, go through hashes (or use for it that nice blenders python script), find skeleton model and identify main meshName... :roll:
I'm the Gate I'm the Key.
Dawn of Lore
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: A list of what hooks i've found.

Post by NutJob »

What am I doing wrong or am I misinterpreting what the 'onArrival' hook does?

Code: Select all

defineObject {
   name = "teleporter_withSass",
   baseObject = "teleporter",
   components = {
      {
         class = "Portal",
         onArrival = function()
            print("No cake for you!")
         end
      }
   }
}
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: A list of what hooks i've found.

Post by Doridion »

Code: Select all

defineObject {
   name = "teleporter_withSass",
   baseObject = "teleporter",
   components = {
      {
         class = "Portal",
         onArrival = function(self,champion)
            print("No cake for you!")
         end
      }
   }
}
Not sure but.
NutJob
Posts: 426
Joined: Sun Oct 19, 2014 6:35 pm

Re: A list of what hooks i've found.

Post by NutJob »

Doridion wrote:

Code: Select all

defineObject {
   name = "teleporter_withSass",
   baseObject = "teleporter",
   components = {
      {
         class = "Portal",
         onArrival = function(self,champion)
            print("No cake for you!")
         end
      }
   }
}
Not sure but.
Hey! Don't call me a Butt! ~laughs~
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: A list of what hooks i've found.

Post by Doridion »

:p

I thought the function(self,champion) 'cause it's currently used in the item definitions.

And no butt there, we're professionnals :lol:
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: A list of what hooks i've found.

Post by Prozail »

I Think the PortalComponent might be special.. It's blank in the script-reference atm, and it is only used in the "portal" game object.
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: A list of what hooks i've found.

Post by MrChoke »

NutJob wrote:What am I doing wrong or am I misinterpreting what the 'onArrival' hook does?

Code: Select all

defineObject {
   name = "teleporter_withSass",
   baseObject = "teleporter",
   components = {
      {
         class = "Portal",
         onArrival = function()
            print("No cake for you!")
         end
      }
   }
}
I don't think there is any hook for use of teleporter or exits. I have tried to find them and cannot. Prozail's list doesn't support their existence either. You can always put a floor trigger in on the spot before or after the teleport to capture what you want. Not as good as having hooks for them though.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: A list of what hooks i've found.

Post by akroma222 »

Hey guys,
Hopefully this is an appropriate place to ask this question... Im having a bit of trouble doing something very simple :oops:

I have an item assassin dagger that has an onEquipItem hook that calls a script in the dungeon

Code: Select all

onEquipItem = function(champion, slot)
	return itemEquipScript.script.assassinDaggerEquip(champion, slot)
end
The function goes like this...

Code: Select all

function assassinDaggerEquip(champion, slot)
	hudPrint("Rogue class - Critical skill increases by 1 level.")
end
This works fine, but as soon as I start saying things like
local champ = party.party:getChampionByOrdinal(champion) or
local name = champion:getName()

the editor will crash... complaining about not being able to find the class n such...
Really not sure what I am doing wrong - have the parameters for onEquipItem changed?
Or am I not understanding the component system correctly?
Please Help!!
swampie
Posts: 9
Joined: Sun Nov 02, 2014 1:12 am

Re: A list of what hooks i've found.

Post by swampie »

@Akroma not sure, couldn't test it yet, BUT the reference says "onEquipItem(self, champion, slot)"... Maybe if you add a first parameter it works?
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: A list of what hooks i've found.

Post by Prozail »

swampie wrote:@Akroma not sure, couldn't test it yet, BUT the reference says "onEquipItem(self, champion, slot)"... Maybe if you add a first parameter it works?
basically what swampie said.

onEquipItem = function(self, champion, slot)
hudPrint("Rogue class - Critical skill increases by 1 level.")
end

also, try to have your itemdefinitions not rely on external scripts, makes them easier to cherrypick.
Last edited by Prozail on Tue Nov 04, 2014 11:08 am, edited 1 time in total.
Post Reply