Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : A tricky bug with variables (Remembers former constant)
New Topic New Poll Post Reply
Poster Message
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged

File: BugShow.drh (1.1 KB)
Downloaded 42 times.
License: Public Domain
icon A tricky bug with variables (+2)  
That's really tricky bug. I wasted around hour or two to find out what is wrong.

Basically, you can download the hold and see, that when adding _MyATK (=5) to aa (=0) we get 1.
How?

Well, to reproduce it create one variable, let's call it X, and set it to 0. Then set _MyATK to 5. After that, write such code:
Set var X + 1
Then double click this code, and change 1 into _MyATK. Playtest and you will see, that X will be 1, not 5.
So to put it simply, Set Var command remembers former constant if there was any, and uses it instead of the non-constant.

____________________________
My website | Facebook | Twitter
09-21-2008 at 07:06 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5064
Registered: 02-04-2003
IP: Logged
icon Re: A tricky bug with variables (0)  
skell wrote:
That's really tricky bug. I wasted around hour or two to find out what is wrong.
...
to put it simply, Set Var command remembers former constant if there was any, and uses it instead of the non-constant.
Sorry you wasted so much time working on this. Your conclusion is correct. I've fixed this in the next patch so the former numeric value isn't preserved "under the hood" when you change a script command to use an operand with a variable/expression.

____________________________
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 10-13-2008 02:28 AM]
10-13-2008 at 02:28 AM
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 : A tricky bug with variables (Remembers former constant)
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.