So the statement is true, yet it isn't?

TheIndieStation

  • *
  • Posts: 2256
Long time no see guys!
So a bit of background info:
I have a custom event in which we read all the data I need and process it, and one drawing event. At the start of the custom event all lists are cleared, all numbers are reset, and my only boolean is set to true (it's the very first thing that happens actually). After that, some values are added to the lists, which is in this case only adding one text item "None" to the options list.
Here is the tricky part. As you can see in the picture below the value of item #0 is "None" (first line), the second line should return "TRUE" if the statement (item #0 = None) is correct, which is since we saw that in the first line. The third one is a boolean which is set to "FALSE" if item #0 = None.

So if we know that Item #0 is "None", then why isnt the statement returning TRUE, and thus setting the last boolean to FALSE?

I have been trying to solve this mystery for 2 days now, but I just cant find the issue. I have triple checked the order of commands, and it is all correct. No values are changed in the draw event, only in the custom event which I double checked is only being called once. The order is: (I cant show a screenshot since this is client work, sorry =p )
- Set HasOptions to TRUE.
-Clear all lists attr.
-Clear all numbers attr.
- Add text "None" to _OptionsList
- If item #0 = None, set HasOptions to FALSE.

Any ideas?

Cheers!

rambunctious10

  • Posts: 58
I am probably wrong, but I have an idea. I think you have to use a "__ as text" somewhere. I'm not sure though.
I ♥ coding.

TheIndieStation

  • *
  • Posts: 2256
Tried that for 2 days, no succes. But it shoudnt matter since the item is already a text, otherwise it cant be drawn.

rambunctious10

  • Posts: 58
But does 'None' have to be as text? Or does it just work without it?
I ♥ coding.

TheIndieStation

  • *
  • Posts: 2256
I can try to put but the item and None itself as text in the statement, but i dont think it will make a difference. Beacse how else can the code read "None". If its not a number, it has to be text...?

rambunctious10

  • Posts: 58
Is the drawing text inside of an 'if' statement?
I ♥ coding.

TheIndieStation

  • *
  • Posts: 2256
Nope. All the way in the bottom

rambunctious10

  • Posts: 58
It seems like this is giving you a good challenge. I don't have any more good ideas. Sorry  :'( I hope you figure it out.

« Last Edit: May 07, 2015, 06:13:52 pm by rambunctious10 »
I ♥ coding.

Photon

  • Posts: 2697
Can you show the entire code please?
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

cabinfever

  • Posts: 159
Howabout if split out the 'if'-statement out of the 'draw' -statement. So that it is separate?

yoplalala

  • Posts: 1502
Have you tried annother word instead of None maybe None is a special keyword.

TheIndieStation

  • *
  • Posts: 2256
@photon, i cant do that unfortunately because I work under a contract which doesnt allow me to publicly show thw code I make for them. I can however send you a screenshot by email if you could help me out with it.

@cabinfever. The statement isnt in the draw event . The draw event is inside one big statement which is if _showtext = true. This boolean is set to true AFTER all the other things are done inside the custom event. So all the data is being processed before the draw event.

SadiQ

  • Posts: 1778
How about actually drawing the content of the entire list. Also use _ as text in both the setter and the drawn block (just to be safe).
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

TheIndieStation

  • *
  • Posts: 2256
Well i did notice something wierd with the new log viewer. for some reason if I print all items in a list, the first one shows up empty (not null, just blank) while it has a value since it shows up properly when drawing.

But the optionsList only has one item, which is the None text item.

SadiQ

  • Posts: 1778
I don't suppose you could send me a pm with a link to the stencyl file?
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.