User Tag List

Results 1 to 8 of 8

Thread: A workaround method to *sort of* get Alterable Value names at runtime

  1. #1
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,740
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)

    A workaround method to *sort of* get Alterable Value names at runtime

    I've often wished there was a way to get Alterable Value names at runtime, and I've seen other people ask for it too. I've found a method that kind of does it, though with a number of caveats. Depending on what your use case is, this method could vary from 'quite helpful' to 'totally useless'. It's not a 'live' method, in that it requires a bit of background preparation, and won't let you see the names of any random object you spontaneously choose. But it can be useful if there's one particularly important object that you want this for, in which case it may be worth the effort to set up. I'm sharing the method in case others find it useful, or in case anyone has a suggestion for improving it.

    The basic principle is quite rudimentary: paste the altVal names by hand into a list (before runtime), then read from that list at runtime. Now, the thing that'll stop this getting real tedious real fast is ShareX. ShareX is a free screenshot grabber program with loads of features, including an OCR Text Capture mode, which you can assign a hotkey to. Then you just have hit the hotkey, and drag a box over your altVals, like this:



    and in a second or two, it'll show you the resulting text, in a single block (so you can copy it all in one go) with each entry on a separate line (which is perfect for using in a List object). It'll have some typos, but will be readable enough:



    You then copy & paste this text into a TXT file, and get a List or Internal List object to read from it. (An even quicker way may be to paste directly into a List object, though I personally prefer the TXT file method). You can now access that object's altVal names at runtime, by selecting from the appropriate line of the list. In the following example, I've displayed the name of an object's 17th altVal, as well as that altVal's value for a particular instance of the object:






    You can easily use a fastloop to read ALL of an object's altVal names if you like. This has proven super useful to me for debugging purposes. For example, I had two instances of an enemy where one was behaving properly but the other was buggy. I wanted to compare the working one with the buggy one to see what the difference was. I can do this in Fusion's native debugger of course, but these are huge objects, containing almost 250 altVals (I use a single 'meta enemy' object for every single enemy in the game; this lets me reuse code efficiently, but means that each enemy contains altVals of every possible enemy type). So looking through their altVals involves a lot of tedious scrolling, and differences can be easy to miss.

    To make it easier for myself, I've set up 2 hotkeys in my game that will send ALL altVals (both names and values) of a selected object to one of two text files. So I clicked on one enemy, hit hotkey 1 to send its altVals to a file called altValsA.dbg, then clicked the other and sent its altVals to altValsB.dbg I could then use Notepad++'s "Compare" feature to display both instances' altVals side-by-side, with differences automatically highlighted, as shown below. Seeing it like this enabled me to spot the source of the bug in seconds. Very useful!



  2. #2
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    774
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Alternatively, you can just open the any expression editor stuff that will show a dropdown list and use SysExporter to get the entire list as plain text.

    mmf2u_v7SWM0lQ4G.jpg

  3. #3
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,740
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    Nice! That's a great way to get the list than the OCR method! Not as quick as hitting a hotkey, but certainly more accurate.

    (Note: you'll need to right-click the toolbar at the bottom and remove the "Value" column so that you can copy just the names)


  4. #4
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    774
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Or, alternatively, you can use AHK.
    This will get the whole list (as long any expression editor window is open and have the dropdown list) and copy to the clipboard.
    In this example you need to press F1 to capture it.

    Code:
    #SingleInstance ignore#NoTrayIcon
    
    
    #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
    SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
    DetectHiddenWindows On
    DetectHiddenText, On
    SetKeyDelay, -1
    
    
    f1:: ;You can disable this if you'll run from StreamDeck or something
    
    
    WinActivate, ahk_exe mmf2u.exe ahk_class #32770 
    ;This class may change, you'll have to check...
    ;It works without it, but you would have to manually focus on the expression editor.
    
    
    ControlGet, vList, List, , ComboBox1, A
    Loop, Parse, vList, `n  ; Rows are delimited by linefeeds (`n).
    {
        RowNumber := A_Index
        Loop, Parse, A_LoopField, %A_Tab%  ; Fields (columns) in each row are delimited by tabs (A_Tab).
            fVars = %FVars%%A_LoopField%"`r`n"
    }
    Msgbox, "%vList%" ;This will show a popup with the whole list, you can disable it if you just want it on Clipboard instead
    clipboard := vList
    ExitApp

  5. #5
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,740
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    That's terrific, NaitorStudios! One keypress and the entire list is instantly in the clipboard, spelt perfectly! As an added bonus, this is also the only method so far that reads all the unicode characters in my AltVals properly. This is most definitely the method I'll be using. By the way, I don't think the class will change. Fusion's dialog windows seem to be consistently #32770, from what I can tell.

    I think this is an excellent code snippet. Would you mind posting it to the autohotkey thread?

  6. #6
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    774
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Sure, go ahead, just add some credits and we're good
    I've been experimenting a lot with AHK and Fusion

  7. #7
    Clicker 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)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,740
    Mentioned
    133 Post(s)
    Tagged
    0 Thread(s)
    I'll let you post it. And feel free to post any other useful stuff you've conjured up there.

  8. #8
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    774
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Done.

    So, anyone seeing this, you can get more scripts and automation ideas on this thread

Similar Threads

  1. Replies: 5
    Last Post: 11th December 2020, 09:14 AM
  2. Is there way to sort layers in runtime?
    By Jokk3 in forum Fusion 2.5
    Replies: 9
    Last Post: 11th October 2016, 03:38 PM
  3. How can I change names of a alterable value?
    By mollyprolly in forum Fusion 2.5
    Replies: 2
    Last Post: 23rd January 2015, 10:49 PM
  4. Global and Alterable values names
    By Corentin in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 26th February 2007, 12:25 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
  •