User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: How to reference a string when extracting a value from an object?

  1. #1
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)SWF Export Module (Steam)

    Join Date
    Nov 2014
    Location
    Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to reference a string when extracting a value from an object?

    Hello there! So I have a game that uses an interesting invisible grid system to dictate your location on the map.
    There are no actual moving objects. The grid has 20x20 sectors, Sector A1-T10, and each one is represented by an object of that name. "Sector A1", "Sector J10", etc.
    And each object contains 25 values that define subsectors within these regions. I know it's a bit complicated, but it is for random map generation, and the code works just fine. That is not the issue.
    It is not difficult to reference these objects' values manually, but it will be very time consuming for my large grid, and also it will make it more difficult to expand my map if I ever decide to.

    So, if I could simply have it search for the values of these items like I already am, except do it all while replacing the name of the object in the expression with a string, it would cut my work load down to a fraction of the time,
    and my event editor would be much more neat too.

    Here is an example of what I know works. The manual way; Searching for each object and its 25 values one by one. 400 objects * 25 values. I'm sure you can imagine why I'm seeking a different method. haha
    8254f159be82b0b6c2927c2b222526bf.png
    If I could get it to function more like this, then I would only have to account for 400 instead of 10,000 events for my massive map.
    d39e4c5e6faa4e1158aec30a948cf06e.png

    For example, the player's coordinates are between Y500/X500 and Y1000/X1000, so the global value "Biome Activation Check" is set to a certain value, dictating a region.
    Then, based on this region (perhaps it's J10,) each of the 25 subsectors within this region will be generated based on numbers pulled from each of the 25 values of the object (Sector J 10).
    I'm only giving so many specifics so you can see the importance of what I'm looking to achieve. Without this shortcut it would take forever.
    So everything is going according to plan. But I'm looking to save loads of time and be able to work smarter and not harder!

    Thanks for reading! Even if it's impossible to do what I'm wanting, I'm open to hear about alternative methods. But if there is a way to change which object is having its value extracted based on a factor, such as a global string, then it will help me a ton.

  2. #2
    Clicker

    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Jan 2021
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you'll want to set a Qualifier on the objects, loop over them looking for the defined alterable values. Qualifiers sound exactly like what you're looking for -- they behave just like regular objects (they are selected/filtered by event conditions, for instance) but can be assigned to many disparate objects to group them together in one set.

  3. #3
    Clicker

    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Jan 2021
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may also need to use OName$() to get the object's name, AltValN() to get an alterable value by index, or AltStrN$() to get an alterable string by index (you can't get values and strings by name as far as I know).

  4. #4
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)SWF Export Module (Steam)

    Join Date
    Nov 2014
    Location
    Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm still working out the kinks on reading the randomized data, but this qualifier tip sure helped a ton! I can randomize my entire massive 10,000 sector grid with a single event! Just wow. Thank you! haha I'm not super experienced with this stuff.
    I'm still trying to figure out the bit I mentioned where the game finds out where you are, and what sort of location you should be in.

    For example, I have code defining all of the 400 major sectors of the map already. And based on which one I'm in I have a way to calculate my location within that sector.
    Even better, I have a way to make the location number within a sector generic, so that I won't have to create many events. So, if the global values (SectorTravel and (SectorTravelY) are each between certain numbers, then the game knows that you
    are within a subsector E1 of one of the 400 major sectors.

    So then I have a code that says, if you're between certain SectorTravel coordinates, set value of (Scene Activation Check) to the value of the corresponding value (E1, B3, D4, etc.) However,
    I want it to be that value from the item that corresponds to the overall major sector.

    So here's the breakdown

    --- Randomizing values for map generation - SOLVED
    --- Calculating which major sector the player is in - SOLVED
    --- Calculating which subsector the player is in (regardless of which major sector) - SOLVED
    --- Based on the above information, using SectorTravelX and SectorTravelY (the values determining your subsector), as well as X and Y coordinates (values determining your major sector) to determine which specific object and value to set the global value (Scene Activation Check), therefore activating the appropriate group of events for that randomly chosen scene - UNSOLVED

    I'll let you know if I figure it out.

  5. #5
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)SWF Export Module (Steam)

    Join Date
    Nov 2014
    Location
    Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And your qualifier tip might be just enough. I'm just still sorting stuff out and learning. haha Thanks again!

  6. #6
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)SWF Export Module (Steam)

    Join Date
    Nov 2014
    Location
    Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh okay, I'll try that out! Thanks!

  7. #7
    Clicker

    Fusion 2.5 (Steam)Fusion 2.5+ DLC (Steam)

    Join Date
    Jan 2021
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One thing I've done with qualifiers is to make sure that, for instance the first 4 values are all consistent between them, then you can loop over those objects using the qualifier and check those values for a known value. I'm not quite following the design of your system, but I think that might help.

  8. #8
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)SWF Export Module (Steam)

    Join Date
    Nov 2014
    Location
    Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah-ha! Now it's working perfectly! Thanks, you helped me fix the main issue as well as an additional one! So I did use your advice and pulled it off through a qualifier.

    I gave each of the 400 objects a unique ID. When the player is in a subsector E1, the game will figure out which major sector's E1 value it should extract by looping on each object and checking if the player's sector number matches the object's ID. If so, it will activate the scene based on that object's E1 value! Thanks again! I am very pleased to know there are workaround ways such as this to extract values from a specific object among hundreds.

  9. #9
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)SWF Export Module (Steam)

    Join Date
    Nov 2014
    Location
    Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My next goal is figuring out how to simplify my method of determining the player's major sector among all 400 and setting a global value to the corresponding ID, using the X and Y coordinates. Each sector will be 2500x2500. I'll be having fun brainstorming that one and come back here with a new thread if I am stumped for too long!

    Once that is finished I will be fully prepared to create scenes and locations, and they will be randomly chosen! Exciting stuff! Once the groundwork is finished, adding will be fun and easy.

  10. #10
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)SWF Export Module (Steam)

    Join Date
    Nov 2014
    Location
    Ohio
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is my very first project where I'm laying groundwork first, to make development 10x easier in the future. So that's why I've got so many questions, I've just never done this stuff! haha My past small projects were mostly done by repeating actions unnecessary amounts of times.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 3rd February 2020, 07:01 AM
  2. Replies: 5
    Last Post: 2nd October 2016, 09:41 PM
  3. Replies: 6
    Last Post: 5th July 2014, 05:47 PM
  4. I Need help extracting the root path from a string
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th September 2009, 08:39 AM
  5. Extracting Text Using String Parser?
    By pinacoladaxb in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd September 2009, 02:59 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
  •