Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / phantom variable change

Author
Message
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jan 2016 09:33
This is probably more of a C++ thing than a AppGameKit thing.

When I first converted my Tier 1 to Tier 2, I had a variable called SCENE that kept changing inexplicably. I isolated the change to a specific IF STATEMENT within a specific FUNCTION. But no where in that function or if statement was the variable SCENE.
I could not at all see why the variable was changing, so I renamed it to otherS.
After changing the name all worked great for months as I added flow logic to my code to accomodate the Tier 2 template mainloop thingy. Suddenly, otherS is behaving the same exact way. I also isolated it back to the same IF STATEMENT and FUNCTION as was responsible for SCENE changing.
WTF?
Neither SCENE nor otherS are being changed in the suspect code. And why would the same variable be victim months after the name was changed??

TOO BIZARRE!

This is the code where the change is happening:


I have a message pop-up before and after the guilty code. otherS is the correct value in the first pop-up but changes to an 8 by the time the second message pops up. So this was happening when the variable name was SCENE. I changed its name, and for 2 months this issue was not evident.
As you can see, otherS is not in the code except for my message pop-ups. So how is the variable value changing?

It seems like maybe TOOK[chem].Active is being connected to otherS within the compiler. The TOOK array is being used as timers for various events in the game. But the scene number has nothing at all to do with the timers.

Has anyone ever seen this phantom variable changing before??
home.wavecable.com/~mindsclay
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jan 2016 09:40
ALSO,
The conditions of the IF statement is not being met, so they are not even executing.
In otherwords, TOOK[chem].Active does not equal 5 so it should not change to 8 anyway. In fact, I am not even using the timers at this point.
home.wavecable.com/~mindsclay
mrradd
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: CA, USA
Posted: 7th Jan 2016 23:40

Have you tried stepping through the code and checking your memory references to see if the object's memory location changes? It is possible that if you are ever doing a obj1 = obj2 that your assignment operator (the equal sign in case you didn't know.) and copy constructor are not handling it properly.
make -C ../NagGaCreMo/2016 -f aGame.mk
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Jan 2016 11:07
This thread attracted one of the most docile spammers on the internet (post deleted of course). He posted...

"I have a DJI Phantom 2 also"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt

Login to post a reply

Server time is: 2024-11-17 02:55:09
Your offset time is: 2024-11-17 02:55:09