User Tag List

Results 1 to 9 of 9

Thread: Global Values & Alterable Values with same names

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall CreatorUnicode Add-on

    Join Date
    Jul 2006
    Posts
    1,017
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Global Values & Alterable Values with same names

    I was wondering if it is known that a name for a variable only can be given to a Global Value or Alterable Value. It's possible to choose one name for both values.
    But for example if I have a Global Value named Spread and an object also has an Alterable Value named Spread the Expression Calculator reports Syntax error.

    That's an odd behavior, because MMF let me define the varibales with the same name. Is this meant to be so?

  2. #2
    No Products Registered

    Join Date
    May 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know, I've never tried to make a Global Value and Alt.Value with the same name...
    If (for example) I used "Shoot" and wanted to do create the same name I do "Shoot_01" and on...

    P.S why do you want to have 2 Values the same name?

  3. #3
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,008
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    It is indeed an accidental design flaw. I stumbled across this with IGX, I was using 'GalaxyType' as a global value and also 'GalaxyType("GalaxySettings")' as an Alterable Value, it would cause MMF2 to read the global value first. I also noticed with two actives that had the same alterable value. In the end I just reiterated all values and strings to ensure none where the same.

    Mind you, MMF2 can't really be blamed for this, if you was coding in any language you couldn't define two variables with the same name anyway
    Want to learn Clickteam Fusion 2.5?




  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall CreatorUnicode Add-on

    Join Date
    Jul 2006
    Posts
    1,017
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @LittleTinyBabyMan
    It was just a coincidence. But because...

    Quote Originally Posted by Danny View Post
    Mind you, MMF2 can't really be blamed for this, if you was coding in any language you couldn't define two variables with the same name anyway
    ...every object that can have Alterable Values can use the same names. They are assigned to the specific object. So maybe it doesn't matter if the Global Values have the same names. I thought maybe there are actually the two values in the background but the Expression Calculator made a mistake. But I don't know.

  5. #5
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,008
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    AFAIK MMF2 reads all values in alphabetical order when looking up those values, which is why in some technique/tutorials you will see them write "for efficiency and speed use unique values".
    So as an example, it's better to have 3 like this:

    Speed_
    Accel_
    Decel_

    as opposed to

    CarSpeed_
    CarAccel_
    CarDecel_

    That's only from what I've read, I could be wrong but I'm pretty sure it was mentioned by Y or F that's why it stuck with me. So for future reference I try and use unique identifiers for each variable, I also try not to cross-identify whether using individual objects or global values.

    Also, I don't know whether you missed above in my first post, I used GalaxyType("GalaxySettings") and GalaxyType("GameSettings") which caused an issue with the final output, this was how I initially concluded it wasn't wise to use similar/exact values for more than one object/global value.
    Want to learn Clickteam Fusion 2.5?




  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When naming Global Values, i allways put a "GV_" first like:

    GV_GameMode_
    GV_Score_
    GV_Level_

    This way i know there wont be any problems with referrances, and i can easily spot Global Values when skimming through a large Event List.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall CreatorUnicode Add-on

    Join Date
    Jul 2006
    Posts
    1,017
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Danny View Post
    Also, I don't know whether you missed above in my first post, I used GalaxyType("GalaxySettings") and GalaxyType("GameSettings") which caused an issue with the final output, this was how I initially concluded it wasn't wise to use similar/exact values for more than one object/global value.
    Ah, now I understand. That's really weird confusing... Were GalaxySettings and GameSettings the same type of an object?
    Maybe it's better to name the values as you described above. But it can be confusing if I have 10 types of enemies/different Actives and the Alterable Values don't can be named as "Health", "Ammo" and so on for all objects without pre- or suffix...


    @King_Cool
    That also seems to be a very good idea!

  8. #8
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,008
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Gustav View Post
    Ah, now I understand. That's really weird confusing... Were GalaxySettings and GameSettings the same type of an object?
    They were both Active Objects that I used as placeholders outside of the frame for storing, saving/loading game values.

    I think it didn't help with me referencing some of the objects also as "GalaxyType" so there was alot of 'galaxytype' variables being thrown around. However, all my enemy fleets used just standard:
    ID
    Health
    XCOR
    YCOR (co-ordinates)

    and a series of other alterable values that were the same and they worked out ok. It was strange but as I said, it gave me incentive to just remember in future to try and use unique values wherever possible.
    Want to learn Clickteam Fusion 2.5?




  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall CreatorUnicode Add-on

    Join Date
    Jul 2006
    Posts
    1,017
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems to be more safe. Anyway, thanks for your (all) help.

Similar Threads

  1. Total number of Global Alterable Values question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 16th May 2012, 11:08 PM
  2. Display values on screen from Alterable Values
    By mikeh in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 13th May 2008, 02:59 PM
  3. Global and Alterable values names
    By Corentin in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th February 2007, 12:25 PM
  4. Negative values in a List, and Global Values
    By aidmm in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 20th January 2007, 07:08 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
  •