SphereCommunity
MAP.Z - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: MAP.Z (/Thread-MAP-Z)

Pages: 1 2


MAP.Z - xwerswoodx - 07-21-2013 01:50 AM

How can I check items on map where is Z ise 1 or more

For example at house I want to check IF <serv.map(X,Y,20).region.terrain> etc.

Second question, how can I check the items which is on the coordinate, example, at 10,10,0 position I want to check how many items are there and what are their UIDs, Ps, IDs, BASEIDs etc...

And lastly I want to do second question for static without uid (if it is possible)


RE: MAP.Z - Rattlehead - 07-21-2013 04:36 AM

well first of all, you wouldnt check the region for Z as regions dont have a Z, they embody the entire Z plane both positive and negative, what you would check for is the items Z, so you should use a foritems and check to see if their Z is raised 1

also with the foritems loop you can reference all their attributes

http://wiki.sphere.torfo.org/index.php/Chapter_7#FORITEMS

as for static objects, im really not sure, tbh im not sure why anyone would need to, maybe share with us what u are trying to do and if i cant give you a solution im sure dark or someone else could


RE: MAP.Z - xwerswoodx - 07-21-2013 06:31 AM

Firstly yes I didn't find anything about Z.

But I don't want to use foritems, for example on fishing sphere place world gem where is your target and check resource on it. I want something like it because I don't know where is it uid saved or not. I can do samething with this but sometimes I want to use placed object with other fishing poles so I don't want to use foritems and I am not sue whether we use foritems with target or not.

Lastly I want it for teleport. Because teleport can use some wall in the game and they go to roof. I want to check if his target's X,Y,Z has wall fizzle. Hovewer, if I check without Z I can't check the wall because game saw the item which is on X,Y,0.


RE: MAP.Z - Gil Amarth - 07-21-2013 06:40 AM

Recently I had used something similar for my scripts.

With: SERV.MAP(X,Y).STATICS, you can access the statics in one tile of the map.

FOR X 0 <EVAL <SERV.MAP(<REF1.P.X>,<REF1.P.Y>).STATICS> - 1>
LOCAL.HEIGHT = <SERV.MAP(<REF1.P.X>,<REF1.P.Y>).STATICS.<dLOCAL.X>.Z>
SERV.LOG <dLOCAL.HEIGHT>
ENDFOR

You can access in a loop, to every statics at one tile, check the value or type you want, and store the maximum value or anything you want.


RE: MAP.Z - Rattlehead - 07-21-2013 06:54 AM

im not sure i understand what u are trying to do tbh

but i thought u were talking about checking the entire map, now i think u are talking about targeting a place on the ground or on an item?

http://wiki.sphere.torfo.org/index.php/@ItemTargOn_Ground
http://wiki.sphere.torfo.org/index.php/@ItemTargOn_Item

must go on an events on ur player, those links tell you how to access P (px, py, and pz)

if i am misunderstanding what you are trying to do please correct me


RE: MAP.Z - xwerswoodx - 07-21-2013 07:52 AM

@Gil Amarth
Thanks very much I will try it

@Rattlehead
He understand what I mean but I try to explain. First of all, thank you very much for trying to help. Secondly, I want to fix teleporting from ground to roof. But if I don't check items height I can't control it. He gives it.

And lastly can I check the items on ground, which is created by fishing or mining?

For example when I use fishing pole, world gem bit created on water, and after I use fishing pole it takes information from it. And I want to check it without foritems.


RE: MAP.Z - Mordaunt - 07-21-2013 08:52 AM

For fixing teleport from ground to roof...
There shouldn't be any LoS for that so it shouldn't allow it anyway.
If you are having a problem with that I'd perhaps suggest creating an invisible item (coin, gembit) at the location the player clicked and check the Z of that item.

For checking items on the ground...
Are you looking at making your own fishing/mining system?

I'd suggest you go take a look at RanXerox's Lumberjacking which looks to see what is in the location the player has selected to create wood of the correct type. A principal you should easily be able to adapt to fishing/mining.


RE: MAP.Z - Rattlehead - 07-21-2013 10:02 AM

sorry man, im trying to help you, if you specifically want to get info from a gem bit

http://wiki.sphere.torfo.org/index.php/@RegionResourceFound

unless you were just using the gem bit as an example.


RE: MAP.Z - xwerswoodx - 07-21-2013 02:00 PM

(07-21-2013 08:52 AM)Mordaunt Wrote:  For fixing teleport from ground to roof...
There shouldn't be any LoS for that so it shouldn't allow it anyway.
If you are having a problem with that I'd perhaps suggest creating an invisible item (coin, gembit) at the location the player clicked and check the Z of that item.

For checking items on the ground...
Are you looking at making your own fishing/mining system?

I'd suggest you go take a look at RanXerox's Lumberjacking which looks to see what is in the location the player has selected to create wood of the correct type. A principal you should easily be able to adapt to fishing/mining.

(07-21-2013 10:02 AM)Rattlehead Wrote:  sorry man, im trying to help you, if you specifically want to get info from a gem bit

http://wiki.sphere.torfo.org/index.php/@RegionResourceFound

unless you were just using the gem bit as an example.

Not totally, I know his lumberjacking system but I can do like it. But fishing is only the example, I wanted to learn how they check the world gem bit when he use pole second time or anyone else use fishing pole same position. This is the question, how is know it's more Smile

And I have been using sphere coding since 55i. And I know many things but sometimes I want to do something in easy way. For example I can do new fishing system with or without use regiontype or regionresource but I want to do it more easy, like when I use fishing pole I want to check items at that position.

I am not sure explain clearly, but only I want to know how can I check items on some position without create item. Smile


RE: MAP.Z - RanXerox - 07-22-2013 01:56 AM

Z indicates the bottom (or ground position) of an item and Z+HEIGHT indicates the top of that item.

For things like teleport you normally go to the Z position of the item (or static) that was targeted (assuming it is not flagged impassable)... but if that item can be walked on (typically flagged as a surface, stair, or bridge), then it puts you on top of the item.

I suspect there are other flag(s) in the tile data that indicate whether an item can have stuff stacked on top of it.

When stuff is dropped, I think it automatically gets a "fix" (essentially z=z+1) so that it doesn't fall out of sight.