SphereCommunity
IFs possible in the text portion of a gump? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: IFs possible in the text portion of a gump? (/Thread-IFs-possible-in-the-text-portion-of-a-gump)

Pages: 1 2


RE: IFs possible in the text portion of a gump? - pointhz - 10-27-2015 08:31 AM

http://wiki.sphere.torfo.org/index.php/Main_Page

Just read the 10 tutorials. It takes a few hours but it helps a lot.

You'll never learn how to script until you read that.

You can't tell sphere to do something if you have totally no clue of how it works.


RE: IFs possible in the text portion of a gump? - Kanibal - 10-27-2015 08:32 AM

(10-27-2015 08:21 AM)x77x Wrote:  TAG.namez="xuchang"
TAG.namez="changan"
You can use STRMATCH
Code:
IF STRMATCH(<TAG.namez>,"xuchang")
    Dtext 90 150 <more> Xu Chang//brit-xuchang
ELIF STRMATCH(<TAG.namez>,"changan")
    Dtext 10 90 <more> Chang An//yew-changan
ELIF STRMATCH(<TAG.namez>,"luoyang")
    Dtext 150 120 <more> Luo Yang//cove-luoyang
...
ENDIF



RE: IFs possible in the text portion of a gump? - x77x - 10-27-2015 08:44 AM

then why cant i use UID!?

=)


RE: IFs possible in the text portion of a gump? - Kanibal - 10-27-2015 08:46 AM

(10-27-2015 08:44 AM)x77x Wrote:  then why cant i use UID!?

[Image: 9750923.jpg]


RE: IFs possible in the text portion of a gump? - pointhz - 10-27-2015 08:56 AM

LOOOOL

We need to go deeper. You must learn binary.


RE: IFs possible in the text portion of a gump? - x77x - 10-27-2015 08:58 AM

this works..

Code:
IF <uid>==040004100//<uid.040004100>
Dtext 90 150 <more> Xu Chang//brit-xuchang
ELIF <uid>==040004101//<uid.040004101>
Dtext 10 90 <more> Chang An//yew-changan
ELIF <uid>==040004102//<uid.040004102>
Dtext 150 120 <more> Luo Yang//cove-luoyang
ENDIF



RE: IFs possible in the text portion of a gump? - Ben - 10-28-2015 10:17 AM

wouldn't it be simpler to have the name stored in... hum... the NAME variable of the stone?
and have the position stored in tags.

then you do something like this

DTEXT <tag0.posx> <tag0.posy> <more> <name>

and you have none of this IF, ELSE, ELSEIF crap...

just a thought Smile