flashlight

  • #1, z jetsetwillyWednesday, 24. December 2014, 16:33 hodinky 10 years ago
    how to do a flashlight

    Bažant

    69 Posts


  • #2, z SimonSWednesday, 24. December 2014, 16:59 hodinky 10 years ago

    Kapitán

    1582 Posts

  • #3, z jetsetwillyTuesday, 30. December 2014, 06:59 hodinky 10 years ago
    thank you but its too hard to understand..... i don't touch the script lua . i need video tutorials but there is nothing for visionaire studio , i come back to adventure studio theres is more tutorials and help

    Bažant

    69 Posts

  • #4, z brut69Tuesday, 30. December 2014, 16:25 hodinky 10 years ago
    V.Studio requires atleast some basic understanding of Lua to do the good things and a good understanding of Lua to do the awesome things.
    If you are hoping to do a game without any programming knowledge , you are gonna have a bad time.

    Čestný člen

    266 Posts

  • #5, z marvelTuesday, 30. December 2014, 16:47 hodinky 10 years ago
    Actually, I don't think so.

    I created "Zak McKracken between time and space" without a single line of LUA. And even most of the popular daedalic adventures like "The whispered World" didn't use LUA.

    But very "special" solutions, like a flashlight, would need LUA/shaders, that's right.

    Zabiják klíčů

    599 Posts

  • #6, z afrlmeTuesday, 30. December 2014, 17:22 hodinky 10 years ago
    Well you can sort of do a flashlight without shaders, by using semi-transparent images, but it's not very efficient.

    I believe with the GUI Simon is working on that it might be possible for him to implement various action part/module preset versions with parameters for some of the shader stuff. But only time will tell about that.

    Imperátor

    7285 Posts

  • #7, z jetsetwillyTuesday, 30. December 2014, 19:26 hodinky 10 years ago
    in fact i don(t want to make a complex game with 3 d and and light effets, i like old school games. but i just need a siple flash light like the scene in maniac mansion, maybe the solution with the half transparent can do the trick, can you explain me how to do that? maybe a black layer overwrite the room and use a light sprite as a mask? thank you for helping me.

    Bažant

    69 Posts

  • #8, z afrlmeTuesday, 30. December 2014, 20:02 hodinky 10 years ago
    VS has no support for masks or overlays. The only way to do that would be with the shader.

    The idea behind the image method would be to create a black/semi-transparent black image with a circle cut into it & you set the image as the current mouse cursor. Problem with that is that the image size can be quite large which could make your game lag considerably.

    I'm sure Simon would give you a simple example of how to create a spotlight fixed to mouse cursor if you asked him. It could even be pretty much plug & play.

    Imperátor

    7285 Posts

  • #9, z marvelTuesday, 30. December 2014, 20:25 hodinky 10 years ago
    Well, actually it's not much of a problem to create and use a mask in Visionaire Studio. Just use a big black image with a hole in it as a mouse cursor. Then you have a classical flashlight. smile

    Zabiják klíčů

    599 Posts

  • #10, z marvelTuesday, 30. December 2014, 20:27 hodinky 10 years ago
    Oh... this is what Lee already wrote grin Yes, thats a working solution.

    Zabiják klíčů

    599 Posts

  • #11, z SimonSTuesday, 30. December 2014, 20:31 hodinky 10 years ago
    Step-by-step:

    1) Load this script: http://wiki.visionaire-tracker.net/images/a/a5/Shader_toolki...

    (is linked btw on this site: http://wiki.visionaire-tracker.net/wiki/Shader_%28CMS%29)

    2) open with an texteditor
    3) copy everything
    4) in your Visionaire project go to scripts (last symbol left side)
    5) add a script with the plus
    6) paste
    7) add another script
    8) paste this:
    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)))
    

    9) save & run

    requires the newest 4.1 editor and player.
    Is a very basic sample.
    If want to turn it off, you can use the action execute script, and paste shaderDeactivateLighting() there.
    The settings can be tweaked a little, but it's just a basic flash light.

    Kapitán

    1582 Posts