1. #1

    world distance, multiply, data source...

    hello ill do my best to be clear.

    lets try to be simple

    i want a light to flash faster when i approach it. the more closer you are the more faster it flash.

    i use, the World source, then multiply the distance (distance between the to object, rider and light is ~10)
    i try different set-up and diferent multiply number and other option...

    simply, impulse going to activated/desactivated>>>light source.
    or
    impulse>>>activated>>>>light source + ******ed impulse>>>deactivate then connected to the same light source.

    its working find IF i approach very slowly.
    but the effect is buggy/not precise...even not really noticeable if i approach at medium speed.

    do you know a other way to do this ?

    thank.
    Share this post

  2. #2
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195

    Re: world distance, multiply, data source...

    probably quite a few methods to do this, the easiest i can think of

    outline:
    drive a curved data source offset that's tied to some incrementing value that increases as the player approaches, test the CDS less value to half the start/end CDS and toggle the light.

    so
    CDS Linear, Enabled [ ] (unchecked, this is a must), start=0, end=10 duration=10, offset=VDS, looping [X]

    formula=n/(d+1)

    n=some multiplier, say 5 for now, may need adjusting (this should give a 2 tick flash cycle, maximum cycle=duration/n )
    d=distance to object , the +1 is so it doesn't spin to infinity when d less than 1

    interval (1tick)->Set Value Event->Generic filter (Less,OP1=CDS, OP2=5 (half end) )-true->light(toggle)

    the Set Value Event is set on Increment: Value= the formula output value and is targeting a Variable Data Source (VDS) that is tied to the CDS offset.

    you'll probably need to increase the duration to give more flexibility and play with n multiplier.

    this is off the top of my head, hope its all there and is what your looking for.

    edit: i forgot that this will need a Variable Data Source (now added) that is incremented by the value of the formula and this will need to be input into the offset of the CDS, the set value event can be inserted between the interval and generic filter, sorry for this oversight.
    Share this post

  3. #3

    Re: world distance, multiply, data source...

    i have sound to , kind of a BIP...bip...etc...
    and the lenght of the sound make it more buggy...
    so...
    i finally chose to put area trigger and define the impulse.
    seem less buggy that way.
    old school

    thank for your help dasraiser.
    my trial game is in french and i have a hard time to traduce what you wroth.
    so i barely could try what you said.
    Share this post

  4. #4
    dasraizer's Avatar Senior Member
    Join Date
    Apr 2014
    Location
    UK, Isle of Wight
    Posts
    1,195

    Re: world distance, multiply, data source...

    hi, found simple way to do this, made a tutorial in google docs.

    Simple Proximity Warning. Toggle Light and Sound

    hope this helps.
    Share this post