Van - Zonar's alt account, illegal, banned. Posted January 8, 2007 Report Share Posted January 8, 2007 I seem to have trouble making Sonic grind on a rail object. I am currently using Damizean's engine(Pack of Stuff Beta). And I've been trying to do this for months but no luck at all so if anyone can help me that will be great? When Sonic runs or jumps onto a rail I want him to change to action_grind and move across the rail at a certain speed. Can anyone show me how to do this? thx Link to comment Share on other sites More sharing options...
Zonar Games Posted January 9, 2007 Report Share Posted January 9, 2007 I'm trying to figure that one out too. I think it has something to do with the player_collision_platform. Other than that I don't know. Link to comment Share on other sites More sharing options...
SonicProject Posted January 9, 2007 Report Share Posted January 9, 2007 What methods have you tried and what happens as a result? May help in getting you some assistance, you know. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 9, 2007 Author Report Share Posted January 9, 2007 What methods have you tried and what happens as a result? May help in getting you some assistance, you know. I tried something like this but it is way wrong. But I made an object called objGrind so I could use it as a parent for all the rail objects. and the script I tried to figure out went like this: if ( player_collision_bottom( x, y, objGrind)) { //Start Grinding action = action_grinding; //speed layer = 2; } else if( action == action_grinding ) { //Stop Grinding layer = 0; action = action_grindfall; }[/CODE]Thats all I got. And it does'nt work at all. Does anyone know a way to add grinding to the 360 engine with GM? Link to comment Share on other sites More sharing options...
Zonar Games Posted January 9, 2007 Report Share Posted January 9, 2007 I did that before but no luck. Link to comment Share on other sites More sharing options...
Kain Posted January 9, 2007 Report Share Posted January 9, 2007 I'm not sure which version of Dami's engine you're using nor can I recall how they all work off-hand, but if you're trying to add a new layer, I'm pretty sure you have to edit every collision statement to have the new layer, perhaps including a new constant which'll be the next higher power of 2. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 10, 2007 Author Report Share Posted January 10, 2007 Here is the link to his (new pack). This is from GMC... http://forums.gamemaker.nl/index.php?showtopic=99044 I'm not sure which version of Dami's engine you're using nor can I recall how they all work off-hand, but if you're trying to add a new layer, I'm pretty sure you have to edit every collision statement to have the new layer, perhaps including a new constant which'll be the next higher power of 2. Thats what I don't get how to do. Can anyone help me? Link to comment Share on other sites More sharing options...
Zonar Games Posted January 10, 2007 Report Share Posted January 10, 2007 I wish I could Van but I need help just as much as you do. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 11, 2007 Author Report Share Posted January 11, 2007 I wish I could Van but I need help just as much as you do. thanks...Any help guys? I really need to resolve this problem. Also Kain I gave you the link to Damizean's 360 engine which is the one I'm using. Link to comment Share on other sites More sharing options...
USC Posted January 11, 2007 Report Share Posted January 11, 2007 Haven't had time to look at Dami's engine, but couldn't you just use a modified form of the code for slopes? Like, when Sonic collides with the rail, activate the copied slope code, and set his speed to whatever you want it to be. Then, when you just off or whatever, deactivate the modified slope code. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 11, 2007 Author Report Share Posted January 11, 2007 if(argument2==2) return place_meeting(argument0,argument1,objGrind); else { return place_meeting(argument0,argument1,objSolid); if(argument2==0) return place_meeting(argument0,argument1,objLow); else return place_meeting(argument0,argument1,objHigh); } I started something like this for grinding which was a script based off of the objPlatform script. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 12, 2007 Author Report Share Posted January 12, 2007 Sorry to bump but can anyone help me please? It's almost a whole entire day and no help. Link to comment Share on other sites More sharing options...
Zonar Games Posted January 13, 2007 Report Share Posted January 13, 2007 Haven't had time to look at Dami's engine, but couldn't you just use a modified form of the code for slopes? Like, when Sonic collides with the rail, activate the copied slope code, and set his speed to whatever you want it to be. Then, when you just off or whatever, deactivate the modified slope code. It's a little more complicated than that...At least I think it is. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 13, 2007 Author Report Share Posted January 13, 2007 It's a little more complicated than that...At least I think it is. I don't even know how to do that. Link to comment Share on other sites More sharing options...
Damizean Posted January 13, 2007 Report Share Posted January 13, 2007 If we want to have grinding wich should be activated when landing after a jump, and only while pressing the B action key, we just need a way to activate/deactivate collision with them easily. If you want a quick way to activate/deactivate stuff, you can have a parent objGrindingGround object wich parent is a objParentTerrainone, and at creation event stores the mask index on a variable, like this: InitialCollisionMask = mask_index; After this, we create a transparent 1x1 sprite called something like sprCollisionMaskTransparent. By doing this, we now can toggle collision activation/deactivation at our will by just changing Grinding object's mask_index to the transparent collision mask. We will use this for grinding. Before the Sonic movement starts, we need to activate or deactivate the collision with the grinding objects. We can do this using a routine something like this: objGrindingGround.mask_index = sprCollisionMaskTransparent; if ((Ground == false && Gravity >= 0 && Action == consActionJumping && KeyActionB) || (Ground == true && Action == consActionGrinding)) objGrindingGround.mask_index = InitialCollisionMask; Now it's only up to us to check wether when Sonic should activate the grinding action. We can do something as follows, on jumping's action routine: if (Gravity >= 0 && scrPlayerCollisionBottomObject(Angle, 1, objGrindingGround)==true) { Action = consActionGrinding; } And to make sure we're on the grinding ground, we can check this on grinding routine. if ((Ground == false) || (scrPlayerCollisionBottomObject(Angle, 1, objGrindingGround)==false)) { Action = consActionNormal; } Now the rest is just setting the speed to a value and well, I leave that up to you. P.S.: These codes are in the Xmas Engine form, wich is definately the most organizated one and the one I currectly encourage to use in your projects, you might want to update your stuff to it :3. Anyway, adapting this to the previous ones, shouldn't be much hard. Link to comment Share on other sites More sharing options...
Zonar Games Posted January 13, 2007 Report Share Posted January 13, 2007 Instead of using the variable Gravity could I use the variable global.gravity_angle = 0; which is used in one of your older engines? Link to comment Share on other sites More sharing options...
Damizean Posted January 13, 2007 Report Share Posted January 13, 2007 Instead of using the variable Gravity could I use the variable global.gravity_angle = 0; which is used in one of your older engines? Gravity is the y_speed, not gravity angle. Link to comment Share on other sites More sharing options...
Zonar Games Posted January 13, 2007 Report Share Posted January 13, 2007 lol,ok thank you Damizean. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 13, 2007 Author Report Share Posted January 13, 2007 @ Damizean: This is my attempt to convert your scripts for the xmas pack to one of your older engines and here is was: objGrindingGround.mask_index = sprCollisionMaskTransparent;if ((ground == false && y_speed >=0 && action == action_jumping && key_melee) || (ground == true && action == action_grinding)) objGrindingGround.mask_index = InitialCollisionMask;//Start Grindingif (y_speed >= false && player_collision_bottom(angle, 1, objGrindingGround) == true) { action = action_grinding; x_speed += 3;}//Stop Grindingif ((ground == false) || (player_collision_bottom(angle, 1, objGrindingGround) == false)) { action = action_normal;} [/CODE]But somethings wrong, when sonic jumps he does'nt turn into a ball/action_jumping instead he jumps with the animation action_normal which is wierd. Is there something wrong with my script?EDIT: This is what I did for [b]objGrindingGround[/b] too:[CODE]InitialCollisionMask = mask_index;[/CODE]with the parent of [b]objSolid[/b] since your older engine does'nt use [b]objParentTerrain[/b] Link to comment Share on other sites More sharing options...
Zonar Games Posted January 14, 2007 Report Share Posted January 14, 2007 I think because all the scripts Dami gave you are in the same script. I forgot what I did so I did'nt test it yet. Dami do you think you can help him out so this topic can end already. Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 14, 2007 Author Report Share Posted January 14, 2007 Well since I'm using an older version of his engine I thought that would be it. Does anyone have any suggestions? I want to get this problem over with. Link to comment Share on other sites More sharing options...
Damizean Posted January 14, 2007 Report Share Posted January 14, 2007 I think because all the scripts Dami gave you are in the same script. I forgot what I did so I did'nt test it yet. Dami do you think you can help him out so this topic can end already. It pretty much seems like that. Activation/Deactivation of collision for grinding should go before the engine does the movement of Sonic. Link to comment Share on other sites More sharing options...
Zonar Games Posted January 14, 2007 Report Share Posted January 14, 2007 Maybe try using the code in the Begin Step Event of objSonic. I think that would work. EDIT: I just tryed out what I sayed the jumping seems to be working fine but I can't spin dash and the grinding does'nt work. EDIT2: Yeah it is the same when I put the code in the Begin Step event. I just don't whats up. Hey Damizean what if I was able to make a duplicate copy of the collision scripts and make a parent object called objSolidGrind and when in contact with objSolidGrind the animation turns into action_grind and when not on objSolidGrind then the animation is normal? Link to comment Share on other sites More sharing options...
Van - Zonar's alt account, illegal, banned. Posted January 14, 2007 Author Report Share Posted January 14, 2007 It does the samething for me too. So there is still something wrong. Here is my modified code: objGrindingGround.mask_index = sprCollisionMaskTransparent;if ((ground == false && y_speed >=0 && action == action_jumping && key_melee_pressed) || (ground == true && action == action_grinding)) objGrindingGround.mask_index = InitialCollisionMask;Start Grindingif (y_speed >= false && player_collision_bottom(angle, 1, objGrindingGround) == true) { action = action_grinding; x_speed += 3;}Stop Grindingif ((ground == false) || (player_collision_bottom(angle, 1, objGrindingGround) == false)) { action = action_normal;}[/CODE] Link to comment Share on other sites More sharing options...
Zonar Games Posted January 15, 2007 Report Share Posted January 15, 2007 maybe their could be something up with the mask. I'm not sure, it's not working for me either and I've been spending my whole sunday trying to figure it out. Link to comment Share on other sites More sharing options...
Recommended Posts