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
Finding out what tile your standing on

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

Author Message
Poi



Joined: 14 Apr 2006
Posts: 240

PostPosted: Thu Jan 24, 2008 7:01 pm    Post subject: Finding out what tile your standing on Reply with quote

I am making a script that requires you to be on a specific tile, so that if it is the correct tile they are allowed to do this specific action, any ideas how to do this?




Also how do I(when they double click a deed I want it to ask them for text input) how would I do this?

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 523

PostPosted: Thu Jan 24, 2008 10:23 pm    Post subject: Reply with quote

Depends on whether you are looking for a static item or a map tile.
I assume you mean a map tile.
Take a look at this piece of code after you have set a location (eg with Targetcoordinates):
Code:
var info := GetMapInfo(mining_loc.x , mining_loc.y, mining_loc.realm);
if ( IsSwampTile(info.landtile) )
// code for having selected a swamp tile
endif

function IsSwampTile(theobjtype)
   if ( theobjtype >= 0x3d65 and theobjtype <= 0x3ef0 )
      return 1;
   elseif ( theobjtype >= 0x3209 and theobjtype <= 0x324a )
      return 1;
   else
      return 0;
   endif
endfunction

Author Message
Poi



Joined: 14 Apr 2006
Posts: 240

PostPosted: Thu Jan 24, 2008 11:08 pm    Post subject: Reply with quote

OldnGrey wrote:
Depends on whether you are looking for a static item or a map tile.
I assume you mean a map tile.
Take a look at this piece of code after you have set a location (eg with Targetcoordinates):
Code:
var info := GetMapInfo(mining_loc.x , mining_loc.y, mining_loc.realm);
if ( IsSwampTile(info.landtile) )
// code for having selected a swamp tile
endif

function IsSwampTile(theobjtype)
   if ( theobjtype >= 0x3d65 and theobjtype <= 0x3ef0 )
      return 1;
   elseif ( theobjtype >= 0x3209 and theobjtype <= 0x324a )
      return 1;
   else
      return 0;
   endif
endfunction



Actually I mean a static item

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 523

PostPosted: Thu Jan 24, 2008 11:40 pm    Post subject: Reply with quote

Have you tried using the ListStaticsAtLocation function?

Assuming you are character, and because there can be more than 1 item on your square, you can do something like:

Code:
foreach static in ListStaticsAtLocation(character.x, character.y, character.z, ITEMS_IGNORE_MULTIS, character.realm)
 var value := static.objtype
 if ( static.z == character.z )
// this is a tile the player is on at the same height ......... do stuff
 endif
endforeach

Author Message
Poi



Joined: 14 Apr 2006
Posts: 240

PostPosted: Thu Jan 24, 2008 11:54 pm    Post subject: Reply with quote

Nevermind got it

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