License from €75
DE EN FR ES IT CZ

flashlight

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 12 years ago
    how to do a flashlight
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license. Forum readers get the Indie Bundle 15 % off with the code FORUM15: €84.15 instead of €99, valid until 31 Dec 2026.

    Get 15 % off Try it for free
  3. · 12 years ago
    Look here, there are some examples: http://www.visionaire-studio.net/forum/thread/shader-toolkit...!/2/
  4. · 12 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
  5. · 12 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.
  6. · 12 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.
  7. · 12 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.
  8. · 12 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.
  9. · 12 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.
  10. · 12 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
  11. · 12 years ago
    Oh... this is what Lee already wrote grin Yes, thats a working solution.
  12. · 12 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.

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?