Dialogues: I must have overseen something ... (1 Viewer)

Rudgar

Content Creator
Joined
Nov 18, 2016
Ahoy!
I'm close to desperation for I don'T understand a little something.
In a dialogue I have - beside other stuff - an object variable "Story.Version" which I initialize with the string value "1.0".
Well, I tried at least to initialize it with that value. When I try to display it, it only shows "0".

I tried some different version number strings - with the same result. Only if I initialize the onject variable with a string like "Version1" it gives me exactly this string.

Any idea why?
What did I oversee? Soemthing that has to do with type conversion maybe?

Kind regards,
Me
 

Attachments

  • pretest0.jpg
    pretest0.jpg
    46.5 KB · Views: 85
  • pretest1.jpg
    pretest1.jpg
    47.6 KB · Views: 70
pretest0.txt
885 bytes · Views: 80

pretest1.txt
890 bytes · Views: 106

Pim_gd

Content Creator
Joined
Jan 25, 2013
Maybe DialogueChecker knows?

Dialogue was checked in 3 ms with v3.07 of the DialogueChecker.
I found 1 issue(s) with your dialogue, of which 0 were severe, 1 were major issues, and 0 were minor issues.

Syntax - Major: Wrong format for numeric value (1.0) of attribute ("Story.Version") for initial_settings on line 30.
SDT will ignore numeric values placed in strings.
Line 30: initial_settings:{"Story.Title":"The Slaver", "Story.Version":"1.0", "Player.hasCock":1, "Player.Gender":"m", "Player.n.toolname":"dildo", "Player.y.toolname":"cock", "Player.m.name":"Rudgar", "Player.f.name":"Ramona"}

Once you've fixed these issues, try letting me look your dialogue over again. Maybe I'll find something new.

Syntax - Major: Wrong format for numeric value (1.0) of attribute ("Story.Version") for initial_settings on line 30.
SDT will ignore numeric values placed in strings.

So, what's going on here is that, when you have a number in a string, SDT parses it as a modifier. This is how "set":{"variable":"+1"} and "set":{"variable":"-1"} works.

If the variable has no previous value, SDT will apply this value to 0. That is, 0 + 1 = 1, 0 - 1 = -1.

But to do this, it checks for two things.
First it checks if the string makes for a valid AS3 Number.
If so, it will apply this to the current value. The way it will apply it to the current value depends on the first character of the value. That's the second thing that's checked for.
If it's a minus sign, subtraction will occur. If it's plus sign, addition will occur. If neither is present, it will do nothing.

Thus, you have three options:

Option 1 is to add a plus sign in front of the number. E.g. "Story.Version":"+1.0"
Option 2 is to put the value is single quotes, e.g. "Story.Version":"'1.0'" (That is " ' 1.0 ' " but without spaces)
Option 3 is to treat the version as numeric, e.g. "Story.Version":1.0
Keep in mind that for option 1 and 3, 1.1 and 1.10 are the same.
 

Rudgar

Content Creator
Joined
Nov 18, 2016
Maybe DialogueChecker knows?
Smartass! :tongue::wink:
[...]
Syntax - Major: Wrong format for numeric value (1.0) of attribute ("Story.Version") for initial_settings on line 30.
SDT will ignore numeric values placed in strings.

So, what's going on here is that, when you have a number in a string, SDT parses it as a modifier. This is how "set":{"variable":"+1"} and "set":{"variable":"-1"} works.

If the variable has no previous value, SDT will apply this value to 0. That is, 0 + 1 = 1, 0 - 1 = -1.

But to do this, it checks for two things.
First it checks if the string makes for a valid AS3 Number.
If so, it will apply this to the current value. The way it will apply it to the current value depends on the first character of the value. That's the second thing that's checked for.
If it's a minus sign, subtraction will occur. If it's plus sign, addition will occur. If neither is present, it will do nothing.

Thus, you have three options:

Option 1 is to add a plus sign in front of the number. E.g. "Story.Version":"+1.0"
Option 2 is to put the value is single quotes, e.g. "Story.Version":"'1.0'" (That is " ' 1.0 ' " but without spaces)
Option 3 is to treat the version as numeric, e.g. "Story.Version":1.0
Keep in mind that for option 1 and 3, 1.1 and 1.10 are the same.
This was one of the most interesting and enlightning posts I've ever read - absolute @stuntcock level! :wink:

Thank you for explaining.

Kind regards,
Me
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.