User Tag List

Results 1 to 10 of 10

Thread: Alterable Strings as Alterable Values?

  1. #1
    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)

    Alterable Strings as Alterable Values?

    Hi
    In my current project im running dangerously low on Alterable Values.
    And im wondering if it would be possible to use Alterable Strings the same way as one would use Alterable Values?
    Would it be somewhat 'slower' to use AltStrings as AltValues ( than just using AltValues )?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can, using Str$(value) to convert to a string, and Val(string) to convert to a number. It would be slightly slower, but probably not noticeably.

    The ValueAdd Object is a good extension for adding infinite alterable values to objects.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Even alterable strings as strings are slower but thanks to code optimisation you are able to run on maximum FPS without any issues but it's tricky.

  4. #4
    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)
    Jaffob, im not comfortable using the ValueAdd object since its not supported across all build types/ exporters.

    Fanotherpg, how is this tricky?
    How can i do this?

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I badly implemented them to my engine I lost about 100 FPS. Just follow general fastloop/group trick. Anyway any chances to test your engine? Out of curiosity as competition lol.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,300
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Check that the values you're storing really *need* to be alterable values - you may be able to store some of them in globals/arrays/etc instead.
    eg. If you only have one of an object type, such as a single "Player" object, the chances are *none* of its values really need to be stored as alterable values.
    eg. If you use alterable values to store constants, such as the maximum health/speed of an enemy, you could just use a single alterable as a pointer to look up those other values from an array.

    The easiest solution is likely to be to re-use the same alterable values for multiple purposes. For example, if you "always" use an alterable value to check the distance between the object and something else, once that check is done, you can re-use the same alterable value later on in your code, to do something else (include both uses in the value name to avoid confusion).

    If you're storing positive integers with a known maximum value, it's also possible to "pack" several values into a single alterable value, either using string functions or pure maths (the way MMF2 stores Red/Green/Blue in a single color index - in fact, if you have 3 values that are always integers in the range 0-255, you could just use the built-in color functions).

    You could even pair up your objects with additional storage objects (the way you would with detectors), but given the amount of trouble most people seem to have with handling multiple instances, that should probably be a last resort unless you really know what you're doing.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also you can pack several values in one like RGB muddy mentioned (you can even spend part of object graphics to store data) anyway other way is by diving like XXYY /100 gives XX and XXYY - (XXYY/100)*100 will give YY. But that's what Muddy ment by Maths (i Think).

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Aug 2006
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Limiting values to a certain amount of digits and storing in RGB colors is fine i guess and a interesting way to store more data but at the same time it seems a bit over the top.

    If you are using alterable strings you could just use the string parser/tokenizer extensions which seems available for most runtimes and then have csv values. That way there would be no limitations and you can have many all in the same string.

  9. #9
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,003
    Mentioned
    20 Post(s)
    Tagged
    2 Thread(s)
    You could quite easily pack quite a few alterable values together and use a delimiter such as # to separate them? If push comes to shove you could always use INI files as a backup but an array is always possible. Arrays and INI files are supported by multiple exporters! If you needed to though using Strings for Alterable Values is not a bad idea, you would have to use Str$ and Val for all expressions but unless you run these in a loop or fastloop I very much doubt you will see any lag from it...
    Want to learn Clickteam Fusion 2.5?




  10. #10
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,970
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I personally would just use an array. The standard array object should be compatible with everything.

Similar Threads

  1. Alterable Values in Strings & best way to display
    By rubes in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 5th May 2012, 11:01 PM
  2. Arg, strings are still missing Alterable Values
    By Blizna in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 8th December 2011, 01:39 AM
  3. Alterable Values for strings?
    By Jase in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 12th October 2011, 10:12 PM
  4. Alterable Values and Strings
    By Novabrain in forum Extension Developers Lobby
    Replies: 4
    Last Post: 21st November 2007, 01:11 PM
  5. Alterable Strings and Alterable Values limit :(
    By Pedro Almeida in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 13th October 2006, 06:38 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
  •