1. #1

    Problem ending game with score/ time

    I want my track to end whenever you reach a certain amount of points or when the time hits zero, heres what i have:

    For time:
    -impulse splitter set to interval 60
    selected to
    -set value event set to decrease 1
    selected to
    -variable data source
    comparison value 1 to
    -generic filter with comparison value 2 at 0
    connected to
    -interval trigger set to interval 60
    on true
    -end game

    For scoring:
    -5 area triggers
    selected to
    -5 set value event
    selected to
    -variable data source set at 0
    comparison value 1 to
    -generic filter with comparison value 2 at 250
    on true
    -end game event

    ive looked at several tutorials and it looks exact but idk where the problem is
    Share this post

  2. #2

    Re: Problem ending game with score/ time

    Make sure you are sending an impulse to the generic filters every tick using interval triggers. You also didn't say what the comparison was on your generic filters (Equal, less than, etc.) which might be the problem.
    Share this post

  3. #3

    Re: Problem ending game with score/ time

    oh i meant interval trigger going to the generic filter, both generic filters are set to equals
    Share this post

  4. #4

    Re: Problem ending game with score/ time

    Originally Posted by Hank4054
    I want my track to end whenever you reach a certain amount of points or when the time hits zero, heres what i have:

    For time:
    -impulse splitter set to interval 60
    selected to
    -set value event set to decrease 1
    selected to
    -variable data source
    comparison value 1 to
    -generic filter with comparison value 2 at 0
    connected to
    -interval trigger set to interval 60
    on true
    -end game

    For scoring:
    -5 area triggers
    selected to
    -5 set value event
    selected to
    -variable data source set at 0
    comparison value 1 to
    -generic filter with comparison value 2 at 250
    on true
    -end game event

    ive looked at several tutorials and it looks exact but idk where the problem is
    Well, an easier way to do the time part is to just have one impulse sent right at the beginning of the game using the trigger of your choice. This impulse goes to a delay filter set at 60 seconds which then goes to an end game event. You could still use the variable data source as a count-down timer (The one I put in bold above), which I'm assuming you are already doing.

    As for the score thing, given the description above, I can see two potential problems:

    1. Make sure the set value events in red are set to "Increase" by 50.

    2. You didn't specify above, so make sure you have an interval trigger with an interval of 1 going to the generic filter.

    If none of that works, make sure you aren't making any silly mistakes, such as having an event turned off by accident.
    Share this post

  5. #5

    Re: Problem ending game with score/ time

    Why is your generic filter connected to an interval trigger? This isn't needed, you can connect your filter directly to your end event, so that when the filter conditions are met, the game ends.
    Share this post

  6. #6
    nannerdw's Avatar Senior Member
    Join Date
    Jan 2013
    Posts
    1,268

    Re: Problem ending game with score/ time

    Never use "Equals" when you're watching a variable for it to reach a certain value. Always use less equals or greater equals. It's more robust that way, and it's guaranteed to still work in the event that the game engine has a skip in it.
    Share this post