The Daily Click ::. Forums ::. Klik Coding Help ::. Converting from Cellosoft Fastloop to MMF2 fastloop
 

Post Reply  Post Oekaki 
 

Posted By Message

Chrisbo



Registered
  02/01/2002
Points
  794
5th January, 2007 at 05:03:59 -

Hey, a buddy of mine got MMF2 (which I really like, I'm going to get it) and I've been using it to convert a game from MMF 1.5. I used Cellosoft's Fastloop object and need to convert to the built in fastloops. The problem I am having is that the cellosoft fastloop has the Loop Step action where you can manually move the loop to the next step, where MMF2 doesn't (as far as I can tell). The actions I'm going for are roughly this:

Object A overlaps object B
- Set dir object B to Val(List Select$( "Object Coordinates" )) <-- the list object holds numerical direction values 1-32
- Set X pos Object A to Current X Position + 32
- Set loop to current step + 1

How do I do this? Thanks,
Chris

 
hay

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
5th January, 2007 at 07:45:28 -

Well I am guessing the "loop step" is just defining how many loops you do. So if you looped an event 100 times, with a step of 1, you would get 100 code loops, and if you had a step of 2 you would have 50 loops right? If that is the case you could have an infinite loop managed by a condition. Lets call counter 1 our predefined number of loops and counter 2 our step value, and counter 3 our actual loop value. You will want your loop event to occur when - (counter1*100)/(counter3)+1>100 I have multiplied by 100 here because it solves the problems with decimals. Also I have added 1 to counter 3 so that a) the final loop actually happens and b) stop division by 0. In that event you want to increment counter 3 by counter 2 to show that the event has taken place, and your new loop value gets incremented by your step value. Hopefully that makes some sort of sense, just to make it a bit easier to see

//looping event
If ((counter1*100)/(counter3)+1)>100
Loop
- Do looping events
- Add to counter 3 val counter 2

//step incrementing event
Object A overlaps object B (for example)
- Set counter 2 to val counter 2 + 1


//start loop event
On event that starts loop
-set counter 3 to 0
-set counter 2 to the step value
-set counter 1 to the number of loops

I am not sure if this method is necessary though, perhaps mmf supports the step feature?

Image Edited by the Author.

 
http://create-games.com/project.asp?id=1875 Image


David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
5th January, 2007 at 09:10:33 -

You can set the loop index to loop index("nameofloop") + 1. (This is assuming that "loop step" sets the current step of the loop rather than how many times to run, though - I'm not certain which it was.)

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

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
5th January, 2007 at 09:29:18 -

Yes, DavidN makes more sense lol. You would have given each of your loops a name, so if you called a loop "loop1", on the event you wish to increment the loop step you will select fast loops > loop index from the special conditions, then you will be asked to insert the name of the fastloop you are referring to (in this case "loop1"), then you will be asked for the new value, which is just LoopIndex( > Enter string here < ) +1, where you replace the > enter string here < with the name of your loop.

 
http://create-games.com/project.asp?id=1875 Image


Chrisbo



Registered
  02/01/2002
Points
  794
6th January, 2007 at 02:20:08 -

Hey thanks for the replies. I was hoping to use the Loop Index ("Name of Loop") +1, but it says it contains mixed numbers and variables or whatever, because it classifies the "name of loop" as text but the +1 as numerical.

I think I need to play around with it some more, because now I'm having more problems with MMF2 not moving to the next line on the list object I'm using and acknowledging the data in that line, so my problems run deeper than just the fastloops. Ugh this sucks. The game was basically finished until I opened it in MMF2, now this is all f'ed up. Maybe I'll just go back to 1.5 and finish it in there :\

 
hay

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
6th January, 2007 at 06:04:31 -

That's odd, because LoopIndex("Name of loop") is a numerical value. You must be doing something wrong. Remove the spaces perhaps? And I'd say it would indeed be better if you'd continue in MMF1.5

 
This space is for rent

Werbad



Registered
  18/09/2002
Points
  235
6th January, 2007 at 07:51:59 -

Why do you want do manually increase the loopindex? It is automatically done at the end of the eventlist

 
n/a

~Matt Esch~

Stone Goose

Registered
  30/12/2006
Points
  870

VIP Member
6th January, 2007 at 10:23:01 -

I think he is trying to skip a loop by the looks of it. LoopIndex("name of loop") +1 works. It is a bit picky about the syntax. Maybe you entered it into the loop name rather than the value? I have just demonstrated it on an always event in this file http://www.acecs.plus.com/fastloop.cca

Image Edited by the Author.

 
http://create-games.com/project.asp?id=1875 Image

   

Post Reply



 



Advertisement

Worth A Click