User Tag List

Results 1 to 8 of 8

Thread: Not sure if I need to use "mod" or??

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Not sure if I need to use "mod" or??

    Ok here goes, I have a counter and if you click on the + object it adds one to the counter and if you click on the minus object,..you guessed it,.it subtracts one from the counter. This counter will control the levels of the game.

    #1. What I'm looking to do is change global values using this counter, but I don't want to use 100 lines of code. Example: counter = 1 do this,..counter = 2 do this and so on. Is there a way of using one or 2 lines to do this using "mod"? If so what would be the expressions? I want to add 1 or subtract 1 from the global values based on the counter value.

    #2. I also have a "best level" counter that saves to an INI also. Example: if the player is on,..lets say level 8,.I would like above counter (Level Counter) only able to reach level 8 and stop. The player can play level 1 through 8 if they want. If they get to level 9 or more they can play those levels only.

    Thank you

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #1 Wouldn't be easier to add/substract directly from the global value instead and then just "Always > Set Counter to Global Value"?

    #2 You could use "Always > Set Counter to Min (Counter Value, "best level" Value)"

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Chrille,
    #1 works, thank you.

    #2 however doesn't. The reason is that when a player plays the game and finishes for example level 3,.I'm saving the number being 3 to an INI. If I set the "level counter" to always " Min value of the "best level",.the player won't be able to select a level they want to play. In this example 1 through 3,.but no higher until the next level is beat. Unless I'm misunderstanding you?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, since you are now using the Global Value to control level number, you should change that instead. So let's say the "best level" value is 3 and that your events look something like this:

    Code:
    + User clicks "+"
    - Add 1 to Global Value
    
    + User clicks "-"
    - Sub 1 to Global Value
    If you add this event after those two:

    Code:
    + Always
    - Set Global Value to Min (Global Value, "best level")
    The Global Value will always be within the range of 0 to 3. If you change the event to this:

    Code:
    + Always
    - Set Global Value to Max (1, Min (Global Value, "best level"))
    The range will be between 1 and 3.


    You can use the mod operator as well. Then you'd probably want to change the code to:

    Code:
    + User clicks "+"
    - Set Global Value to (Global Value mod "best level") + 1
    
    + User clicks "-"
    + Set Global Value to Global Value -1
    
    + Global Value = 0
    - Set Global Value to "best level"

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Excellent,.thank you. I will give it a shot.....

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Chrille, I sent you a PM.....

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    KLiK-iT's Avatar
    Join Date
    Sep 2011
    Location
    New Jersey
    Posts
    2,852
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sorted. Thank you Chrille...!!

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glad it works

Similar Threads

  1. Replies: 0
    Last Post: 29th October 2015, 08:42 AM
  2. Replies: 6
    Last Post: 18th August 2015, 02:23 AM
  3. "Cannot load joystick2.mfx" when "Compress the runtime" unchecked. Fine when checked.
    By DistantJ in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th September 2013, 09:44 PM
  4. "Rendertarget ping/pong" and "Pixel shaders" Can TGF2 do this?
    By CloudExSolider in forum The Games Factory 2 - Technical Support
    Replies: 13
    Last Post: 7th April 2013, 08:21 PM
  5. Issues with "Clickteam Movement Controller" and "Runtime" Object
    By jimmyorpheus in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 29th November 2011, 07:10 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
  •