Is it possible to retrieve the number of frames in an application and place that number in a variable (or use it in a calculation)?
I have had a search around, but cannot find it.
Printable View
Is it possible to retrieve the number of frames in an application and place that number in a variable (or use it in a calculation)?
I have had a search around, but cannot find it.
Since you can't exactly add or remove frames at runtime, can't you just make a global values that you change to have the number of frames?
No need to be snooty. :whistle:
[size:8pt]-StephenL[/size]
Yes, I could, but it would be more convenient if the number of frames could be determined at runtime.Quote:
Originally Posted by LB
The reason it would be helpful is that my game has an intro screen and a game over screen, and all the other screens are 'levels'. Currently, I have a global variable in which I store the number of levels, so that Global events only occur within the game levels and the intro/game over levels. Every time I add level, I have to change the global variable. It's not a massive problem, but I don't know how many times I have added a level, tested the game, and then found that the new level doesn't work correctly because I have not changed the "Number of levels" global variable, so I have to go back and change the global variable.
I could also change my game over frame so that it is frame 2, then I could check for 'if frame number > 2', but that means a bit of recoding.
I can make the changes, but it would be easier for me if there was a way to access the number of frames, hence my question.
Do you know if there is such a facility?
Would it work if you just set the opening screen to jump to your say splash screen frame which you put as the last frame in your application and then there have something like
Start of frame:
Set variable to (number of current frame)
And then jump back to whatever frame your game / editor is. I guess you'll have to adjust the number to maybe (number of current frame)-1 or something depending on what you need.
Actually, that will do the trick so I won't have to manually change a global variable each time I add a level (which is the problem I am trying to overcome).Quote:
Originally Posted by RayMarble
If, at the start of the application, there is a jump to frame X (where X is the last frame) and in frame X I set a global variable to "current frame" as you have stated, then it will always be correct, even when new frames are inserted before the final frame, because MMF2 adjusts the "Jump to Frame" accordingly when new frames are added.
LB, unless I have misunderstood your message, I would have to manually enter the number of the last frame into a global variable every time I added a new frame, which is what I am trying to avoid.
I was bored so I made this example. Don't ask how it works!
http://clickteam.info/looki/Examples/FrameCount.mfa
Requires Overlay Redux and Memory object.
http://www.aquadasoft.com/Memory.zip
http://www.bumderland.com/objects/Overlay.exe
I really don't recommend you to use it. :)
But if you insist...
It was kind of you to do that, but all my MMF2 work gets exported to a SWF, and I don't think those extensions are available for the SWF exporter.Quote:
Originally Posted by Looki
Thanks anway.