PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
hooking GetWorldHeight

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help 096
Display posts from previous:   

Author Message
Bytehawk



Joined: 03 Feb 2006
Posts: 56
Location: Germany, Franconia

PostPosted: Wed Sep 27, 2006 8:07 am    Post subject: hooking GetWorldHeight Reply with quote

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:
--- 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 Smile

Thanks in advance.

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

Author Message
Marilla



Joined: 02 Feb 2006
Posts: 329

PostPosted: Wed Sep 27, 2006 1:16 pm    Post subject: Reply with quote

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.

Author Message
innominabile



Joined: 30 Aug 2006
Posts: 81
Location: Italy

PostPosted: Wed Sep 27, 2006 1:59 pm    Post subject: Reply with quote

But you can't simply use your own function instead GetWorldHeight ?

Author Message
Austin
POL Developer


Joined: 30 Jan 2006
Posts: 354
Location: San Diego, California

PostPosted: Thu Sep 28, 2006 7:00 am    Post subject: Reply with quote

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.

Author Message
Bytehawk



Joined: 03 Feb 2006
Posts: 56
Location: Germany, Franconia

PostPosted: Thu Sep 28, 2006 7:58 am    Post subject: Reply with quote

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 Smile

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

Author Message
Shinigami
POL Core Developer


Joined: 30 Jan 2006
Posts: 292
Location: Germany, Bavaria

PostPosted: Sat Nov 25, 2006 5:38 pm    Post subject: Reply with quote

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 new topic   Reply to topic    PenUltima Online Forum Index -> General Help 096 All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty