The Daily Click ::. Forums ::. Klik Coding Help ::. Decimals with MMF2
 

Post Reply  Post Oekaki 
 

Posted By Message

eyeangle



Registered
  12/06/2003
Points
  1683
24th January, 2007 at 20:44:21 -

I'm following a tutorial of platform custom movement and it's going really well. It's practically finished and all I want to do it change the gravity so it's not to strong. The tutorial says change to change one of the numbers from 1 to 0.5 so I did this but I think it's reading it as 0 gravity becasue nothing is pulling the character down.

The expression is:

Grav of "player" < 15 ---------|---------- Add 1 to Grav

I tried to make it:

Grav of "player" < 15 ---------|---------- Add 0.5 to Grav

Does MMF2 read decimals?

What's going wrong?

 
theonecardgame.com

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
24th January, 2007 at 21:02:50 -

Ah. That looks familiar.

Does the provided example behave in the same way? I've been told that versions of MMF2 below 243 might be having trouble with the decimal addition to the alterable value.

Actually - does using "Set Grav to Grav+0.5" work, rather than just using Add?

 
http://www.davidn.co.nr - Games, music, living in America

eyeangle



Registered
  12/06/2003
Points
  1683
24th January, 2007 at 21:45:18 -

Yeah the example they provided is behaving the same way. It's not reading the decimals.

I tried the "Set Grav to Grav+0.5" and it worked! So that's cool.

I also tried:
"Set Grav to Grav+1", expecting it to have the same feeling as Add 1 to Grav, however it seemed much different. It seemed slower. I don't know why, it's doing the exact same thing just saying it a different way.
Why is this?

 
theonecardgame.com

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
24th January, 2007 at 21:49:13 -

Right, I'll go and rewrite that bit.

I'm not sure why there would be a difference - I'll check, though. You might want to upload a side-by-side example on the Clickteam forums for more people to take a look.

 
http://www.davidn.co.nr - Games, music, living in America

eyeangle



Registered
  12/06/2003
Points
  1683
24th January, 2007 at 22:52:21 -

Here's the engine:

http://eyeangle.sitesled.com/movement.mfa

It's the first command under gravity. Trying changing it to 'Add 0.5' see if it works.

 
theonecardgame.com

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
24th January, 2007 at 23:20:38 -

Adding 0.5 to Grav works in build 243 - I don't think I see a difference between "add" and "set", either. Which build are you on?

 
http://www.davidn.co.nr - Games, music, living in America

eyeangle



Registered
  12/06/2003
Points
  1683
24th January, 2007 at 23:28:18 -

Yeah I'm on build 241. I think it's definately my version of MMF2 that's making it not work. Anyway thanks for the help.

Image Edited by the Author.

 
theonecardgame.com

eyeangle



Registered
  12/06/2003
Points
  1683
24th January, 2007 at 23:58:41 -

Hey on a sec, I just realised YOU did the tutorial. Good job man! It's bloody awesome. I've wanted to do custom movement for years and never found any good tutorials that really took me through simple step by step. Thanks very much.

 
theonecardgame.com

eyeangle



Registered
  12/06/2003
Points
  1683
25th January, 2007 at 00:01:18 -

Just one quick question: how'd you get the background moving seperately to the foreground in your tutorial example?

Also. Do you have any tutorials with ladders? I'm trying to make a ladder in the level. Can you help me out? Somthing not quite working with the gravity and ladders together.

Image Edited by the Author.

 
theonecardgame.com

LIJI

Flava's Smarter Twin

Registered
  29/08/2006
Points
  2032

I like penguins
25th January, 2007 at 06:19:51 -

http://www.clickteam.com/eng/resources/scrolling_tutorial.pdf
Go to the Parallaxing section

 
Service Unavailable

skatekid



Registered
  04/01/2003
Points
  142
25th January, 2007 at 08:03:54 -

For ladders, I use a flag that turns on if the players on a ladder. When it on, disable gravity. Then if the jump button is pressed, turn the flag off, and make him jump.

 
Sticks and stones can break your bones,
but words can get you shot.

eyeangle



Registered
  12/06/2003
Points
  1683
25th January, 2007 at 10:14:47 -

I tried that with the ladders but I still haven't got it right. Can you add it to this example so I can see how you did it. I've made a ladder so you can work off that.

http://eyeangle.sitesled.com/my_pcm.mfa

 
theonecardgame.com

eyeangle



Registered
  12/06/2003
Points
  1683
25th January, 2007 at 19:28:51 -

You'd think it was as easy as:

If "player" is over lapping "ladder" ---------|--------- stop loop Grav, start loop ladder
If "player" is (not) over lapping "ladder" ---------|--------- start loop Grav, stop loop ladder

But what is the ladder loop? That is where I am stuck...


 
theonecardgame.com

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
26th January, 2007 at 00:00:15 -

I don't think it's something that you need a loop for, though you'd need to turn off the normal gravity detection. Perhaps creating a new group for ladder movement and activating/deactivating each one as necessary.

 
http://www.davidn.co.nr - Games, music, living in America
   

Post Reply



 



Advertisement

Worth A Click