PenUltima Online

It is currently Fri Sep 05, 2008 1:55 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: hooking GetWorldHeight
PostPosted: Wed Sep 27, 2006 4:07 am 
Offline
User avatar

Joined: Fri Feb 03, 2006 2:25 am
Posts: 56
Location: Germany, Franconia
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 :)

Thanks in advance.

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

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 27, 2006 9:16 am 
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.


Top
  
 
 Post subject:
PostPosted: Wed Sep 27, 2006 9:59 am 
Offline

Joined: Wed Aug 30, 2006 5:24 pm
Posts: 82
Location: Italy
But you can't simply use your own function instead GetWorldHeight ?

_________________
Admin/Scripter Innominabile
ZuluHotelItalia shard on m4d


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 28, 2006 3:00 am 
Offline
POL Developer
User avatar

Joined: Wed Jan 25, 2006 2:30 am
Posts: 406
Location: San Diego, California
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.

_________________
-Austin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 28, 2006 3:58 am 
Offline
User avatar

Joined: Fri Feb 03, 2006 2:25 am
Posts: 56
Location: Germany, Franconia
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

_________________
Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 25, 2006 1:38 pm 
Offline
POL Core Developer

Joined: Mon Jan 30, 2006 9:28 am
Posts: 292
Location: Germany, Bavaria
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl