Menu
Login
Language
DE EN FR ES IT CZ
Back

How do i unregister a hook function

  • #10, by andiliddell Sunday, 16. February 2014, 21:30 12 years ago Quote
    Thanks for the info Very helpful indeed.

    Back on the original topic of hookfunctions, even once the hook-active condition is false, does the hook function still override the default text position function?

    Its just once that condition is changed to false, it starts lining the text up at 0,0 in the top left of the screen as if the hook function means the default behaviour is never ran?

    Forum Fan

    178 Posts

  • #11, by afrlme Sunday, 16. February 2014, 22:23 12 years ago Quote
    hmm you mean it's reposition text to the top left instead of back above the characters heads?

    it might be because we wrapped the query condition around the main part of the function instead of the return part as well.

    if what I mentioned is the case then try this instead...
    function setTextPosHook(text)
    if getObject("Conditions[hook_active]"):getBool(VConditionValue) then
     if text:getLink(VTextOwner):getId().tableId == eCharacters then
      if text:getLink(VTextOwner):getName() == "chicken" and game:getLink(VGameCurrentScene):getName() == "03_inside hut" then
        text:setValue(VTextPosition, {x= game:getPoint(VGameWindowResolution).x/2, y=500})
       end
      end
      return true
     end
    end
    
    registerHookFunction("setTextPosition", "setTextPosHook")
    

    Imperator

    7290 Posts

  • #12, by andiliddell Sunday, 16. February 2014, 22:35 12 years ago Quote
    That's got it! cheers AFRLme.

    Forum Fan

    178 Posts

  • #13, by afrlme Monday, 17. February 2014, 00:35 12 years ago Quote
    no problem wink

    Imperator

    7290 Posts