Jump to content


Amarpal

Member Since 17 Sep 2008
Offline Last Active Aug 09 2012 06:49 PM

Posts I've Made

In Topic: Non existing variables

26 February 2011 - 07:03 AM

Yea, but the thing is, that I had a similar code to that in the game, and it said it didn't know what "buddy" was, and that's what crashed it. Maybe I did something wrong, I'm not sure. But it hasn't come up since, so I'm assuming this version has fixed it and will ignore it until it pops up again. :3

In Topic: Non existing variables

26 February 2011 - 03:43 AM

Oh, okay~ Thank you for help IMP~ ^.^ It's just that I got an error saying that one of these objects didn't know what the variable that belonged to another object was. Haven't been able to get it to come up again, so I'm moving along with my project. Though, of course, I'll put this in as a precautionary, don't see why not if my code still runs smoothly with or without~

In Topic: How do you come up with a Story/Plot?

25 February 2011 - 03:03 AM

Moo. o..o Am I late to the thread? Lots of good info has been tossed out so far so I guess I'll just speak for myself

How do you come up with a Story/Plot?
...

Think of scenarios to test these characters.


That's a pretty good chunk of information you got there. I will admit, I've only briefly skimmed over China, but I did look up names and their meanings, Xi Wang means Hope and Desire. And I'm into Chinese Martial Arts, so I decided to pick China as an incredibly general setting. But I'll probably end up scratching that later on. Still trying to fill out the story line, haven't got to much time to work on it do to school and another game I must make for one of my old teachers(Biology; simulates Natural Selection.)

In Topic: Non existing variables

25 February 2011 - 02:30 AM

if (buddy!=noone) { //if it exists
    //code
}
Perhaps?

I didn't read thoroughly.

-MoK



From googleing noone, it has something to do with being a value that's returned from an object not existing, right? Theoretically, that should be able to work, but the only problem to testing this bug is to get it to occur again without modifying my code so much that the bugs would happen when they shouldn't in my original code and vice versa. But thank you for a possible solution to my problem, and at the least, for this new little tidbit of GML. ^.^


In Topic: Non existing variables

24 February 2011 - 01:31 AM

instance_exists() should work. Make sure you're checking that an instance of an object exists, not an instance of an instance (i.e. not instance_exists(buddy)). Try enclosing your current conditional statement in another one that checks for the existence of that object, like so.

// ...

if (instance_exists(obj_person) {
 	if (buddy.awesome == 1) { move_towards_point(buddy.x,buddy.y,spd); }
}

Hope that helps. ;)


But the thing is that there are more than just 2 obj_person. So the one on the far left has a buddy in the middle, but the middle guy has a buddy on the middle right, and so on. I should make a note of that in the topic, though.
But thank you, you actually helped me fix a bug that hasn't shown itself yet~ ^.^ Lol.

Edit: Isn't there a way to check if a variable is undefined? Like in Flash Actionscipt?
Edit2: This is a rare error, can't quite get it to come up again. :/