User Tag List

Results 1 to 10 of 10

Thread: How to uses lists and grab data

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Bree's Avatar
    Join Date
    May 2014
    Posts
    313
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    How to uses lists and grab data

    Hello!

    I'm trying to learn how to work with lists and I'm stuck on something I'm sure is simple.

    If I create a line in an list by using insert line 1111223334455 after line 0, then I want to set a counter to a random number in that set of numbers, how can I do that? I see I can get the line number index, and all of that but I'm stuck how to grab the data from the line.

    I did try set counter to Line Data but the counter never changes so I must be going down the wrong path.

    Thanks for any help!

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)
    Something like this?
    Attached files Attached files

  3. #3
    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator ProUnicode Add-on

    Join Date
    Jun 2011
    Posts
    628
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Bree's Avatar
    Join Date
    May 2014
    Posts
    313
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hmm not exactly although both of these examples I learned something I didn't know before, so thank you for that!

    Coldfire, on your example the counter spits out numbers I'm not sure where they are coming from. If you have a second could you explain it for me?

    My question, say we put these numbers in the list on line #1 "111122", how do I grab one of those numbers randomly from the pool? The odds are I will get a 1 over a 2 because there is double the chance, but I'm trying to find out how to actually randomly grab one of them and output it to the counter.

    Thanks again all!

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Coldfire's example draws a random number in the range 0-111122

    but maybe you want to pull out only 1s or 2s?

    in single-line setup like this,
    you can use some string manipulation functions

    i.e. you can plug this expression in coldfire's example:
    Val(Mid$(List Line Text$( "List", 0 ), Random(Len(List Line Text$( "List", 0 ) ) ), 1 ) )


    other solutions would be setting each line of the list to a pool number,
    and then drawing a random line from the list

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Bree's Avatar
    Join Date
    May 2014
    Posts
    313
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Yay, thank you so much, that's exactly what I was trying to figure out!! Now for some more testing fun ^_^

  7. #7
    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator ProUnicode Add-on

    Join Date
    Jun 2011
    Posts
    628
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Oh you mean that...

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    May 2013
    Posts
    142
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey Beejers, sounds like you've probably got this working by now but this example demonstrates schrodinger's two methods. I would imagine the method of using a separate line for each number would be best, especially if you want to handle numbers greater than nine at some point (numbers with multiple digits).
    Attached files Attached files

  9. #9
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Bree's Avatar
    Join Date
    May 2014
    Posts
    313
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thank you CoffeeCup!! This is very handy actually!

  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)
    You could also do this with an array pretty easily. This is assuming you don't need the list for any sort of user interaction and all you're doing is storing values in it.

Similar Threads

  1. Custom Lists Example?
    By Maverick in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 11th June 2013, 03:32 AM
  2. Two lists with arrays
    By 2xD in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 8th December 2012, 08:26 AM
  3. Object Lists?
    By MattEsch in forum Extension Development
    Replies: 3
    Last Post: 8th January 2011, 01:04 PM
  4. Comparing Lists for ClickerGuy
    By TreeHugger in forum File Archive
    Replies: 0
    Last Post: 27th October 2007, 02:43 AM
  5. fixing lists
    By grayhuskie53 in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th September 2007, 08:11 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
  •