FAQ Central
From FusionWiki
This is a very early prototype of the FAQ page that contains questions and answers I collected randomly from the forum and the chat. The purpose of this page is to contain answers to users' frequently asked questions in an organized format. This way, forum clutter can be reduced, and in some cases, multiple similar forum threads can be deleted after information from them have been moved here.
Some categories have already been created, but may change fundamentally. Suggestions are welcome! AdamDobay 22:00, 28 September 2010 (UTC)
Contents |
MMF2 Basics
Can MMF2 make...?
MMF2 Functions
Arrays
Movements
Q: What are Sine and Cosine functions, and how do I use them?
A: See this article.
Q: What's the easiest way to do a repeated sinewave movement?
A: always set a value to (value + speed) mod 360, then use sin(value) * size.
Q: How do I make an object orbit around a moving object flawlessly?
A: Here's an example. If you want to try this on your own: use cos() for the x position and sin() for the y, contrary to what you would think, but this is because of the flipped Y coordinate system.
Q: Can I somehow use the angle and velocity of the mouse's movement in an application?
A: This example by LB compares the previous mouse position to the new one and performs basic angle and distance calculations to find the angle and velocity. However, if you move the mouse too fast then they will get out of sync.
Sub-Applications
Q: When I run my Frame with F7, the sub-application that I have set to load another frame doesn't load.
A: Be sure to run the Application with F8.
Q: How can I make several subapp frames have buttons at the top right to allow for minimizing and maximizing?
A: You can use the Kernel object to select the subapps and minimize/maximize them.
Window Settings
Q: Can I set an MMF2 application to always be displayed on top?
A: Use the Window Control Object.
Events
General
Q: Toggling doesn't work.
A: Look at this thread.
Looping
Q: How much time does a loop last? For example, how much time is five loops? A: One loop is the same as one frame, so if an application runs with 50 frames per second, 5 loops take 0.1 second.
Extensions
What extension should I use for...?
Games
Can MMF make a game where...?
Q: What would be one of the most efficient ways to create a Roguelike room that is randomly generated?
A: Try the Dungeon Object.
Platformers
Q: How can I make double jumps, separate walking and running, slopes or moving platforms in a platformer game?
A: Use the Platform Movement object.
Graphics
Animation
Images
Q: How can I make parts of an image see-through?
A: With the use of Alpha Channels. Check out this tutorial. You can apply alpha channel features from there in MMF2's image editor
Q: How can I break down and import tilesets into individual frames?
A: Use the Fusion SpriteSheet Exporter from Complex-Software.
Other
Q: Is there an efficient way to control zooming in and out in your game?
A: There is a zoom shader that you can use with HWA. For a non-HWA requirement there's the Viewport object. You can also try the Lens object.
Q: Is there anything to replace the built-in Date & Time object if I want a custom analog clock display?
A: Take a look at the Active Clock Widget by Game_Master.
Math
Q: How do I check if a number is dividable by another number?
A: Use 'mod'. If numberA mod numberB = 0 then yes (with 0 being the remainder).
Networking
Q: How can I make downloadable content?
A: The ’’’Download Object’’’ can download a file from the internet and save it on the hard drive – this one is the most useful for downloading new levels or for updater programs. The ’’’Get object’’’ can download a file from the internet (and use POST) and not save it on the computer – instead, you get the file data via an expression. This object is the most useful for web based scripts. For more information check out this forum thread.
Runtime-specific questions
Flash
Q: How do I save user data in MMF2 Flash?
A: The Ini object does this in Flash using cookies. All you have to do is give the INI file a filename (but not folder) when the frame is started, such as "mysave.ini". (When testing this on Windows without exporting to Flash, it'll go into the Windows folder, which is less than ideal but that's where it is if you're hunting for it.)
Q: Is it possible to write Actionscript?
A: Not yet, but it's planned to be implemented soon.
Q: Which version of Flash will be exported?
A: Flash Player 9, Flex 3.0.
Q: Can MP3 files be streamed?
A: Yes.
Q: Can FLV files be streamed?
A: Not yet.
Q: Is it possible to NOT add a Preloader?
A: Yes.
Q: Can Flash load external files?
A: Yes, with the Flash External Files extension. Link: http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=202684
Q: I want to use the Powerful Dialogs Object in Flash.
A: StephenL's Flash Dialogs object can replace the Powerful Dialogs Object.
Q: Can I sitelock my game?
A: Check out this example MFA made by JoKa.
HWA
Q: Is there a list of extensions that work with the HWA?
A: All non-graphical objects should work with the HWA. Graphical extensions that are optimized for HWA include: Active DirectShow, Phizix - Box2D, Screen Capture, Active System Box, Background System Box, Button, Active Picture, Picture, Window Shape, Layer, Patricle Spray, Perspective, Speech Bubble, Text Blitter, Viewport.
When in doubt about whether an extension you have installed is optimized for HWA or not, look in the Multimedia Fusion 2’s Data\Runtime\Hwa\ directory.
Q: What about other objects not listed above? Do they work with the HWA?
A: No third party objects are optimized as there's no SDK yet. Some work, but they might not be as fast (for example the Surface object).
Sound
Q: Can I have MMF2 perform an actions when a playing sound reaches a certain time?
A: You can use the "Compare two general values" expression in the Event editor, like so:
| 1 |
Q: I set a music sample to play at the start of the frame. I have set samples to play over frames, but the music sample only continues to the next frame if I click once inside the application in the first frame. If I do nothing and wait for it to jump to the next frame, the sample stops at the next frame. The second frame has no events that affect the stopping/starting of the sample.
A: Make sure "Do not mute samples if application loses focus" is checked in the application properties.
