Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tag issue
Author Message
Nox
Apprentice
*

Posts: 4
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: Jan 2018
Reputation: 0



Post: #1
tag issue
Hi friends, i'm having a problem with my items scripts

right now, some of my items have this "type" variable that i'm using, so when you click the item the name displays like:

[xxx]
name of the item

so, for this, this items have this in the [itemdef]:
tag.type=xxx

then, i have this event to every player:
ON=@ItemAfterClick
if (<act.tag.type>)
act.message=[<act.tag.type>]
endif


the thing is that this worked fine for my test item... but now that i give the property "type" to a lot of items, i realized that it just works for my "first item" with the type tag

i was reading about the tag, tag0, and everything, but no combination works for me Sad please help

by the way, when I set a type "yyy" to other item, the console says:

Undefined symbol 'yyy' ['yyy)']
(This post was last modified: 02-01-2018 10:34 PM by Nox.)
02-01-2018 10:32 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #2
RE: tag issue
to understand sphere scripting you should always "resolve" the value to check if its valid

using an random example, if TAG.TYPE=grass, this script line
Code:
if (<act.tag.type>)
will be
Code:
if (grass)
which makes no sense

but if you replace (<act.tag.type>) with !(<isempty <act.tag.type>>) it will check if the tag is empty or not, which is probably what you trying to do: show the message if the tag is set
02-02-2018 02:43 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Nox
Apprentice
*

Posts: 4
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: Jan 2018
Reputation: 0



Post: #3
RE: tag issue
that was it! thank you very much Coruja Smile
02-02-2018 12:00 PM
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)