Game Maker 2.3 Trial version!

S

SlFinn

Guest
Hi. I am hoping if you can tell me if it is possible to do collisions and make them work after pressing play and compiling, if you are using the trial version. Because i am following a course about Game Maker 2.3 and have copied the code exactly but it isn't working. There is no error in my code, so i am just wondering if the collisions aren't working because i am using the trial version currently. Please respond and inform me if you know the answer. I will really appreciate it!

Thank you.
 
S

SlFinn

Guest
what's the code that you have? is it compatible with 2.3 / does it use scripts or functions?
Game Maker 2.3, the GML code on the course i'm following is for GM 2.3 so it is compatible. And i am coding in GML. Are you sure you want to see my code? There is quite abit to show you that is relevant to the collisions i am trying to make happen. Perhaps i will show you the first part of the code concerning the collision between the player ship's laser and the enemy ship:

obj_enemyship collision event concerning player ship:

GML:
currentHealth -= 1;

with(other)
instance_destroy();
oPlayer collision event concerning obj_enemyship:

currentHealth -= 1;
with(other)
instance_destroy();

It is the same code or the player ship's collision with the enemylaser. I have not finished all the collision code. However, it should be destroying the bullets that come in contact with the enemy ship and the player ship, and minus one health point from either the player ship or the enemy ship (the minus health is not yet coded to be visible but i have used debug.log to comment on the console whether it has happened. I am not getting anything, and so nothing is actually happening. I f you could help i will appreciate it :)

I truly believe it might be because the trial version has limitations such as not being able to access a higher functioning compiler and complete final exectuables...whatever that means.
I read it from this article...https://help.yoyogames.com/hc/en-us/articles/230407528-GameMaker-Studio-2-Trial-Limitations

But i do not know if that means the reason i can't make any collisions work is because oof the trial version or not. I would just like to be certain before i buy the real Game Maker 2.3 license, you know?
 

saffeine

Member
i haven't double-checked, but i probably should before i make a fool of myself. regardless, i can't imagine the trial version would have restrictions on collision of all things, that'd make the software practically useless.
i'm absolutely certain that the compilation has nothing to do with it either. the compiler is what turns your code into machine code for the machine to execute. the default compiler is fine, but might prevent you exporting a .exe later.

you've said there that the oPlayer collision event concerns obj_enemyship, and the obj_enemyship collision concerns the player ship ( i assume oPlayer ).
are the bullets / lasers a separate object? if they are, then any collision events you have between the two ships mean diddly-squat, and you may find that the two ships colliding will probably destroy them both eventually.
 
S

SlFinn

Guest
i haven't double-checked, but i probably should before i make a fool of myself. regardless, i can't imagine the trial version would have restrictions on collision of all things, that'd make the software practically useless.
i'm absolutely certain that the compilation has nothing to do with it either. the compiler is what turns your code into machine code for the machine to execute. the default compiler is fine, but might prevent you exporting a .exe later.

you've said there that the oPlayer collision event concerns obj_enemyship, and the obj_enemyship collision concerns the player ship ( i assume oPlayer ).
are the bullets / lasers a separate object? if they are, then any collision events you have between the two ships mean diddly-squat, and you may find that the two ships colliding will probably destroy them both eventually.
The problem is that the enemy ship goes right over the player ship and neither ship registers the other's presence and the enemyship is not destroyed. Yes the lasers are separate objects which i will later code to collide with the enemy ship/player ship depending on what ship the lasers belong to. However, i want to try and get the player ship and enemy ship collisions right first so i know its working. But as i said before, the enemy ships are just flying straight over the player ship and are not being destroyed at all. I am puzzled as to why though.
 

kburkhart84

Firehammer Games
I would check the sprite settings. You need to make sure it has an appropriate collision mask, typically a circle that encompasses a good portion(but not all) of the things. The other thing is that if both objects have their own versions, they can just destroy themselves instead of destroying each other. Skip the with(other) parts and just do instance_destroy(). Later on, if you want to only put the event on one of the objects, THEN it makes sense to have it destroy itself and the other, but here you can just have each thing destroy itself since the events are on both sides.
 

saffeine

Member
after double checking the limitations, you should be in the clear, unless it's a bug with the software.

the next step would be to double check your collision masks. i've seen a handful of users report that 2.3 can sometimes screw up masks.
hop over into the sprite window and unfold this box. your sprite should then have a black overlay, just double check that it covers both sprites properly.

GameMakerStudio_uDei67aAa8.png

if everything looks fine there, then my next advice would be to make sure you've set up the right objects for the collisions, and that those objects are in the room.
i trust you have everything built right but given that i don't know how experienced you are with gamemaker as a whole, it's best to make sure all bases are covered.
 
S

SlFinn

Guest
Thank you guys! I will try what you have said right now! I will update you as to whether it starts working or not :)

after double checking the limitations, you should be in the clear, unless it's a bug with the software.

the next step would be to double check your collision masks. i've seen a handful of users report that 2.3 can sometimes screw up masks.
hop over into the sprite window and unfold this box. your sprite should then have a black overlay, just double check that it covers both sprites properly.

View attachment 34910

if everything looks fine there, then my next advice would be to make sure you've set up the right objects for the collisions, and that those objects are in the room.
i trust you have everything built right but given that i don't know how experienced you are with gamemaker as a whole, it's best to make sure all bases are covered.
Sorry to bother you again but what do you mean by setting up the right objects for the collisions exactly? The collision masks cover the ships completely so i don't think there is a problem there. At least not from what i can see, though i will keep trying.
 

saffeine

Member
i just mean that you have the collision events set up correctly with the right objects, and that the objects are placed in the room correctly.
an example of going wrong here would be that you somehow accidentally created extra objects with different events and placed the wrong ones in the room.
it sounds unlikely, but you'd be surprised by how easy it is to do something like that if you don't keep a close eye on your resources.

ensure that the collisions are between oPlayer and obj_enemyship, and then ensure oPlayer and obj_enemyship are in the same room.
 
S

SlFinn

Guest
i just mean that you have the collision events set up correctly with the right objects, and that the objects are placed in the room correctly.
an example of going wrong here would be that you somehow accidentally created extra objects with different events and placed the wrong ones in the room.
it sounds unlikely, but you'd be surprised by how easy it is to do something like that if you don't keep a close eye on your resources.

ensure that the collisions are between oPlayer and obj_enemyship, and then ensure oPlayer and obj_enemyship are in the same room.
Oh ok lol. Yes i have done that, and have checked the collision masks but have no idea how to get the ship collisions working. I have been stuck on this for a week and decided i need help. But i don't know why it isn't working for me. The collision event is acknowledged in the console/compiler, but nothing happens on screen which is very strange.

i just mean that you have the collision events set up correctly with the right objects, and that the objects are placed in the room correctly.
an example of going wrong here would be that you somehow accidentally created extra objects with different events and placed the wrong ones in the room.
it sounds unlikely, but you'd be surprised by how easy it is to do something like that if you don't keep a close eye on your resources.

ensure that the collisions are between oPlayer and obj_enemyship, and then ensure oPlayer and obj_enemyship are in the same room.
In the console/compiler it says this for one of the collision events, so i know its been acknowledged...Collision Event time(microsecs)=5
 

saffeine

Member
i don't think collision event time actually proves anything. i don't understand much of the compiler though, so i could very easily be wrong.
your best bet is to put show_message( "test" ); at the top of your collision event and see if it does anything. if it does, then the collision is fine and the problem is probably in the with statement.
that being said, try wrapping the code up into braces. maybe, due to interpretation, with statements don't like to float like that.

GML:
show_message( "test" );
currentHealth -= 1;

with(other){
    instance_destroy();
}
 
S

SlFinn

Guest
i don't think collision event time actually proves anything. i don't understand much of the compiler though, so i could very easily be wrong.
your best bet is to put show_message( "test" ); at the top of your collision event and see if it does anything. if it does, then the collision is fine and the problem is probably in the with statement.
that being said, try wrapping the code up into braces. maybe, due to interpretation, with statements don't like to float like that.

GML:
show_message( "test" );
currentHealth -= 1;

with(other){
    instance_destroy();
}
Thank you. I did what you said and "test" message is not showing so there is something wrong with the collision...i wonder what it could be though.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Put this code in the Step event of the object that doesn't properly collide.
GML:
show_debug_message(bbox_left);
show_debug_message(bbox_top);
show_debug_message(bbox_right);
show_debug_message(bbox_bottom);
This will tell you exactly where its collision mask's boundaries are. What is the output of this code?
 

saffeine

Member
that is weird. can you send me a screenshot of your object window? i only want to see this screen:
on top of that, if you have any code to draw the ship using draw_sprite, then i wanna see that too.

1602345436186.png
 
S

SlFinn

Guest
Put this code in the Step event of the object that doesn't properly collide.
GML:
show_debug_message(bbox_left);
show_debug_message(bbox_top);
show_debug_message(bbox_right);
show_debug_message(bbox_bottom);
This will tell you exactly where its collision mask's boundaries are. What is the output of this code?
The output for the collision mark boundaries for my player ship are these ...
985
836
791
650
The output for the collision mask boundaries for my enemy ship are these...
962
954
1091
1317
 
S

SlFinn

Guest
that is weird. can you send me a screenshot of your object window? i only want to see this screen:
on top of that, if you have any code to draw the ship using draw_sprite, then i wanna see that too.

View attachment 34912
I am going to stop for today but please if you can think of anything that will help me let me know :)
 
Top