User Tag List

Results 1 to 10 of 10

Thread: Very simple code won't work

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Dec 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Very simple code won't work

    I have a simple code of:

    If Value "Locked" of Object 1 = 0 then move object +1 to the right

    If Object 1 overlaps Object 2 then set set Value "Locked" of Object 1 to 1 (stopping the movment)

    If Object 1 is not overlapping object 2 then set "Locked" to 0 (starting the movement again)

    This works fine if I move Object 2 out of the way. However, if I DESTROY object 2 while object 1 is overlapping it, the value "Locked" doesn't change. (I made sure of it by using a counter)

    Anybody know what's going on?

    Thanks

  2. #2
    Clicker Multimedia Fusion 2

    Join Date
    Dec 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it seems as though if an object isn't created on the screen then other objects' code won't interact with it? That's what I'm guessing from doing a few tests.

  3. #3
    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)
    Can't you just eliminate that value and say:

    Object 1 IS NOT overlapping Object 2:
    -> Add 1 to x position of Object 1

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Dec 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya I tried that and it didn't change anything.

    It seems though that if I have a copy of Object 2 when I destroy it then object 1 will move. That's why I'm thinking that you need a copy of an object on the field in order for a code to interact with it, even if that code is that it isn't being overlapped by anything.

  5. #5
    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)
    Well I'll be. Looks like you're right. But simple enough solution - just create an extra instance of object 2 and throw it offscreen.

    Good find. That might save me hours of frustration in the future.

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Dec 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya that's what I did. Unfortunately that causes complications with other parts of my game (ID loops interacting with other objects and such). I don't really see an alternative though. Oh well.

    Thanks for the input

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    bybyblue's Avatar
    Join Date
    Sep 2011
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I'm correct this is what you want.

    -always
    +Set Object 1 Value "Locked" to 0

    -If Object 1 overlaps Object 2
    +Set Object 1 Value "Locked" to 1

    In that order.

  8. #8
    Clicker Multimedia Fusion 2

    Join Date
    Dec 2012
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha now I feel silly for not doing that in the first place. I guess I was just caught up in the original problem of the destroyed object :P

    Thanks for that

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    bybyblue's Avatar
    Join Date
    Sep 2011
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Np, glad to help.

  10. #10
    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)
    Hah, can't reference a non-existent object, so you reversed it - awesome!! Wonder if I'll ever master the basics of programming.

Similar Threads

  1. Having a real hard time getting this climb code to work...
    By Almightyzentaco in forum Fusion 2.5
    Replies: 1
    Last Post: 21st September 2014, 09:16 PM
  2. Very simple code won't work.
    By D_Light in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th June 2013, 11:44 PM
  3. Very simple code doesn't work for some reason
    By D_Light in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 16th February 2013, 09:43 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
  •