Jump to content


Photo
- - - - -

Ssb Camera V2.4.1 Update 8/26/07


  • Please log in to reply
54 replies to this topic

#1 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 20 August 2006 - 02:39 AM

Title: SSB Camera V2.4.1
Description: view tecnique/example that will zoom in/out so that all characters can be seen. Just like in the game Super Smash Brothers.
Type: .gm6 and .gmk
GM Version: 6.0, 6.1, 7.0 Unregistered! (see below)
Link: Host A or Host B
File size: 103 KB

Other Info:
I have been getting a lot of PMs asking for help... AND I LOVE IT! I really enjoy helping people so go ahead and ask me! My only condition is that you make a honest effort to learn what I helped you with, because if you have everyone else do all your work, and you never learn anything, how are you going to get better? Anyway, I love taking questions so ask up! It doesn't have to be about the SSB Camera, It can be about anything!

:( Unregistered Users

Unregistered users CANNOT use the HUD drawing scripts. Delete the HUD scripts in the "control" object under the draw event before running the example.

Otherwise, now completely works for unregistered.


B) As Seen In

Naruto: Ninja Way by Geou

If you used my engine in a Game or WIP please PM me with the URL of the topic so I can use it as an example. Thanks!


:ph34r:V2.4!! Features

HUD Drawing - Now includes several scripts for drawing sprites and shapes that don't resize. Not available for unregistered users!

View Area - You can set define the area the view must stay in (can be used to keep view inside the room.)

Activating Objects in Example - In the example you can press 1, 2, 3, and 4 to activate/deactivate characters from the view.

GM6 Bug Fixes - I fixed a bunch of bugs in the gm6 version.

Offscreen Arrow Distance - You can now set the distance from the edge of the screen that the character must be before drawing the arrow.
No Arrow Object - draw_offscreen no longer creates objects.
Eaiser Scripts - Now only requires parent's name instead of objects name.
Activating Objects - You can now set whether or not a character effects the view.
Much Faster - Now almost twice as fast as before!
Arrow Fix - If two characters are off the screen on the same side it still draws the arrow correctly
Room Limits - Now the camera will not go outside the room boarders.
Off Screen Characters - Shows an arrow with the character's sprite when it is off screen.
Smooth Movement for New Objects - The camera will move and expand to fit objects that are created outside the view instead of just instantly shifting that way.
Max View Size - The view will not expand to infinity, it will now only expand however large you want the max to be.
Off Screen Characters - When an object does go off the screen, it will show the circle and arrow sign (like in ssb) and show the object inside the circle.
Automatic Information - Under the "find_info" script, you no longer have to add anything too it. It will now automatically find information based on the number of objects there are. (You don't have to add "other.charX.x" to the end for each character.)


F.A.Q:
Q. How can I make the view stop tracking the an object after ______.
A. With the recent update this can now be easily done using the get_fallowing and set_fallowing scripts. You can use get_fallowing to check if the view tracks it and set view to set whether the view tracks it or not.

Q. Why are the things I draw with the HUD scripts so flashy?
A. This is because it is because my method of doing it includes decimal places in the drawing locations and, as you know, you cant draw a sprite at 12.467, it is rounded to 12. It is this rounding that causes it to flash. If anyone has a better way of doing it please tell me!

Q. How do I keep the objects a certain distance form the edge of the view?
A. In the create event of "camera" you can change the variables "xoffset" and "yoffset" to set the distance from the edge.

Q. Why does my character go completely of the screen to the right and bottom before resizing, but it resizes to the left and top immediately when it touches the edge?
A. This happens when you have the sprite origin at the default top-left point. The system uses the sprite origin to determine when to start resizing. For the best results have it centered and have the xoffset and yoffset variables to be half the sprite's width and height


If you would like me to make a specific example PM me.

GIVE CREDIT: Made by: Michael Moore

Edited by icuurd12b42, 12 August 2011 - 06:23 AM.

  • 0

#2 Dragen

Dragen

    GMC Member

  • New Member
  • 299 posts

Posted 21 August 2006 - 04:29 PM

the only problem with the example is you can keep pressing jump and go higher and higher, and eventually out of the room. you might want to put a wall up there :)
  • 0

#3 -Insane-

-Insane-

    GMC Member

  • New Member
  • 717 posts

Posted 23 August 2006 - 09:43 PM

Here is another version, in one script.

//Update the view to show all players.////Arguments:////0: REAL View ID.//1: REAL Player 1 id/object.//2: REAL Player 2 id/object.  (-1 for none)//3: REAL Player 3 id/object.  (-1 for none)//4: REAL Player 4 id/object.  (-1 for none)//5: Hborder.//6: Vborder////Returns nothing.{var vid,p1,p2,p3,p4,pn,pl,pt,pr,pb,hb,vb;vid=argument0;p1=argument1;p2=argument2;p3=argument3;p4=argument4;hb=argument5;vb=argument6;pn=0;pl=0;pr=0;pt=0;pb=0;if !p1=-1 and !object_exists(p4) exit;if !p2=-1 and !object_exists(p4) p2=p1;if !p3=-1 and !object_exists(p4) p3=p1;if !p4=-1 and !object_exists(p4) p4=p1;if p1=-1 or !instance_exists(p1) exit;if p2=-1 or !instance_exists(p1) p2=p1;if p3=-1 or !instance_exists(p1) p3=p1;if p4=-1 or !instance_exists(p1) p4=p1;pl=min(p1.x,p2.x,p3.x,p4.x)-hb;pr=max(p1.x,p2.x,p3.x,p4.x)+hb;pt=min(p1.y,p2.y,p3.y,p4.y)-vb;pb=max(p1.y,p2.y,p3.y,p4.y)+vb;view_xview[vid]=pl;view_yview[vid]=pt;view_wview[vid]=max(pr-pl,pb-pt);view_hview[vid]=max(pr-pl,pb-pt);}

-Insane

EDIT: Changed, to (hopefully) still work when an objectis deleted.

Edited by -Insane-, 26 August 2006 - 05:16 PM.

  • 0

#4 misterneoman135

misterneoman135

    GMC Member

  • New Member
  • 28 posts

Posted 24 August 2006 - 11:48 AM

EDIT: Nevermind, I had to unzip the file for it to work.

Nice example, I've always needed something like this.

Edited by misterneoman135, 26 August 2006 - 12:45 PM.

  • 0

#5 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 26 August 2006 - 07:15 AM

the only problem with the example is you can keep pressing jump and go higher and higher, and eventually out of the room. you might want to put a wall up there  ^_^

<{POST_SNAPBACK}>


Well it is just and example so it realy doesnt matter :P


I downloaded, but when I ran the game it said

Failed to run the game.

Can you fix this?


I am not shure why it does that for some people. ^_^

[Mod edit - You *know* it has nothing to do with people not having GM6, and you know it's a known issue...]

Here is another version, in one script.

The script you gave will crash if one of the objects is removed while it is being run. One of the main accomplishments of my scripts is that it does not madder if all the objects are there or not (expect for when the script is first initiated). ^_^
  • 0

#6 -Insane-

-Insane-

    GMC Member

  • New Member
  • 717 posts

Posted 26 August 2006 - 05:14 PM

Here is another version, in one script.

The script you gave will crash if one of the objects is removed while it is being run. One of the main accomplishments of my scripts is that it does not madder if all the objects are there or not (expect for when the script is first initiated). :)


Good idea. I'll just have to add a "if p2=-1 or !instance_exists(p2)", it might even be good to add a "object_exists" too, (incase the obejct get's added manually during a certain point.

-Insane
  • 0

#7 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 27 August 2006 - 03:05 PM

Good idea. I'll just have to add a "if p2=-1 or !instance_exists(p2)", it might even be good to add a "object_exists" too, (incase the obejct get's added manually during a certain point.

<{POST_SNAPBACK}>


Well see, that was also one of the original problems that I was trying to solve. Lets say that you have 12 difrent characters that all needed to be evaluated to see wich one had the greatest and least x and y values so that you can set the view accordingly. If you do it that way you will end up haveing to do:
if obj1 does, obj2 does, obj3 does, obj4 does ... object12 does
 //evalutation code concerning obj1 - obj12
if obj1 does, obj2 doesnot, obj3 does, obj4 does ... object12 does
 //evalutation code concerning obj1 - obj12 execpt for obj2

As you can see there will be ALOT of work. Even with just 4 objects you have to:
if just obj1 exists
if just obj2 exists
if just obj3 exists
if just obj4 exists
if obj1 and obj2 exists
if obj1 and obj3 exists
ECT...

You will have to do a line for every single combination you can make. :)

But never fear, for my system can do as many objects as you want. (the only problem is that the max number of arguments you can have is only 15 so if you want more than that you have to assighn the variables manualy. To do that just add "obj16=<object name>" at the bottom of the "init" script)
  • 0

#8 rinkuhero

rinkuhero

    Paul Eres

  • GMC Member
  • 1792 posts

Posted 27 August 2006 - 07:59 PM

Couldn't you just use the max() and min() functions to determine what the highest/lowest X and Y values were? Something like max_x = max( (argument0).x, (argument1).x, (argument2).x, [...])

Anyway, this is a pretty neat idea, I may implement it in my game's next version, but it depends on how smooth the zooming looks -- sometimes when you zoom in or out the sprites and tiles look a little uglier than at their natural size (as anyone knows who has tried to resize an image file).

Maybe I can do it "stepwise" -- instead of fluidly zooming in and out it'd do a jump, from 320x240 (0.5x) to 480x360 (0.75x) to 640x480 (1x) to 960x720 (1.5x) to 1280x960 (2x) zooms -- I'd probably keep an option to turn this zooming feature off for those it annoys.
  • 0

#9 mr.pacman0

mr.pacman0

    warning:highly unstable

  • New Member
  • 956 posts

Posted 28 August 2006 - 03:43 AM

don't get me wrong, it's a great example, even better than shadow yoshi's, but i think it's missing something, it doesn't seem to have a point where the camera will stop zooming!
if this is a ssb camera, i think it would make sense for you to add a magnify if the player gets too far away from a certain point, i know it can be done with a simple wall, but for the newbies in this community; they need it to have been finished already...
  • 0

#10 irregular

irregular

    GMC Member

  • GMC Member
  • 1271 posts

Posted 05 September 2006 - 06:28 AM

Check it.
Posted Image
  • 0

#11 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 05 September 2006 - 10:00 PM

if you are wondering why the objects are so small its because its zoomed out realy far. And yes, I am adding a feature that keeps it from zooming out to much.
  • 0

#12 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 09 October 2006 - 10:53 PM

New, more advanced, helpfile.
  • 0

#13 dbgt

dbgt

    GMC Member

  • New Member
  • 150 posts

Posted 28 November 2006 - 10:27 PM

grr. I cant seem to get it 2 work!!!
little help? it just stays in that one room in that one view looking at the top left corner of the room. Someone plz help ;)
  • 0

#14 ejackson

ejackson

    Topic Bumper

  • New Member
  • 416 posts

Posted 29 December 2006 - 06:16 AM

Your supposde to click on the characters. Use the arrow keys to move tthe red guy, and A, D, & W to move the blue guy. As you will see, the othwr characters move on their own.

Pretty cool thing, man! 8/10!
  • 0

#15 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 05 January 2007 - 11:33 PM

Is this in a game you made or in the example? If it is in the game you made that probably means that at least one of the players that it fallows did not exist when the init script was run.
  • 0

#16 TEZT

TEZT

    GMC Member

  • New Member
  • 8 posts

Posted 28 January 2007 - 06:04 AM

This is amazing. I'm terrible at writing script. Do you know if there is a way to zoom in and out with a button? If I have an example like that I could modify it for cutscenes, menus, etc. Could you please post one like this?
  • 0

#17 sleija

sleija

    GMC Member

  • New Member
  • 174 posts

Posted 19 February 2007 - 05:56 AM

I don't see the help file <_<
  • 0

#18 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 24 February 2007 - 09:42 PM

:huh: V2.2 Now Out! - ZOMG

Edited by yo1dog, 03 March 2007 - 12:08 AM.

  • 0

#19 sleija

sleija

    GMC Member

  • New Member
  • 174 posts

Posted 28 February 2007 - 02:14 AM

Nice update :GM006:.

The only problem with the Platform example is that the origin needs to be set to the center (But then you get ladder problems). I noticed that when i first got the example.
  • 0

#20 yo1dog

yo1dog

    GMC Member

  • New Member
  • 245 posts

Posted 02 March 2007 - 07:40 PM

Ohh ya forgot to do that. Ill upload it again with the sprite centered and will see if I can fix the ladder problem.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users