The Daily Click ::. Forums ::. Klik Coding Help ::. Functions in MMF
 

Post Reply  Post Oekaki 
 

Posted By Message

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
12th January, 2011 at 13:26:10 -

What would be the best way to make functions in MMF?
One of the ways i can think of is to call 1 fast loop and for parameters set variables to an object. And then on that fast loop use the variables parsed as it's parameters.

Im not sure if i made that make any sense.. In a programming language like python you could do this:

def movePlayer(param1, param2, ect):
setPlayerXY(param1, param2)

In MMF you would call a fastloop named "movePlayer", and then set the param1 and param2 to the x and y values, and then on the condition:

on fastloop "movePlayer"
set player x to the variable param1
set player y to the variable param2

Hope that makes sense... But is there a better way to do this, will appreciate your help

Edited by Zephni

 
dont make me divide by zero...

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
12th January, 2011 at 13:30:41 -

Deja vu!

http://create-games.com/forum_post.asp?id=282012&show=all

In that thread, Strife mentioned a couple extensions that appear to do that. If you don't want extensions, my suggestion is what you suggested.

 

  		
  		

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
12th January, 2011 at 14:29:22 -

So... in other words, no parameters with functions?

 
n/a

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
12th January, 2011 at 17:48:58 -

Looks like the best way is to use the variables from an object to parse the parameters to the fast loops.

The fast function object seems to be able to only use one parameter.. which sux...
Another idea is to use the Lua object to call functions... sounds weird but it would work, you can call them inside MMF. Wow i'm awnsering my own questions ? :s

Edited by Zephni

 
dont make me divide by zero...
   

Post Reply



 



Advertisement

Worth A Click