Page 2 of 3

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

Posted: Mon Nov 03, 2014 2:03 am
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:

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

Posted: Mon Nov 03, 2014 2:54 am
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
      }
   }
}

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

Posted: Mon Nov 03, 2014 3:02 am
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.

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

Posted: Mon Nov 03, 2014 3:03 am
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~

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

Posted: Mon Nov 03, 2014 3:08 am
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:

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

Posted: Mon Nov 03, 2014 7:55 am
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.

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

Posted: Mon Nov 03, 2014 2:31 pm
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.

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

Posted: Tue Nov 04, 2014 8:15 am
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!!

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

Posted: Tue Nov 04, 2014 10:28 am
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?

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

Posted: Tue Nov 04, 2014 11:07 am
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.