wuffel
Apprentice
Posts: 28
Likes Given: 0
Likes Received: 4 in 2 posts
Joined: Mar 2012
Reputation: 1
|
Enhanced .info for statics and map
Hi.
It was always a bit annoying to get the color of a static item. The Info-command delivers a few informations about map and statics, even there is the possibilty to get the color of a static item. It will deliver to much informations when two identical Statics (same ID and Z-Level) are on the same spot.
Code:
[function f_oncommand]
if !strcmpi(info,<strarg <args>>)
f_info
return 1
endif
[function f_info]
if <findid.i_info_target>
findid.i_info_target.remove
sysmessage @04ea Old target-cursor removed, try again.
return 1
endif
serv.newitem i_info_target
new.timer -1
equip <new>
[itemdef i_info_target]
ID=i_memory
name=Targettile for Info
TYPE=t_eq_script
layer=30
on=@equip
targetg @04ea Get the Target.
on=@TargOn_Ground
local.amount = <serv.map(<src.targp.x>,<src.targp.y>).statics>
if !<local.amount>
src.sysmessage [No static tile], Terrain=<serv.map(<src.targp.x>,<src.targp.y>).terrain>, Z=<serv.map(<src.targp.x>,<src.targp.y>).terrain.z>, TYPE=<serv.map(<src.targp.x>,<src.targp.y>).type>
remove
return 1
endif
for x 0 <local.amount>
if (<serv.map(<src.targp.x>,<src.targp.y>).statics.<local.x>.z> == <src.targp.z>) && (<argn1> == <serv.map(<src.targp.x>,<src.targp.y>).statics.<local.x>.id>)
src.sysmessage [Statics at Z=<src.targp.z>:
src.sysmessage <hval <argn1>>=<serv.itemdef.<argn1>.defname>-><serv.itemdef.<argn1>.type>-><serv.map(<src.targp.x>,<src.targp.y>).statics.<local.x>.color>]
src.sysmessage Terrain=<serv.map(<src.targp.x>,<src.targp.y>).terrain>, Z=<serv.map(<src.targp.x>,<src.targp.y>).terrain.z>, TYPE=<serv.map(<src.targp.x>,<src.targp.y>).type>
endif
endfor
remove
return 1
on=@TargOn_Item
src.act=<argo.uid>
src.info
src.last
remove
return 1
on=@TargOn_Char
src.act=<argo.uid>
src.info
src.last
remove
return 1
on=@TargOn_Cancel
remove
return 1
(This post was last modified: 04-08-2014 09:15 AM by wuffel.)
|
|
04-04-2014 02:07 AM |
|
The following 2 users Like wuffel's post:2 users Like wuffel's post
pinku (04-10-2014), XuN (04-04-2014)
|