Flashlight not working in VS 5RC

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

    ... 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

    7278 Posts


  • #11, by SimonSMonday, 24. April 2017, 22:29 7 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

    1580 Posts

  • #12, by afrlmeMonday, 24. April 2017, 22:40 7 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

    7278 Posts

  • #13, by nikos papaTuesday, 25. April 2017, 10:53 7 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 7 years ago
    Any news? grin

    Newbie

    25 Posts

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

    Thread Captain

    1580 Posts

  • #16, by dionousThursday, 27. April 2017, 16:53 7 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

    246 Posts

  • #17, by SimonSThursday, 27. April 2017, 17:00 7 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)))

    Thread Captain

    1580 Posts

  • #18, by woogySunday, 17. May 2020, 14:38 4 years 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()
    
    shaderActivateLighting(2) 
    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)
    
    bind("light1", "lights[1].Position", point(inverty(scrollfix(offset(field("curPos"),{0,-200}))), 1)) 

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


    Newbie

    17 Posts