Flashlight not working in VS 5RC

  • #10, by afrlmeMonday, 24. April 2017, 19:24 3 years ago
    Try removing the quotation marks from around: "game.CurrentCharacter.Position" so it's just...
    game.CurrentCharacter.Position
    1

    ... it's shorthand so it shouldn't be wrapped in speech marks or apostrophes.

    Also, I think shaderActivateLighting() should be set as 1 not 2 seeing as you only need 1 light, but I don't think it really makes much difference.

    Imperator

    6816 Posts


  • #11, by SimonSMonday, 24. April 2017, 22:29 3 years ago
    @Lee: no that's just wrong. The quotations are there because it's calling this every frame.

    I found the error there is a space in line 225 that should be removed. There are also some other things to fix in the script. You can fix the space yourself for now. I will publish the updated script with the documentation.

    Thread Captain

    1351 Posts

  • #12, by afrlmeMonday, 24. April 2017, 22:40 3 years ago
    @Lee: no that's just wrong. The quotations are there because it's calling this every frame.

    I found the error there is a space in line 225 that should be removed. There are also some other things to fix in the script. You can fix the space yourself for now. I will publish the updated script with the documentation.
    If you say so mate. I'm not savvy with the shader stuff. wink

    Imperator

    6816 Posts

  • #13, by nikos papaTuesday, 25. April 2017, 10:53 3 years ago
    @Lee: no that's just wrong. The quotations are there because it's calling this every frame.

    I found the error there is a space in line 225 that should be removed. There are also some other things to fix in the script. You can fix the space yourself for now. I will publish the updated script with the documentation.
    Ok I'll wait for your update. Thank you. Let me know when is ready!

    Newbie

    25 Posts

  • #14, by nikos papaWednesday, 26. April 2017, 16:50 3 years ago
    Any news? grin

    Newbie

    25 Posts

  • #15, by SimonSWednesday, 26. April 2017, 22:39 3 years ago

    Thread Captain

    1351 Posts

  • #16, by atrusThursday, 27. April 2017, 16:53 3 years ago
    @Simon Thanks for the updated script. Have done some tests, i can get the shaderLamps appear but it seems that the bind() is not working properly (not moving with char or mouse). How can we debug this? 

    Do you have any working example with the latest script on 5rc0 just to make sure we are on the same line? If you can confirm smth that works on your end it would be great.

    Forum Fan

    237 Posts

  • #17, by SimonSThursday, 27. April 2017, 17:00 3 years ago
    Try this:
    shaderActivateLighting(2) 

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

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

    bind("light1", "lights[1].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{100,100}))), factor(dist(offset(field("game.CurrentCharacter.Position"),{0,-80}), cursor), 200)))
    1
    2
    3
    4
    5
    6
    7
    8
    9

    Thread Captain

    1351 Posts

  • #18, by woogySunday, 17. May, 14:38 3 months ago
    Hi @all:

    is there a possibility to use the current cursor position instead of "game.CurrentCharacter.Position"?

    I have tried the following:

    local curPos = getCursorPos()
    1
    shaderActivateLighting(2) 
    1
    shaderLamp(1, 1, {1000,500,2}, {0,0,1}, {0.01,0.0,0.000001}, {0,0,0}, {1,1.5,1}, 1,1,0)
    1
    bind("light1", "lights[1].Position", point(inverty(scrollfix(offset(field("curPos"),{0,-200}))), 1)) 
    1

    I must have forgotten or missed something.
    Can somebody help me?
    Thank you very much.


    Newbie

    17 Posts

Write post