Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
@ItemDropOn_Ground region check
Author Message
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #1
@ItemDropOn_Ground region check
Hello.

ON=@ItemDropOn_Ground
When player drop the item, coordinates of player: <P>
the coordinates of the object that had been dropped: <ARGS>

How to set check, what region flag was set in tile, where drop was dropped?

As example this check not work:
IF !(<REGION.<ARGS>.FLAGS> & REGION_FLAG_NODECAY)

Sphere 56b.
(This post was last modified: 02-03-2017 09:36 PM by Russian.)
02-03-2017 09:36 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: @ItemDropOn_Ground region check
Try to use serv.map(x,y,z), see http://wiki.sphere.torfo.org/index.php?title=Map_Points
Example:
PHP Code:
ON=@ItemDropOn_Ground
local
.= <argv[0]>
local.= <argv[1]>
local.= <argv[2]>
local.= <argv[3]>
serv.log  Item was dropped in <serv.map(<dlocal.x>,<dlocal.y>,<dlocal.z>,<dlocal.m>).region.name
02-03-2017 10:35 PM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #3
RE: @ItemDropOn_Ground region check
You are fantastic wizard!

Code:
ON=@ItemDropOn_Ground
IF !(<ISGM>)
    IF (<ACT.CAN> & CAN_I_BLOCK)
        IF (<REGION.FLAGS> & REGION_FLAG_NODECAY) || (<ROOM.FLAGS> & REGION_FLAG_NODECAY)
        LOCAL.X=<ARGV[0]>
        LOCAL.Y=<ARGV[1]>
        LOCAL.Z=<ARGV[2]>
        LOCAL.M=<ARGV[3]>
        SERV.log Item was dropped in <SERV.MAP(<DLOCAL.X>,<DLOCAL.Y>,<DLOCAL.Z>,<DLOCAL.M>).REGION.FLAGS>
            IF !(<SERV.MAP(<DLOCAL.X>,<DLOCAL.Y>,<DLOCAL.Z>,<DLOCAL.M>).REGION.FLAGS> & REGION_FLAG_NODECAY)
            SYSMESSAGE @0486 It is possible to establish this subject only in the house.
            ACT.CONT=<FINDLAYER.21.UID>
            ENDIF
        ENDIF
    ENDIF
ENDIF

This fix can help with bug:

[Image: 70424272989693807298.png]
(This post was last modified: 02-04-2017 01:25 AM by Russian.)
02-04-2017 01:25 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Russian's post
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: @ItemDropOn_Ground region check
Just discovered that script above will not work in Sphere 56c/d version.

From a 2015 change:

Changed: Trigger @DropOn_Ground / @ItemDropOn_Ground now is fired when the item is already on the ground instead get fired before place it on ground. So there's no more ARGS showing the drop location P (use <ACT.P> instead) and also 'return 1' will disable drop sound and decay timer.
02-04-2017 02:10 AM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #5
RE: @ItemDropOn_Ground region check
That is good change.
But my shard on Sphere 56b 2012, And it is impossible to transfer shard to 56c.
02-06-2017 03:55 PM
Find all posts by this user Like Post Quote this message in a reply
Russian
Journeyman
*

Posts: 75
Likes Given: 4
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 0



Post: #6
RE: @ItemDropOn_Ground region check
ERRROR:
17:26:ERROR:(e_startx.scp,197)Can't resolve <SERV.MAP(5794>

197 stroke:
IF (<SERV.MAP(<ARGV[0]>,<ARGV[1]>).REGION.FLAGS> & REGION_FLAG_NODECAY) || (<SERV.MAP(<ARGV[0]>,<ARGV[1]>).ROOM.FLAGS> & REGION_FLAG_NODECAY)
What is wrong?
01-23-2018 01:22 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)