Having a problem with integer variables

This forum is meant for requesting technical support or reporting bugs.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

Having a problem with integer variables

Postby jack8135 » Sun Jun 05, 2011 7:12 am

Somehow all of my global variables have been corrupted and when I try to add them in hotspot properties it says: No Integer Variable Selected you must select an integer variable.

This problem first occured when I was working on a puzzle that uses a lot of hotspots (almost 40) and each one has a variable to enable visibility.

Now none of my global variables work! When I test play other parts of the game that use integer variables I get a message that says: Error An error has occured. The program may not work properly. Click OK and then press Ctrl + Q to quit. Error description: Unable to change the value of the following variable: "X_Variable". The variable may have been removed during project creation.

I never removed those variables though and the ones I did remove were also removed from the list. These still appear on the list, they just can't be added to hotspot properties for some reason.... help?...
User avatar
jack8135
Member
 
Posts: 26
Joined: Sat Feb 05, 2011 8:12 am

Re: Having a problem with integer variables

Postby mercedes » Sun Jun 05, 2011 9:46 am

Hey there..:)


Just a couple of things..that might help solve this..;

--Are you creating the variable using variable tab..and then accessing it via script..or..variable tab again--

--If Variable tab--
The variable must appear in the Text field provided--once you select it from the list--

--If you're using Script..
Perhaps post the codes you are having trouble with..using the code tags feature here...and wrapping them in code tags --

--If you're using both variable tab and script---
Variable tab to create--Script to call it..
Make sure you're spelling it correctly--
There's a difference between X and x...Variable and variable-

--Are you trying to access Integer variables in parts of your project..that may require a Variant variables--

--Also---Try naming it something else..
AM has its own list of variables..and if it's owed by Adventure maker..you can't use it. It won't work.
Especially if its something like X_Variable..or Y_Variable..
They could very well be being used already..

Keep us posted..:)

Also, If none of these suggestions help;

Could you please tell us what exactly it is you are doing..The motions..ect..
Step for step...might help..SnapScreen Shots help as well..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby jack8135 » Sun Jun 05, 2011 8:22 pm

Mercedes, thank you for your timely response. I am always amazed at how quickly I can get the help I need in this community.

Ok, somehow every variable in my global variable list has been converted from Integer to Variant. Not sure how this happened because I always create Integer Variables for my puzzles. It keeps things simple and I don't fully understand Variant Variables yet.

The most recent set of variables I created all begin with "robot comp" and end with "arms", "legs", "head" "torso" and "lazer". I just used "X_Variable" as an example. I tend to make the names of the variables literal so they're easy to remember. When the problem occured I had just made all 5 of these variables at once. Normally I don't do that, I usually create variables after I create the hotspots that use them but this time I knew in advance I would need these, so I just made them all at once.

I've begun the arduous task of deleting the Variants and recreating them as Integers... so far it's solved the problem and my puzzles are working correctly now. I just hope this doesn't happen again. Could this have been caused by having too many hotspots and variables in a single frame? Could creating multiple variables at once cause this problem?

Again, thanks for the help.
User avatar
jack8135
Member
 
Posts: 26
Joined: Sat Feb 05, 2011 8:12 am

Postby mercedes » Mon Jun 06, 2011 1:33 am

Hi there...:)


I would suggest to create them as you need them..using the Variable tab-as opposed to the link on the side--If indeed you did it that way..

Variants and Integers: A few differences;
---Variants can be used globally-
You can access them thru out your whole project-
--Variants will be saved if the user saves- exits the project. Then subsequently re-opens it again. They're restored.
---Variants are called using VBS script..
Which would explain the error you were getting; You must choose an Integer Variable--
You can't use Variants with Variable TAB.
---Integers are local..
---Integers are used once- Depending on the value of that variable..would it be used more than once-per frame

Thats a few of the differences..Hopefully that will help in using them..
Someone correct me if I'm wrong though..It's how i simplify them..:D

Could this have been caused by having too many hotspots and variables in a single frame? Could creating multiple variables at once cause this problem?


I don't think there is a limit to how many Integer variables you can make....
If there is..I doubt you will meet that limit..[1000] maybe..per project..If there is a limit..

But it is best, to make them as you need them--:D
Last edited by mercedes on Mon Jun 06, 2011 3:36 am, edited 2 times in total.
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~

Postby reneuend » Mon Jun 06, 2011 2:19 am

are you sure integers are local????

variants by definition are variable types that are not defined until you assign them. So a variant could be a string, integer, float, etc....and it is also used for arrays.

creating integer and variant types doesn't define the scope (how global a variable is), what defines the scope is where you define a variable.

Since arrays can NOT be globally defined, I use lists...as I've shown Mercedes. But, this is another subject that you may not be ready for yet.

I'm glad you got your project working!
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2691
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby mercedes » Mon Jun 06, 2011 2:27 am

are you sure integers are local????


..lol...I was under the impression that they were....

I didn't think you could define the same variable used in one frame...and use it in another..?
That's my definition of local-[within a frame/hotspot]..and using them in AM..

variants by definition are variable types that are not defined until you assign them. So a variant could be a string, integer, float, etc....and it is also used for arrays.


Yes..but..I was referring to why i would create a variant variable..in AM..
User avatar
mercedes
VIP
 
Posts: 2460
Joined: Sun Mar 09, 2008 10:43 pm
Location: Canada..~


Return to Adventure Maker Technical Support and Bug Reports

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron