Unknown Variable?
#1
Posted 24 March 2011 - 04:33 PM
I don't see it anywhere in the forums, so can someone please help?
Thanks
#2
Posted 24 March 2011 - 05:11 PM
-IMP
#3
Posted 24 March 2011 - 07:56 PM
For example:
obj_enemy
-create
--variable (enemy_attack = 1)
-collision (enemy)
--create object (enemy attack; 0,0)
-NOT-
obj_enemy
-create
--variable (enemy_attack = 1)
obj_player
-collision (enemy)
--create object (enemy attack; 0,0)
In order to do the example above, a global variable must be created in order for different objects to see the variable.
I hope this helps!
-onyex
#4
Posted 24 March 2011 - 07:58 PM
#5
Posted 24 March 2011 - 08:26 PM
#6
Posted 25 March 2011 - 12:39 AM
#7
Posted 25 March 2011 - 12:42 AM
Odd version? This not a bug with GM, it is either a mistake you made, or you're using some cracked version of GM.There was an error, because setting another variable worked before. I mean, I have an odd version of the program, and this has happened before.
edit: And if this cracked version can't even recognize declared variables, it's useless, and the free lite edition of GM would be better.
Edited by Canite, 25 March 2011 - 12:43 AM.
#8
Posted 25 March 2011 - 12:47 AM
first post: I have a bucket that I put water into, it's red...but for some reason the blue one has nothing in it.
next post: I fixed it, I painted the red bucket green, and then poured the water all over the ground, now all the buckets have wet bottoms.
awesome!
#9
Posted 25 March 2011 - 12:50 AM
#10
Posted 25 March 2011 - 12:58 AM
I'm 100% certain you don't know what you are doing. GM doesn't just randomly ignore commands given to it...it doesn't one day decide "I don't feel like working right now, your variables r belong to me now". It's not INTERCAL, and although bugs do creep in once in awhile where the compiler might skip a gmk block (which is very very very rare), a quick reload should fix the issue. You stated it isn't working at all, so that's not the problem.sabriath... that was completely irrelevant... and no, it's not a crack, I didn't do anything wrong, it just didn't recognize variable attack for some reason, but recognized everything else.
#11
Posted 25 March 2011 - 01:23 AM
#12
Posted 25 March 2011 - 02:45 AM
nopeDoes the word NOVICE mean anything to you?
there is do, and don't do....no try
A true novice would try to solve a root of a problem without blaming the tools they use. What you did was solve a surface problem (making the variable global doesn't change the fact that you are using it in the wrong place). A lot of the people here are willing to help you solve the root of your problems so that you don't come crawling back in here with the same type of question later. What you did was snubbed the tool because it couldn't possibly be your fault, and now we all know that you'll be coming back in a few weeks with another problem that would have and could have been solved right here right now.
#13
Posted 25 March 2011 - 03:08 AM
#14
Posted 25 March 2011 - 04:59 AM
In fact, though there are plenty of bugs in GM, 90% of the time something doesn't work in ANY language, it's the programmer's fault. Coming from experience, that is.
-IMP
#15
Posted 25 March 2011 - 08:17 AM
#16
Posted 25 March 2011 - 08:23 AM
On that note, I'll leave you all to it.
-MoK
#17
Posted 25 March 2011 - 12:13 PM
When you declared it as a global variable, every object had access to it, includding the one you wanted.
Copying, renaming or anything else wasn't required.
That's true. Honest. No GM error.
While novice, we usually get a lot of bugs that we have a hard time figuring out what went wrong, but usually, that's our logic problems, not the GM's. Things that go wrong all the time are easy, just take the error report and try to figure out what may be causing it. Things that go wrong only now and then are the hard part, you keep thinking "if there is an error, why does it WORK most of the time?", but that's also our logic problem. There was this one time in... let me see... 2 years of game making, that the error was not my logic. I tried to run 2 games at once and my video card couldn't handle it, prompting a surface problem (both games made in lite version, meaning I didn't mess with surfaces). I got really curious, how could I have a surface problem without using surfaces? Again, no GM error, just a hardware limitation and the fact that the surfaces are used to draw everything in the game, even if we don't directly play with them.
I have seen many reports of bugged versions, but most of the time, it ended up being users mistakes. When there actually is a bugged copy, the normal error is that GM doesn't start or the games do not start.
#18
Posted 25 March 2011 - 02:36 PM
#19
Posted 25 March 2011 - 05:12 PM
Besides, you DID fix it doing, amongst other things, change the variable to global, like we were implying that you should.
Being the 10th time something like that happens does not mean that your version is bugged. The same file that gave you the error work on other versions, probably does. But you still have to check if, for example, you're using a GM7 function in a GM8 copy and your friend has an older version, or vice-versa. Not likely, since it was a variable problem.
Basically, what everybody was saying (in less kind words) was "there is a logical problem there that you're the only who can't see. How can we open your eyes to that?".
#20
Posted 25 March 2011 - 05:33 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











