Flashlight again [SOLVED]

  • #1, by red363Wednesday, 17. November 2021, 23:56 2 years ago
    Hi!
    I try the script with a flashlight, and it doesn't work either. As others wrote, the spotlight is fixed in the center of the screen and shines in one direction, does not react to anything.

    https://www.visionaire-studio.net/forum/thread/flashlight-28...

    shaderActivateLighting(2)

    shaderLamp(0, 0, {900,500,1}, {0,900,10}, {0.001,0.000001,0}, {0,0,0}, {1,1,1}, 1, 90, 0)
    shaderLamp(1, 1, {1000,50,1}, {0,0,1}, {0.01,0.0,0.00001}, {0,0,0}, {1,1,1}, 1)

    bind("light1", "lights[0].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{0,-200}))), 1))
    bind("light1", "lights[0].targetpos", point(inverty(cursor), 10))
    bind("light1", "lights[1].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{0,-200}))), factor(dist(scrollfix(offset(field("game.CurrentCharacter.Position"),{0,-200})), cursor), 10)))

    Can you tell me what the problem is?
    My version Visionaire 5.1.6

    Thanks.


    Forum Fan

    101 Posts


  • #2, by SimonSThursday, 18. November 2021, 23:17 2 years ago
    Hi, please ensure you got the latest shader script from here:

    Also the point is renamed to shaderPoint because of name collisions, so it's:

    shaderActivateLighting(2)
    shaderLamp(0, 0, {900,500,1}, {0,900,10}, {0.001,0.000001,0}, {0,0,0}, {1,1,1}, 1, 90, 0)
    shaderLamp(1, 1, {1000,50,1}, {0,0,1}, {0.01,0.0,0.00001}, {0,0,0}, {1,1,1}, 1)
    
    bind("light1", "lights[0].position", shaderPoint(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{0,-200}))), 1))
    bind("light1", "lights[0].targetpos", shaderPoint(inverty(cursor), 10))
    bind("light1", "lights[1].position", shaderPoint(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{0,-200}))), factor(dist(scrollfix(offset(field("game.CurrentCharacter.Position"),{0,-200})), cursor), 10)))
    

    Thread Captain

    1580 Posts

  • #3, by red363Thursday, 18. November 2021, 23:46 2 years ago
    Wow! I didn't even hope. Thanks a lot!

    Forum Fan

    101 Posts