User Tag List

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

Thread: Delaying a player from spawing immediately

  1. #1
    Clicker Fusion 2.5Android Export ModuleSWF Export ModuleXNA Export Module
    jbrown2177's Avatar
    Join Date
    Dec 2011
    Location
    VA
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Delaying a player from spawing immediately

    Hey, I've searched all around on forums and I haven't found anything close to this. After my player is killed create object is immediately done, I would like to delay this by a few seconds before another player is created. I created a timer and played around with activating it after the player is killed and I can't get it to activate the timer countdown. Logically I know what I want to do, I just don't know how to put in MMF2

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Here you go.
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5Android Export ModuleSWF Export ModuleXNA Export Module
    jbrown2177's Avatar
    Join Date
    Dec 2011
    Location
    VA
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I'll check it once I get home

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2010
    Location
    Yonkers, New York, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm confident that Chris' other reply will help, but also consider encouraging abstinence.



    It doesn't seem like a killer problem.

    Create a counter named Spawn Delay.

    On the condition that kills the player, set Spawn Delay to one.

    Event: Every second, If Spawn Delay > 0, add 1 to Spawn Delay.

    Event: If Spawn Delay = 3, and number of Player = 0, create Player. Set Spawn Delay to 0.

  5. #5
    Clicker Fusion 2.5Android Export ModuleSWF Export ModuleXNA Export Module
    jbrown2177's Avatar
    Join Date
    Dec 2011
    Location
    VA
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Grim_Jester View Post
    I'm confident that Chris' other reply will help, but also consider encouraging abstinence.



    It doesn't seem like a killer problem.

    Create a counter named Spawn Delay.

    On the condition that kills the player, set Spawn Delay to one.

    Event: Every second, If Spawn Delay > 0, add 1 to Spawn Delay.

    Event: If Spawn Delay = 3, and number of Player = 0, create Player. Set Spawn Delay to 0.

    Where is "If Spawn Delay >? I don't see where I can put that from that condition

  6. #6
    Clicker Fusion 2.5Android Export ModuleSWF Export ModuleXNA Export Module
    jbrown2177's Avatar
    Join Date
    Dec 2011
    Location
    VA
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK it works Grim...However, my question is why am I adding 1 to the Spawn Delay?

  7. #7
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2012
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because "Spawn Delay" is a variable that is holding time in it. It's essentially seconds.

    You could call it SecondCounter instead of Spawn Delay if you wanted.

  8. #8
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Did you look at my example Jbrown?

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2010
    Location
    Yonkers, New York, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aylictal was correct, but let me provide some more detail to what I suggested.

    In my example, you initially set Spawn Delay to 1 when the player object is destroyed. Setting it to 1 is used to start the timer with another condition later.

    The condition is looking for Spawn Delay to be more than 0. This condition is true/active when the player is destroyed, because we set it to 1. Now that it's true, we tell the counter to start counting (in this case, with seconds). We are having MMF 2 add 1 to Spawn Delay every second.

    When the count of Spawn Delay = 3, that means that two seconds have passed since the player object was destroyed.

    Why 2? When we set it to one when the player was destroyed, that was done instantly. A second later, we increased it to 2. Another second later, it's at 3, the player object is created, and Spawn Delay is reset to zero in case we have to do it all over again.

    If you wanted the player object to be created 5 seconds later, you would check to see when Spawn Delay = 6 instead of 3.

    I hope this helps.

  10. #10
    Clicker Multimedia Fusion 2

    Join Date
    Jul 2010
    Location
    Yonkers, New York, USA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chris Burrows' solution is definitely more elegant, but perhaps harder to understand. You should take a look if you haven't already.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Beta 33 [BUG] objects spawing in wrong place.
    By BrashMonkey in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 29th August 2012, 08:04 PM
  2. Delaying events?
    By Tsun in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th June 2011, 02:23 AM
  3. Application is delaying to start.
    By Nyc in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 11th June 2011, 03:36 PM
  4. Sub-app gains focus immediately?
    By Namida in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th April 2010, 11:20 AM
  5. delaying the next event
    By delusan in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 25th September 2007, 05: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
  •