Posted 24 March 2011 - 04:33 PM
I don't see it anywhere in the forums, so can someone please help?
Posted 24 March 2011 - 05:11 PM
Posted 24 March 2011 - 07:56 PM
--variable (enemy_attack = 1)
--create object (enemy attack; 0,0)
--variable (enemy_attack = 1)
--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!
Posted 24 March 2011 - 07:58 PM
Posted 24 March 2011 - 08:26 PM
Posted 25 March 2011 - 12:39 AM
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.
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.
Posted 25 March 2011 - 12:50 AM
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.
Posted 25 March 2011 - 02:45 AM
Does 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.
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.
Posted 25 March 2011 - 08:17 AM
Posted 25 March 2011 - 08:23 AM
On that note, I'll leave you all to it.
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.
Posted 25 March 2011 - 02:36 PM
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?".
Posted 25 March 2011 - 05:33 PM
Posted 25 March 2011 - 06:11 PM
Posted 25 March 2011 - 06:30 PM
- You DO declare enemy_attack in the right object, but not on the right event. In other words, you try to call it before you declare it.
- You declare enemy_can_shoot on a parent object and enemy_attack on a child object, but forgot about it and called enemy attack from an instance of the parent object.
- You declare both variables on the event that creates the instance (with(instance_create(x,y,enemy)), from another object) but only call enemy_can_shoot on the step event, while you do call enemy_attack on the create event of the same object. Wow, I confused myself, this time!
Check those out. If you can't find the reason, post the object and event that enemy_can_shoot is declared and the object and event it is used. The same for enemy_attack. Probably, you'll figure it out on your own before pressing the "add reply" button. But since making it global fixed the problem, I suppose Canite's explanation resumes it all.
Posted 25 March 2011 - 07:02 PM
Posted 25 March 2011 - 07:21 PM
I understood that. Does my answer look like I understood differently?
I think he means that enemy_attack and enemy_can_shoot are different variables
Posted 25 March 2011 - 10:00 PM
first faction - those who believe you screwed up somewhere in defining the variable and using the variable in 2 different positions (whether it be in the same object, or you mistaked that both create events occur in a parent-child situation, which it doesn't).
second faction - willfully believes you in that you understand GM (or your friend does) enough to, without a doubt, know it's a GM bug.
Heck, this could all be just a glitch on your HDD that one of the GM blocks got distorted and ignored an entire code block until you altered it and resaved it...you have to give us something other than "it doesn't work....oh wait, i fixed it by doing something completely off-the-wall."
Posted 26 March 2011 - 09:22 AM
As in, what did GM do wrong?
What was the issue with that particular version of GM?
If the version is bugged, why does renaming one object and variable make it suddenly start working correctly?
Your appeal for being correct that it's GM's fault, isn't very well supported. It sounds more like you had some sort of resource name clash and GM didn't like it. So, you replaced the object, and the clash is gone.
Edited by MasterOfKings, 26 March 2011 - 09:23 AM.
Posted 27 March 2011 - 03:11 AM
Edited by FlamingShadow, 27 March 2011 - 03:54 AM.
Posted 28 March 2011 - 01:41 PM
Recently joined, knowing all about game maker and even about which members are experienced...
It'd be much easier to just call you stupid, mr. greatvenom. Quit being a stubborn jerk and take these guys' advice. They know what they're doing.
Sounds like a fake profile, to me. A fake profile of someone who, unlike some of us, WANTS to start a flame war.
Posted 29 March 2011 - 02:13 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users