Do you know anything about GMPhysics? I have a slight annoying problem to deal with in a small game I am making.
I have made a level editor where you can place objects. The weapons, which I made a long time ago, don't fall through the floor. This week I made mines, but they fall through the floor when they are created at level-startup. The thing is, weapons and mines are created in the same script (at the same time), but when mines are created in-game (not at level-startup) they don't fall through the floor.Here is the code for all the objects involved in this bug:
Quote:
Information about object: o_blockSprite: m_blockSolid: trueVisible: trueDepth: -2Persistent: falseParent: o_solidparentMask: m_blockCreate Event:execute code:h = create_body(x,y,STATIC,SHAPE_BOX,image_xscale*64,image_yscale*64);set_body_rotation(h, image_angle);grass = true;obj = object_index;Draw Event:execute code:draw_sprite_ext(s_ground,0,x,y,image_xscale,image_yscale,image_angle,c_white,1);if (grass = true) { draw_sprite_ext(s_grass,0,x,y,image_xscale,image_yscale,image_angle,c_white,1) }
Quote:
Information about object: o_mineSprite: s_mineSolid: falseVisible: trueDepth: -3Persistent: falseParent: o_object_parentMask: <same as sprite>Create Event:execute code:h = create_body(x,y,0.5,SHAPE_BOX,sprite_width,sprite_height);set_body_collide_ext(h);obj = object_index;image_speed = 0.2;radius = 200; //Bomb detection and explosion radiusdamage = 38; //Amount of damage the mine makessoundTimer = 0;soundInterval = 75;sndTimer = global.snd_minetimer;sndBoom = global.snd_mineexplode;Destroy Event:execute code:sc_explode(x, y, radius, damage, sndBoom)Alarm Event for alarm 0:execute code:instance_destroy();End Step Event:execute code:if instance_exists(o_player){ if !(room = rm_editor) { //Check if player is close, so it can explode: if (distance_to_object(o_player) < radius) and (alarm[0] = -1) { alarm[0] = room_speed * 1.7; image_blend = c_red; soundInterval = 10; soundTimer = 10; } //Play constant beeping sound: if (soundTimer = 0) { FMODSoundPlay3d(sndTimer,x,y); soundTimer = soundInterval; } else { soundTimer -= 1; } }}
Is the code for the mines exactly the same as that for the weapons?
It's almost exactly the same. As for the physics-handling, they are identical.
Ask marbs about GMPhysics, he's one of the best people I know.
But remember that currently, there isn't a compatible GMPhysics DLL for GM7, unless I'm a bit out of date. Since everyone states how much they hate GM7, I'm going to assume you're using 6, in which case you talk to marbs.But unfortunately, I think marbs said something about taking a break from 64Digits. You might not find him around.I'm using the DLL with GM7. Seems to work perfectly, except for this little bug… =(
Aaah right, that'd explain it. If you're using Windows XP, I'd thoroughly recommend using GM6.1 instead as the current GMPhysics engine for GM7 lacks a great number of features and documentation.
DOH! There's no way to reverse.
Unless there is some sort of GM7 to GM6 converter?"THIS BLOG HAS BEEN TAGGED:
Please refrain from being rude to other members. Failure to follow this rule will result in penalties."What the heck? The mods around here are _really_ immature…Don't delete staff posts.
Even when the post is totally unecessary?
Why don't you disable the option to do so if you don't want me to do it? :/If you want serious help, you don't post on a general blog site for it, because you will get people making jokes.
Because we trust people to have an IQ over 40.