flashlight

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

    Newbie

    69 Posts


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

    Thread Captain

    1580 Posts

  • #3, by jetsetwillyTuesday, 30. December 2014, 06:59 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

    Newbie

    69 Posts

  • #4, by brut69Tuesday, 30. December 2014, 16:25 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.

    Great Poster

    266 Posts

  • #5, by marvelTuesday, 30. December 2014, 16:47 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.

    Key Killer

    598 Posts

  • #6, by afrlmeTuesday, 30. December 2014, 17:22 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.

    Imperator

    7278 Posts

  • #7, by jetsetwillyTuesday, 30. December 2014, 19:26 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.

    Newbie

    69 Posts

  • #8, by afrlmeTuesday, 30. December 2014, 20:02 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.

    Imperator

    7278 Posts

  • #9, by marvelTuesday, 30. December 2014, 20:25 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

    Key Killer

    598 Posts

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

    Key Killer

    598 Posts

  • #11, by SimonSTuesday, 30. December 2014, 20:31 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.

    Thread Captain

    1580 Posts