ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: NObama on July 17, 2010, 09:51:38 PM

Title: Learning 'tile' commands
Post by: NObama on July 17, 2010, 09:51:38 PM
Alright.  I just want a simple script that scans the tile I'm standing on and displays the #tilename...but it's late and I've been drinking...

Code: [Select]
Tile init
tile get #charposx #charposy %tilekind
display ok #tilename $
halt

Naturally, this returns N/A... *bog*
Title: Re: Learning 'tile' commands
Post by: manwinc on July 17, 2010, 10:59:19 PM
Tile Init
Tile Cnt #charposx #charposy
for %Tilekind 1 #tilecnt
{
Tile Get #charposx #charposy %Tilekind
Display #Tilename
}
halt


Maybe? I dunno I always had a hard time with tiles.
Title: Re: Learning 'tile' commands
Post by: NObama on July 17, 2010, 11:14:17 PM
I've tricked you!  While you were putting together this helpful tutorial, I stole subs from your miner and frankensteined them into XXII's script.  MUAHAHAHA.

(Seriously, though - thanks for trying to help.  Not sure it helps me understand yet, but I'll get there.)
Title: Re: Learning 'tile' commands
Post by: 12TimesOver on July 18, 2010, 02:42:40 AM
When you do your tile get you need to specify which layer.

Here's a sub out of the "XIIxOveR's Super Stuff" script:

Code: [Select]
sub TileStuff
   set %x #charposx
   set %y #charposy

   tile init
   tile cnt %x %y

   for %tcnt 1 #tilecnt
      {
      tile get %x %y %tcnt
      display Tile Information: , %x , x , %y , x , #tilez , #spc , Layer: , %tcnt , #spc , Type: , #Tiletype , #spc , Name: , #tilename , #spc , Kind: , #ltargetkind
      }
   }
return

One of the things you have to keep in mind about tiles is that they come in layers, that is the reason for MW's and my use of "tile cnt" and the for statements with #tilecnt. This will cycle through each layer of the tile and give the information for all of the layers, not just one.

Hope this helps m8.

X