License from €75 Log in
DE EN FR ES IT CZ

Flashlight around the character circle style

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

  1. · 10 years ago
    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)))
    I saw this code which have both of them. How can I make it only show the curcle without hovering on character?
    Also if possible exlpain me how we make shader follow character.
  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.

    See licenses Try it for free
  3. · 10 years ago
    Maybe this will be of some use? http://www.visionaire-studio.net/forum/thread/adding-scripts...

    In the script you've listed you will notice there are some bits containing game.CurrentCharacter.Position. These are binding the specified shader/light to the character.

    Maybe SimonS can provide you with a shader example of a circle spotlight assigned to the characters position. I'm not very savvy with GLSL programming myself.
  4. · 10 years ago
    This is the same thing.
    How we make shader follow char. I think I made it but there is any tutorial for shaderLamp?
  5. · 10 years ago
    This is the same thing.
    How we make shader follow char. I think I made it but there is any tutorial for shaderLamp?
    I think it's basically the same thing as the script you shared except instead of 2 different lights you will be using 1 light. Does that script you shared work ok? I'm pretty sure I recall Simon mentioning that shader binding method had changed at some point.

    If Simon doesn't see & reply to this post sometime over the next few days then I'll ask him on Skype - if I remember.
  6. · 10 years ago
    shaderActivateLighting(2)
    shaderLamp(1, 1, {1,1,10}, {0,0,0}, {0.1,0.000001,0.00000001}, {0,0,0}, {1,1,1}, 1, 1, 0)
    bind("light1", "lights[1].position", point(inverty(scrollfix(offset(field("game.CurrentCharacter.Position"),{50,-50}))), 1))

    This one works. Like I want it to work. But it has dot inside and follows only right place
  7. · 10 years ago
    What do you mean by "follows only right place"? As for the dot, I think that's probably something to do with the strength parameter inside of the script you've used. I'm pretty sure it can be adjusted to make it softer. Or maybe you could offset the z-index so it's drawn behind the character somehow - I don't remember what any of the parameters are for off the top of my head; it's been at least a year or more since I messed around with shader lights. Sorry.
  8. · 10 years ago
    Alright, so thank you for all the help, i just have 1 small last question and im sure than you can help me out! ^^

    So, i have the shaderlamp binded to my current character, is there anyway to bind the shaderlamp to a gameobject? So my goal is to make a "lantern' for my character. and that the shader follows the lantern, is there a way to do it ? 
    thank you in advance

  9. · 10 years ago
    Alright, so thank you for all the help, i just have 1 small last question and im sure than you can help me out! ^^

    So, i have the shaderlamp binded to my current character, is there anyway to bind the shaderlamp to a gameobject? So my goal is to make a "lantern' for my character. and that the shader follows the lantern, is there a way to do it ? 
    thank you in advance

    You should be able to offset the position of the shaderlamp from the characters position, but I guess you would need a loop or something to detect when the character changes direction so that the offset can be adjusted.

    What is the {50, -50} bit in your script next to game.CurrentCharacter.Position for?

  10. · 10 years ago
    I've made it. I have another problem now. How we make mouse showing everywhere?. I mean show it into black screen
  11. · 10 years ago
    I've made it. I have another problem now. How we make mouse showing everywhere?. I mean show it into black screen

    You mean it's hidden because of the shader?

    Create a definition type script in the script section & include this line into it...
    game.ShaderExclude = eShaderExcludeInterfaces

    This will prevent text, cursors & interfaces from being affected by the shader. wink
  12. · 10 years ago
    I've made it. I have another problem now. How we make mouse showing everywhere?. I mean show it into black screen

    You mean it's hidden because of the shader?

    Create a definition type script in the script section & include this line into it...
    game.ShaderExclude = eShaderExcludeInterfaces

    This will prevent text, cursors & interfaces from being affected by the shader. wink
    Awesome grin Thank you!!!
    What about dialogs? How can we change the color on hover (active).
    If is off topic I'll create a new one for asking that?

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?