Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : Text var comparison not working with interpolated operand
New Topic New Poll Post Reply
Poster Message
12th Archivist
Level: Smitemaster
Avatar
Rank Points: 789
Registered: 12-07-2008
IP: Logged
icon Text var comparison not working with interpolated operand (0)  
I guess I don't quite understand how text variables work. This is my script:
  Set var "first" : hi
  Set var "second" : ho
  If ... 
        Wait until var "first" = second
     Speech ""first" and "second" DO match",Normal,Self,0,.
  Else 
     Speech ""first" and "second" DO NOT match",Normal,Self,0,.

What I'm getting from this is that the variable "first" contains the string "hi", and the variable "second" contains the string "ho". The two variables store different strings of information. However, running this script indicates that "first" and "second" in fact do match. Is this a bug? What am I missing here?

____________________________
It was going well until it exploded.
~Scott Manley

Check out the DROD Wikia project here!

[Last edited by mrimer at 01-06-2016 02:10 PM]
02-19-2014 at 04:53 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4590
Registered: 02-20-2007
IP: Logged
icon Re: How does text work? (+3)  
When entering the command "Wait until var", under the "Equals" option is "Equals text". Select this, and type the text you want to check against in the upper box. To check against the contents of another variable, enclose its name in $ signs: "$second$".

____________________________
50th Skywatcher
02-19-2014 at 05:57 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
12th Archivist
Level: Smitemaster
Avatar
Rank Points: 789
Registered: 12-07-2008
IP: Logged
icon Re: How does text work? (0)  
Nuntar wrote:
When entering the command "Wait until var", under the "Equals" option is "Equals text". Select this, and type the text you want to check against in the upper box. To check against the contents of another variable, enclose its name in $ signs: "$second$".
I tried that, but it actually didn't seem to work. This is my code.
  Set var "first" : hi
  Set var "second" : hi
  If ... 
        Wait until var "first" : $second$
     Speech ""first" and "second" DO match",Normal,Self,0,.
  Else 
     Speech ""first" and "second" DO NOT match",Normal,Self,0,.
When I run this script, I find that "first" and "second" DO NOT match, even though now they should. Again, am I just inputting this incorrectly?

____________________________
It was going well until it exploded.
~Scott Manley

Check out the DROD Wikia project here!
02-20-2014 at 03:21 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Nuntar
Level: Smitemaster
Avatar
Rank Points: 4590
Registered: 02-20-2007
IP: Logged
icon Re: How does text work? (0)  
:? When I replace "$second$" with "hi" in your script, I get that they do match. And enclosing the variable name between $ signs is the right way to call on its value, for instance in Speech commands. I can only guess that DROD:RPG currently doesn't support checking the text of one variable against the text of another.

____________________________
50th Skywatcher

[Last edited by Nuntar at 02-20-2014 06:02 PM]
02-20-2014 at 05:37 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: How does text work? (0)  
I'm investigating this issue, and by the code it seems that DROD 5.x doesn't currently support this comparison either, but it should. Can someone confirm this doesn't work in DROD 5.x either?

Edit: Fixed for RPG in rev 87.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 01-06-2016 02:09 PM]
01-06-2016 at 02:06 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2670
Registered: 07-11-2014
IP: Logged
icon Re: Text var comparison not working with interpolated operand (+1)  
I can confirm that this does NOT work in regular DROD 5.1.0.1007.

It does work in RPG Steam beta 1.2.3.89 :thumbsup
01-06-2016 at 09:08 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Text var comparison not working with interpolated operand (0)  
kieranmillar wrote:
I can confirm that this does NOT work in regular DROD 5.1.0.1007.

It does work in RPG Steam beta 1.2.3.89 :thumbsup
Thanks! Okay, I'll have it fixed for 5.1 also.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
01-06-2016 at 11:01 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Bugs : Text var comparison not working with interpolated operand
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.