User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: Making Treasure Chests

  1. #11
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Sep 2010
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have a question about treasure chests.

    Assuming I use global values assigned to the properties of the chest, the way I have my chests set up are as follows:

    I place a "hit box" within the frame that just looks like a square shadow at runtime. This hitbox has a behavioral event that spawns a treasure chest on it at a certain layer (since my levels are layered). I can then duplicate this hit box as much as I want and have that number of chests.

    However, I have run into a problem here: The chests are either all opened, or sometimes, the most recent chest created in the frame remains open and all others remain closed....or the most recent remains closed while all others remain open.

    If I assign global values to the box, for the number of chests within the frame (in this example, 5)...and set all global values to 0 - for closed and 1 for open, how do I tell the chest to change a specific value for the chest, keeping it forever opened?

    for instance...I have a chest at x 200 y 200, and others at different locations throughout the frame, and I am near the x 200 y 200 and 'open it', how do I keep the remaining chests closed between frames until I go and open them, and keep x 200 y 200 open and so on, without creating a 'mess' in the event editor? Also, will this solve the "all but one box is affected" bug I have been getting?

    Sorry if this question seems drawn out.

  2. #12
    No Products Registered

    Join Date
    Sep 2014
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks ^_^

  3. #13
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    944
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ZayLong View Post
    Ok but how do i make it so that when i leave a frame and come back to the same one it will still be open? I know I sound like a n00b but im not, ive been using the program for about 2 yrs now, but i havent tried somthing like this before, i want to make it so that i dont have to use global variables to make the chests stay open.
    You may have to, it seems to be the best way to handle what you want. Especially jumping from frame to frame.

  4. #14
    Clicker Fusion 2.5
    Del_Duio's Avatar
    Join Date
    Sep 2008
    Location
    Cygnus X-I
    Posts
    944
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That's a tough one. I usually try to have maybe 1 chest on the frame at any one time so it's easy to use a global array to keep track of its open / closed state. If there's a room that has more than 1 chest I use clones that don't count as the same active object and do it that way.

  5. #15
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    Ziplock's Avatar
    Join Date
    Oct 2013
    Posts
    448
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to spread an ID value in the chests to make them individual.

    Give first value in chest "ID" and second "Open." Then make two frames in your chest's stop animation: First with the open sprite and the other with the closed.


    Always:
    -> Spread value 0 in "ID"

    Always:
    -> Start Loop "Treasure Chest ID" NObjects( "Chest" )

    On Loop "Treasure Chest ID"
    + ID of "Chest" = LoopIndex of "Treasure Chest ID"

    -> Force Animation Frame to Alterable Value "Open" of "Chest"

    TO TEST, set a "Player" object to 8 directions and make a bunch of chests. The "Collision" action is whatever opens your chest.

    On Loop "Treasure Chest ID"
    + ID of "Chest" = LoopIndex of "Treasure Chest ID"
    + Collision between "Player" and "Chest"

    -> Set Alterable Value "Open" of "Chest" to 1

    Use "On Loop" 'Treasure Chest ID' and "ID of 'Chest' = LoopIndex" lines for anything related to individualizing the chests.
    Don't use line "Always Spread Value" with any other line of code - bug in mmf2.
    Attached files Attached files

  6. #16
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Sep 2010
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great example I'll definately use it!! Thanks Now I just need to save these values to an array so that they stay open once I leave and re-enter the frame

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Treasure Scratch
    By Jeff in forum iOS Released Games & Apps
    Replies: 1
    Last Post: 10th November 2011, 06:17 PM
  2. Replies: 0
    Last Post: 10th November 2011, 04:51 PM
  3. How to randomly populate treasure chests?
    By timcclayton in forum Multimedia Fusion 2 - Technical Support
    Replies: 27
    Last Post: 13th November 2010, 12:08 AM
  4. Random Treasure Example for timcclayton
    By TreeHugger in forum File Archive
    Replies: 3
    Last Post: 11th November 2010, 10:57 AM
  5. Random Treasure
    By tonycrew in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th May 2010, 04:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •