hooking GetWorldHeight

Here you can post threads requesting help on the official POL Ultima Online Emulator Core 096.
Note: Core 096 is no longer officially supported.
Post Reply
Bytehawk
Apprentice Poster
Posts: 56
Joined: Fri Feb 03, 2006 2:25 am

hooking GetWorldHeight

Post by Bytehawk »

Since GetWorldHeight is giving back the highest, not the lowest z coordinate you can stand at, as it should, I wanted to hook GetWorldHeight and calculate the correct coordinate using GetStandingLayers (x, y)[1].z

This is what I tried:

Code: Select all

--- syshook.cfg ---------
SystemHookScript worldHeight.ecl
{
  GetWorldHeight gwh
}

--- worldHeight.src ---------
program worldHeight()
  return 1;
endprogram

exported function gwh(x, y, realm:= _DEFAULT_REALM)
  return GetStandingLayers (x, y, MAPDATA_FLAG_ALL, realm)[1].z;
endfunction
But this gives only a "Unknown SystemHook GetWorldHeight"

I know, I could replace any ocurrance of "GetWorldHeight" in all scripts with "GetStandingLayers (x, y)[1].z" but if anyone could help me with creating that hook or telling me, what I - again - made wrong so that GetWorldHeight isn't working, I'd prefer that :)

Thanks in advance.

PS: Where can I find out, for what functions SytemHooks exist?
Marilla

Post by Marilla »

Unless something happened of which I am not aware, there is no such system hook.

The valid system hooks can be found in the documentation. Specifically, in the config file reference under the syshook.cfg entry. The valid entries for 096 are: CheckSkill, OpenSpellbook, GetBookPage, CombatAdvancement, ParryAdvancement, Attack, Pushthrough, SpeechMul. 095 is the same, but without SpeechMul.
innominabile
Adept Poster
Posts: 85
Joined: Wed Aug 30, 2006 5:24 pm

Post by innominabile »

But you can't simply use your own function instead GetWorldHeight ?
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

Theres no hook for that function..
As noted by Marilla, the poldoc website has a list of what can be hooked.

http://poldoc.fem.tu-ilmenau.de/

Easiest way to get the first standing position would be to use the function

GetStandingHeight( x, y, startz, realm := _DEFAULT_REALM )

and read its .z member.
Bytehawk
Apprentice Poster
Posts: 56
Joined: Fri Feb 03, 2006 2:25 am

Post by Bytehawk »

So I didn't screw it up and GetWorldHeight is in fact not working the way it used to? Phew... *looks relieved* I almost didn't dare to ask anything more here, after my last few ridiculous posts :)

Thanks for you answers, I'll give GetStandingHeight a chance.

edit:
Uhm.. when I'm standing under... kind of a balcony, GetStandingHeight gives back an error: "Can't stand there"
*sigh* Okay, gonna use GetStandingLayers()[1].z
Shinigami
Former Developer
Posts: 308
Joined: Mon Jan 30, 2006 9:28 am

Post by Shinigami »

Bytehawk wrote:So I didn't screw it up and GetWorldHeight is in fact not working the way it used to?
depends on how you read the documentation. the external documentatione (you can find on website) is not complete in this point. internal documentation (in source code) says, it's the lowest standing height on top of map and all statics. and this is how it works internally...

Shinigami
Post Reply