1. #1

    Looking for a more efficient way to control multi variables

    I will probably figure this out but thought I'd ask first to see if there is a method I've overlooked...
    I have ten items hidden on a track...
    I have ten variable that I am using for visibility on off switches on decals (showing discovered items).
    Right now, as a temporary solution, I have them as separate variables with a default value of 1 and when a corresponding item is found is changed to 0 (changing a decal from invisible to visible)
    I'm looking for a way to control and use the 10 variables in one Data Source instead of 10. (Like a 2 dimensional variable array)
    Any solutions or alternative ideas would be welcome.
    Share this post

  2. #2
    You can use an object array and object retriever and use visibility event with the 10 objects or decals. Have the object retriever index set to a variable data source.

    Then you can use set value events when the item is collected to change the object retriever index to the corresponding number of the object to use for the visibility event.

    Use an interval trigger with impulse every tick to the visibility event.
    Share this post

  3. #3
    Excellent! I'll give that a go. That's what I was looking for... something I haven't used yet.
    I assume this will let me have any combination of the 10 switches set to 1 or 0?
    This will be a final step in finishing a skillgame hidden within a race map.
    Keep an eye out for "BTTB Extreme Adventure" (planned name) to see how this works out (soon).
    Share this post

  4. #4
    Thanks for replying this thread. it realy help me alot.
    Share this post

  5. #5
    Each object in the array is numbered in the order they are selected starting from 0.

    When the index is set to the corresponding object number, the event will only affect that object, until the index is changed.

    When the index changes, the next corresponding object is affected and so on.

    Use a set value event when item is collected to set the index value to that objects number in the array. This tells the event which object to target in the array.
    Share this post

  6. #6
    The object array and object retriever tools also work for data sources. You can target all the variable data sources, used for the objects visibility values, with the array. Then use a set value event targeting the retriever.

    Then change the retriever index number like above.

    There are plenty of uses for arrays. They work with a lot of events, and are easy to use.

    Swampballs Trials Fusion editor tutorials explains the basics of arrays.
    Share this post

  7. #7
    Thank you so much for the info... and hi @ multiapk78
    I did quite a bit of basic programming using a variety of coding languages and arrays are a definite must. Getting into good "Logic" setups is essentially the same thing and little tools like this can provide powerful results. Good stuff to know. Gonna spend a little more time with this and get to know it better. Been in Trials for a years now and still learning all the nooks and crannies of the system.
    I hope more people ask more questions in here. I'd like to see the forum pick up a bit.
    Share this post

  8. #8
    Yeah, I check in here often, but it's usually quiet.
    Share this post

  9. #9
    I finished that track and uploaded the two versions of it. They are both exactly the same track but with different games played on them.
    "BTTB Extreme AdventureTR" is a Trials Race version
    "BTTB Extreme AdventureSG" is a skillgame version on the same track but is - Find and detonate the 10 hidden smileys on the map.
    Both maps keep track of the smileys detonated with a kind of scoreboard with golden squirrels on it. (This is where the ten variables come into play)
    In "Hunt" mode detonating 4 gets you a Bronze and 10 is Diamond.
    One of them is hidden inside a secret temple with it's own mini game of flying a hover machine (easy to fly) to unlock doors to get to the smiley (it's the one in the Track Thumbnail)
    Share this post

  10. #10
    Oh yea, and those tracks are ninja but most of the map is hard to extreme. The ninja level stuff is easy ninja and for the most part can just be powered through.
    Share this post