T
Tset_Tsyung
Guest
Hey all,
So this is my first post on here (ignoring the muppet 'Humble Bundle' question I posted, ahem).
I've been using Unity since January this year, and thought I'd try Game Maker as well as it was on offer. My first project (after various tutorial projects) is a 2 part game to compare the two IDE'S. First part in GM, second in Unity.
However I'm having an interesting problem.
As this is a tutorial level a player doesn't exist at the start (instead there's a tutorial_player object). The patroling character mentioned below is added in the room creation code.
1. I add a patroling character to the environment. It checks to see if there are any players with an object_exists check. All good.
2. It then activates a script to check Line Of Sight to the player, passing the player object as an argument.
3. The first line in that script is to, again, check if the passed object exists. It clears the check, displays text to debug and continues to the next line.
4. Now we try to measure the distance to the object and, instead of doing as asked, it crashes stating that NO SUCH OBJECT EXISTS...
Needless to say I'm dumbfounded. Is there a better check that object_exists(obj)?
I'd be happy to upload code if you want to check that.
P.S. I know I could work around this by adding a player object and perhaps altering it to have a 'tutorial mode'. But since this is an interesting bug I'd rather solve it if possible.
Many thanks for reading all this - sorry if I've gone on a bit
So this is my first post on here (ignoring the muppet 'Humble Bundle' question I posted, ahem).
I've been using Unity since January this year, and thought I'd try Game Maker as well as it was on offer. My first project (after various tutorial projects) is a 2 part game to compare the two IDE'S. First part in GM, second in Unity.
However I'm having an interesting problem.
As this is a tutorial level a player doesn't exist at the start (instead there's a tutorial_player object). The patroling character mentioned below is added in the room creation code.
1. I add a patroling character to the environment. It checks to see if there are any players with an object_exists check. All good.
2. It then activates a script to check Line Of Sight to the player, passing the player object as an argument.
3. The first line in that script is to, again, check if the passed object exists. It clears the check, displays text to debug and continues to the next line.
4. Now we try to measure the distance to the object and, instead of doing as asked, it crashes stating that NO SUCH OBJECT EXISTS...
Needless to say I'm dumbfounded. Is there a better check that object_exists(obj)?
I'd be happy to upload code if you want to check that.
P.S. I know I could work around this by adding a player object and perhaps altering it to have a 'tutorial mode'. But since this is an interesting bug I'd rather solve it if possible.
Many thanks for reading all this - sorry if I've gone on a bit