Finding out what tile your standing on

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
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Finding out what tile your standing on

Post by Poi »

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?
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

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: Select all

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
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

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: Select all

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
User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Post by OldnGrey »

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: Select all

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
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

Nevermind got it
Post Reply