User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: How to make object A open door A, and object B open door B?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,558
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)

    How to make object A open door A, and object B open door B?

    Hi everyone, I'm sure this is a noob question, but I spent 15 minutes googling and searching the forums and couldn't find the answer.

    I have a door, and I have an object that should trigger that door to open when the player touches it (let's call it a 'sensor'). I'd like several doors, each with its own specific sensor. I want to create each door and sensor combination within the event editor, rather than manually placing them in the frame editor. But I can't figure out how to 'link' the sensors and doors properly, so that sensor A will open door A, but not door B

    This is what I've done so far:
    • created several doors
    • each door is an active object with "open" and "closed" animations
    • created several sensor objects
    • each door and sensor has an alterable value called "ID"
    • the "IDs" of the doors are 1, 2, 3....
    • the "IDs" of the sensors are also 1, 2, 3
    • at the moment, when I touch a sensor, it opens ALL of the doors (ie. changes their animation state)


    However, I don't know how to create an event that will check for the ID of the sensor, and open the door with the corresponding ID, while leaving all other doors intact. The logic is dirt simple, of course, but I just don't know how I go about coding it in event editor.

    Thanks in advance.



    PS - by the way, how do you get an avatar on these forums? When I go to "settings\edit avatar", it only has one option, which is "do not use an avatar"

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator ProPatch Maker
    coreyschroeder's Avatar
    Join Date
    Apr 2014
    Location
    ATX
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey there,

    First of all, if you are unaware of Mr. Hull's MMF example site, I highly recommend checking it out.
    That dude is a legend around here.

    He's got a "Door Example" on his website that may be of some help to you - http://www.castles-of-britain.com/mmfexamples-c.htm
    Look towards the bottom of the page for this file.

    **Ps you should attach your mmf file, so we can all look at your events and see what exactly is going on - without seeing exactly what you did, the suggestions below may be of no benefit to you**

    A few quick things that come to mind:

    - Create statements that limits the functionality of your doors - Instead of saying "If active object touches sensor one, open door one", say: "If active object touches sensor one, BUT DOES NOT TOUCH sensor 2, 3, 4, etc, open door one.." You can simply "insert" additional check statements, then "negate" them to add in this type of check functionality.

    - You may also want to look into flags. Something like - Flag On = Door Open, Flag Off = Door Closed.. If active object is is touching sensor one, door 1 flag = on, door 2 flag = off, door 3 flag = off, door 4 flag = off, etc...

    - If you have something like either of these coded out, but the doors are still all opening, then I would say it sounds like you are using multiple instances of the same door/sensor object. Perhaps try individual objects for these items?

    Hope this helps!

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator ProPatch Maker
    coreyschroeder's Avatar
    Join Date
    Apr 2014
    Location
    ATX
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also - Avatars can be found in "Settings" > "My Settings" > "Edit Avatar".
    Below the part where it talks about "Do not us an Avatar" there is a section that says "Custom Avatar", where you can input an image url, or search a local drive for your image file.

  4. #4
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    @coreyschroeder *Profile Picture discussion:
    He can't because he hasn't got a registered product on the site. Registering a product will give you an option to have a profile avatar and a signature and (I think?) more.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,558
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the response.

    Quote Originally Posted by coreyschroeder View Post
    He's got a "Door Example" on his website that may be of some help to you - http://www.castles-of-britain.com/mmfexamples-c.htm
    Look towards the bottom of the page for this file.
    I tried that Door Example before I posted here, but it's unfortunately not relevant to my problem, because the keys don't 'belong' to any door in particular (ie. any key can open any door).

    - Create statements that limits the functionality of your doors - Instead of saying "If active object touches sensor one, open door one", say: "If active object touches sensor one, BUT DOES NOT TOUCH sensor 2, 3, 4, etc, open door one.." You can simply "insert" additional check statements, then "negate" them to add in this type of check functionality.
    That still seems like a somewhat manual method to me, since each door needs to be hard-coded in a sense. I'm building an engine, and I'd like it to be able to automatically handle any amount of doors I throw at it in the future. Besides, this doesn't actually address my problem, which is: *how do I tell it which door is door 1 or door 2 in the first place?*

    I guess I wasn't clear enough in my first post in stating that my doors are created in the code, not in the frame editor


    - If you have something like either of these coded out, but the doors are still all opening, then I would say it sounds like you are using multiple instances of the same door/sensor object. Perhaps try individual objects for these items?
    Yes, I think I have multiple instances of the same object, because I've created them via events, since I want them the doors to to be created dynamically by the engine, and not manually in the frame editor. I guess my question boils down to:

    -once I've created a new object using the "Create new objects" action, how do I keep track of them effectively? I'm sure this isn't hard, but I can't figure it out.

    **Ps you should attach your mmf file, so we can all look at your events and see what exactly is going on - without seeing exactly what you did, the suggestions below may be of no benefit to you**
    There's not really much to attach, because I don't even know where to start. But here's what I've got:



    As you can see, I've created doors and sensors with unique IDs, but I have no idea how to reference those IDs later on. Or, to be precise, I know how to reference the IDs of a sensor when it's overlapped, but not of the doors.



    Quote Originally Posted by BartekB
    He can't because he hasn't got a registered product on the site. Registering a product will give you an option to have a profile avatar and a signature and (I think?) more.
    Ah, I should have guessed. I bought Fusion via Steam, and the forum doesn't recognise us as real users (ie. we're unable to register). It's annoying to spend hundreds of dollars on a product and yet not even have access to basic forum priveleges. Oh well, it's not the end of the world, I guess. Cheers.

  6. #6
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    You can do "If Button's ID value equals to Door's ID, open the selected door"
    Sorry I don't have time now and I'm tired, will explain this tommorow or even give you an example.
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,558
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Thanks Bartek, I just attempted that, though without success, so I look forward to your explanation.

    This is what I added:


    This is what happens:
    -I have 3 sensors on-screen (the debugger confirms that they have "ID"s of 1, 2, and 3)
    -I have 3 doors on-screen (the debugger confirms that they also have "ID"s of 1, 2, and 3)
    -If I move the player over sensor #1 or sensor #2, nothing happens
    -If I move the player over sensor #3, ALL doors open.




    PS - does anyone know why my door icon has that little "B" in the black box on it? It just appeared there, and I have no idea why

  8. #8
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,558
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    By the way, just to be clear, when I added the event above (#297), I deleted the #296 event that is shown in my earlier post (just saying this in case anyone thought they were conflicting)

  9. #9
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Yeah sometimes Fusion makes a fuss about the ID and sometimes check the event for every single object / door.
    Here is a quick fix, not commented though, and I think it is easy to learn. If you want me to I will comment on the example
    ForEach ID Example.mfa
    Edit: You need to have Fusion 2.5 in order to open this file

    Editty edit: If you want to use fastloops to create the keys and doors, untick the "Create on start" option on both objects

    Eddity Eddy Edit: The door has a "B" in it's icon because it has a 'Behavior' set to it. to view that behavior go to the event editor, right click the icon and put the mouse over Behaviors and click one of the behaviors. Or just select the object in the frame editor and go to Events tab and remove the behaviors if they are not important.

    I had that problem too with the IDs, it's frustrating...
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  10. #10
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,558
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Dzięki!

    ok, so I basically was doing the right thing, but it needed to be in a for each loop rather than on its own - is that right? I'm confused as to why. Are you able to explain why that is necessary? I don't quite understand the logic.

    Anyway, I'll have a go now, and report back.

    Quote Originally Posted by BartekB View Post
    Editty edit: If you want to use fastloops to create the keys and doors, untick the "Create on start" option on both objects
    Could you explain this please? It makes sense, I guess. But you used fastloops in your example without unchecking those boxes, and it seems to work fine that way too.

    Thanks for your help.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 8
    Last Post: 4th January 2017, 05:41 PM
  2. Replies: 7
    Last Post: 20th December 2011, 07:27 PM
  3. Box2D - Rotating Door for Jacob
    By netninja in forum File Archive
    Replies: 6
    Last Post: 2nd July 2010, 06:41 AM
  4. Up Down Door
    By TwistidChimp in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 23rd April 2007, 01:12 PM
  5. opening door with key
    By will134 in forum The Games Factory 2 - Technical Support
    Replies: 7
    Last Post: 11th October 2006, 03:37 PM

Posting Permissions

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