rogueyoshi Posted August 14, 2006 Author Report Share Posted August 14, 2006 Updated: 8/14/06 - added pipes Link to comment Share on other sites More sharing options...
Asuma Posted August 14, 2006 Report Share Posted August 14, 2006 Sonic's invisible.... Link to comment Share on other sites More sharing options...
rogueyoshi Posted August 14, 2006 Author Report Share Posted August 14, 2006 sorry, stupid oversight. when i was unchecking 'visible' on the pipe, i accidentally unchecked sonic. just check back after i upload it. Link to comment Share on other sites More sharing options...
Asuma Posted August 14, 2006 Report Share Posted August 14, 2006 Ah. Link to comment Share on other sites More sharing options...
DarthCrap Posted August 14, 2006 Report Share Posted August 14, 2006 any ideas on the problem i was having thow? ive tried quite a few things, but i can't seem to get it work.i want everything to act like room_width is 448 (views stopping as if it were, player stopping as if it were). i can get the player to stop, but not the view however, i did manage to get it working correctly, views aswell, but the problem is it that is displays an error - yet the only way it will work atm is if this error is displaied? how can i do it without having to resort to an error? to explain in full detail, i have created an image to explain... as the png upload restrictions for the site would not allow the image, its been put on imageshack - clicky Link to comment Share on other sites More sharing options...
rogueyoshi Posted August 15, 2006 Author Report Share Posted August 15, 2006 i will add camera lock shortly, that will help. Link to comment Share on other sites More sharing options...
Damizean Posted August 15, 2006 Report Share Posted August 15, 2006 Guess what... Link to comment Share on other sites More sharing options...
Asuma Posted August 15, 2006 Report Share Posted August 15, 2006 Corckscrew. Link to comment Share on other sites More sharing options...
VectorSatyr Posted August 15, 2006 Report Share Posted August 15, 2006 Guess what...[qimg]http://img143.imageshack.us/img143/2178/guesswhatgs1.gif[/qimg] You lying whore! Why did you hide this from me?! ;_; [/jk] Camera lock would be most appreciated, especially since it's needed for cutscenes, boss zones and such. Make sure the locking range is adjustable (so the camera view can adjust to room sizes). Link to comment Share on other sites More sharing options...
DarthCrap Posted August 15, 2006 Report Share Posted August 15, 2006 yup camera lock would be appreciated, but as i thought about the possibility of 'camera' lock not 'view lock' last nite while i was asleep (dont ask me why-the-(you get the picture) i was dreaming about a sonic engine) Ill try do it now Thow if i ever get to uploading the GM6 then if yoshi thought it was good enough, he might be able to tell me on how to improve guess what.... if that screeny is real....... give us now !!!! jk lol EDIT : CAMERA LOCK DONE - FOR ME ANYWAY. NOW FOR PLAYER LOCK EDIT AGAIN : YUP DONE Sorry Bout Long Post, But Auto Merge Means This Is How It Gotta Be Camera/Player Lock Code Currently Only Works For Limiting X Movement To The Right, But That Can Be Easily Extended room_whatever Add This To The Creation event (See Settings) global.cameralimit = true; global.cameralimitto = 448;[/CODE][/size][b][size=5][font=Microsoft Sans Serif]objPlayerSonic[/font][/size][/b][b][size=3][font=Microsoft Sans Serif]Find This Code In The Step Event (Movement Bit)[/font][/size][/b][size=3][CODE] if (x<16) x = 16; else if (x>room_width-16) x = room_width-16;[/CODE][/size]And Replace With[size=3][CODE] if (x<16) { x = 16; } else { if (global.cameralimit) { if (x>global.cameralimitto-16) { x = global.cameralimitto - 16; } } else { if (x>room_width -16) { x = room_width - 16; } } }[/CODE][/size][b][size=5][font=Microsoft Sans Serif]objPlayerSonic[/font][/size][/b][b][size=3][font=Microsoft Sans Serif]Find This Code In The Step Event (Control Bit)[/font][/size][/b][size=3][CODE] if (x_speed > 0 && (player_collision_right(x,y,angle,maskBig) || x >= room_width-16)) x_speed = 0; if (x_speed < 0 && (player_collision_left(x,y,angle,maskBig) || x <= 16)) x_speed = 0;[/CODE][/size]And Replace With[size=3][CODE] if (global.cameralimit) { if (x_speed > 0 && (player_collision_right(x,y,angle,maskBig) || x >=global.cameralimitto-16)) { x_speed = 0; } } else { if (x_speed > 0 && (player_collision_right(x,y,angle,maskBig) || x >=room_width-16)) { x_speed = 0; } } if (x_speed < 0 && (player_collision_left(x,y,angle,maskBig) || x <= 16)) x_speed = 0;[/CODE][/size][b][size=5][font=Microsoft Sans Serif]objPlayerSonic[/font][/size][/b][b][size=3][font=Microsoft Sans Serif]Find This Code In The End Step Event (3rd Script In The 4 That Are In The Event)[/font][/size][/b][size=3][CODE] global.camera.x = floor(interpolate_values(x+look_shift_x, global.camera.x, 0.8)); global.camera.y = floor(interpolate_values(y+look_shift_y, global.camera.y, 0.8));[/CODE][/size]And Replace With[size=3][CODE] camx = floor(interpolate_values(x+look_shift_x, global.camera.x, 0.8)); camy = floor(interpolate_values(y+look_shift_y, global.camera.y, 0.8)); if (global.cameralimit) { if (camx > (global.cameralimitto - view_hborder)) { camx = (global.cameralimitto - view_hborder); } } global.camera.x = camx; global.camera.y = camy;[/CODE][/size]And if you are doing a boss, then you could add this code for once the boss has been defeated.[size=3][CODE]global.cameralimit = false;global.cameralimitto = -1;view_xview += 10;[/CODE][/size] Link to comment Share on other sites More sharing options...
Asuma Posted August 15, 2006 Report Share Posted August 15, 2006 Um, what's a code to go the the next room? Life, if I added anobj and sonic collides with it, he goes to the next room. Link to comment Share on other sites More sharing options...
DarthCrap Posted August 15, 2006 Report Share Posted August 15, 2006 Um, what's a code to go the the next room? Life, if I added anobj and sonic collides with it, he goes to the next room. Umm..... I use in the step event of the actual object if (distance_to_object(global.player1) == 0) { sound_stop_all(); room_goto(whateverrroom); // whatever other handles nessacerry instance_destroy(); } Below is a double post that has been automagically merged into the original. thanks for wanting to contribute to Sonic Dash. i dont mind adding your content to the game, just upload it, and i will merge it with the newest version. Ill take you up on that. Included is a note_to_rougeyoshi.txt file *Uploads* *Upload Finishes And Gives Me Error Message 'Invalid Post specified. If you followed a valid link, please notify the administrator' *Decides To Upload Later As DarthCrap Is Going To The Libary To Get A Book He Ordered* Link to comment Share on other sites More sharing options...
Damizean Posted August 15, 2006 Report Share Posted August 15, 2006 I had already implemented it, though it's somewhat different, but allows to limit camera to almost all values you'll need: roomStart's creation event Where global.camera = 0; Add below global.camera = 0; global.camera_min_x = 0; global.camera_max_x = 0; global.camera_min_y = 0; global.camera_max_y = 0; objController creation event Where if (global.checkpoint_x == 0) global.camera = instance_create(objStartPlace.x, objStartPlace.y-8, objCamera); else global.camera = instance_create(global.checkpoint_x, global.checkpoint_y, objCamera); Add below global.camera_min_x = 0; global.camera_max_x = room_width-1; global.camera_min_y = 0; global.camera_max_y = room_height-1; objPlayerSonic step event Where // move the player back inside the room if (x<16) x = 16; if (x>(room_width-16)) x = room_width-16; Replace with // move the player back inside the room if (x<(global.camera_min_x+16)) x = global.camera_min_x+16; if (x>(global.camera_max_x-16)) x = global.camera_max_x-16; Where if (x_speed > 0 && (player_collision_right(x,y,angle,maskBig) || x >= room_width-16)) x_speed = 0; if (x_speed < 0 && (player_collision_left(x,y,angle,maskBig) || x <= 16)) x_speed = 0; replace with if (x_speed > 0 && (player_collision_right(x,y,angle,maskBig) || x >= (global.camera_max_x-16))) x_speed = 0; if (x_speed < 0 && (player_collision_left(x,y,angle,maskBig) || x <= (global.camera_min_x+16))) x_speed = 0; And finally, where camera repositions, replace it with global.camera.x = floor(interpolate_values(max(global.camera_min_x+view_hborder, min(global.camera_max_x-view_hborder, x+look_shift_x)), global.camera.x, 0.8)); global.camera.y = floor(interpolate_values(max(global.camera_min_y+view_vborder, min(global.camera_max_y-view_vborder, y+look_shift_y)), global.camera.y, 0.8)); DarthCrap, you seem very skilled programming with GM, how did you find this site? Link to comment Share on other sites More sharing options...
DarthCrap Posted August 15, 2006 Report Share Posted August 15, 2006 I had already implemented it, though it's somewhat different, but allows to limit camera to almost all values you'll need:roomStart's creation event Where global.camera = 0; Add below [b]global.camera = 0; // - [SIZE="6"]DAMIZEAN U DONT NEED THIS IF U'VE ALREADY GOT IT [/SIZE][/b] Big Letters Just To Make It Stand Out global.camera_min_x = 0; global.camera_max_x = 0; global.camera_min_y = 0; global.camera_max_y = 0; objController creation event Where if (global.checkpoint_x == 0) global.camera = instance_create(objStartPlace.x, objStartPlace.y-8, objCamera); else global.camera = instance_create(global.checkpoint_x, global.checkpoint_y, objCamera); Add below global.camera_min_x = 0; global.camera_max_x = room_width-1; global.camera_min_y = 0; global.camera_max_y = room_height-1; objPlayerSonic step event Where // move the player back inside the room if (x<16) x = 16; if (x>(room_width-16)) x = room_width-16; Replace with // move the player back inside the room if (x<(global.camera_min_x+16)) x = global.camera_min_x+16; if (x>(global.camera_max_x-16)) x = global.camera_max_x-16; Where if (x_speed > 0 && (player_collision_right(x,y,angle,maskBig) || x >= room_width-16)) x_speed = 0; if (x_speed < 0 && (player_collision_left(x,y,angle,maskBig) || x <= 16)) x_speed = 0; replace with if (x_speed > 0 && (player_collision_right(x,y,angle,maskBig) || x >= (global.camera_max_x-16))) x_speed = 0; if (x_speed < 0 && (player_collision_left(x,y,angle,maskBig) || x <= (global.camera_min_x+16))) x_speed = 0; And finally, where camera repositions, replace it with global.camera.x = floor(interpolate_values(max(global.camera_min_x+view_hborder, min(global.camera_max_x-view_hborder, x+look_shift_x)), global.camera.x, 0.8)); global.camera.y = floor(interpolate_values(max(global.camera_min_y+view_vborder, min(global.camera_max_y-view_vborder, y+look_shift_y)), global.camera.y, 0.8)); DarthCrap, you seem very skilled programming with GM, how did you find this site? The Camera Code - Ill try that EDIT : Where do you set the values? objController is a global object so where can u set individual level camera_min/max values? Where i got to this site from - ure post on gm forums lol I had the original (very old) sonic 360 engine and did a gm forums search and ure 'pack of stuff beta' post came up Its also lucky that the file i was trying to upload didn't upload b4 - i had forgotton the BOSS.mp3 file which is important as it does dynamic load. EDIT : I Got the invalid id error message again, must be smthin to do with the forum uploader not working Link to comment Share on other sites More sharing options...
rogueyoshi Posted August 15, 2006 Author Report Share Posted August 15, 2006 EDIT: nvm, hes just changing servers Um, what's a code to go the the next room? Life, if I added anobj and sonic collides with it, he goes to the next room. room_goto_next(); is what you need, but you'll want a transition if you want it to look smooth. Link to comment Share on other sites More sharing options...
DarthCrap Posted August 15, 2006 Report Share Posted August 15, 2006 @rogueyoshi lol u need to update first post anyway to add 14th aug update (pipes) hey can i add u on msn to send u the finished zone+boss gm6 as the upload here doesn't seem to be working for me Link to comment Share on other sites More sharing options...
rogueyoshi Posted August 15, 2006 Author Report Share Posted August 15, 2006 sure. also for the time being, i will put sonic dash updates at http://hosted.filefront.com/rogueyoshi/ Updated: 8/15/06 - added corkscrew courtesy of damizean - minor fixes Link to comment Share on other sites More sharing options...
VectorSatyr Posted August 15, 2006 Report Share Posted August 15, 2006 also for the time being, i will put sonic dash updates at http://hosted.filefront.com/rogueyoshi/ NOES! DO NOT WANT!!!! Link to comment Share on other sites More sharing options...
Damizean Posted August 15, 2006 Report Share Posted August 15, 2006 NOES! DO NOT WANT!!!! The current server is down, live with it Link to comment Share on other sites More sharing options...
MidimanNull Posted August 16, 2006 Report Share Posted August 16, 2006 omg. This is why I dont date, bad things happen :< Link to comment Share on other sites More sharing options...
VectorSatyr Posted August 16, 2006 Report Share Posted August 16, 2006 No no, you misunderstand... I dispise filefront... >=| Link to comment Share on other sites More sharing options...
DarthCrap Posted August 16, 2006 Report Share Posted August 16, 2006 @damizean - can u read that post i posted earlier (http://www.sfghqmb.com/showpost.php?p=14492&page=3) I dunno, im not sure but i think i found a slight prob wiv ure camera script @anyone http://hosted.filefront.com/DarthCrap2/ the xtended version (finished level and added boss) is available there, but it has been made in the 6th aug version of the engine so needs to be upgraded Link to comment Share on other sites More sharing options...
Damizean Posted August 16, 2006 Report Share Posted August 16, 2006 @damizean - can u read that post i posted earlier (http://www.sfghqmb.com/showpost.php?p=14492&page=3)I dunno, im not sure but i think i found a slight prob wiv ure camera script @anyone http://hosted.filefront.com/DarthCrap2/ the xtended version (finished level and added boss) is available there, but it has been made in the 6th aug version of the engine so needs to be upgraded If you need to set camera specific stuff better make an object for those purposses, or already edit objController and do it based on current room. Link to comment Share on other sites More sharing options...
MidimanNull Posted August 16, 2006 Report Share Posted August 16, 2006 No no, you misunderstand...I dispise filefront... >=| no no, you misunderstand you have no sense of humor. Link to comment Share on other sites More sharing options...
DarthCrap Posted August 16, 2006 Report Share Posted August 16, 2006 kk lol cba changing the code ive alread got in and uploaded Link to comment Share on other sites More sharing options...
Recommended Posts