Those damn shaders!

  • #1, by korpseWednesday, 07. September 2016, 20:04 8 years ago
    Okay, now I'm ready to ask some help, as I've tried to get the shaders - specifically the zoom functions - to work, with no damn luck. I've copied the definition script from wiki multiple times, just to make sure I didn't screw anything up. I finally got the effects from the shader demo toolkit to work with my project, but the zooming doesn't work.

    So, this might be a pretty dumb question, but could someone please explain me - a n00b, how do you get the friggin' effect to work. I'm running Visionaire 4.2 on Macbook Air (is this an issue?). As I understand, I should be able to use the zoom for example in action areas to zoom the scene in just a little when player is around exit. Am I able to do this by adding the script to Action Area using the 'execute script' action part, or do I need to do something fancier?

    I've tried to run shaderZoom function in console, but I get an error message saying "invalid syntax for command startTween". Could this possibly be an issue relating to Open GL? I haven't tried my luck on Windows computer, but if you guys can't help me out, that's probably my next move..

    I'm going to stop pulling hair from my head and get a cup of coffee...

    Newbie

    25 Posts


  • #2, by afrlmeWednesday, 07. September 2016, 20:32 8 years ago
    You are using VS 4.2 or 4.2.5? The shader toolkit script in the wiki is for 4.2.5. Simon updated it for the latest version, so some of the functions may no longer work correctly in older versions of Visionaire Studio.

    Execute a script action part is fine, as would adding an execute a script action part with shader zoom or followcharacter shader function inside of an action area via the way system tab.

    Imperator

    7278 Posts

  • #3, by korpseWednesday, 07. September 2016, 20:53 8 years ago
    I'm using the 4.2. Where can I find a working shader script for that version? I think this might be source for my worries.

    About those action parts, I've tried all the possible zoom related functions in all the possible places, but with zero luck. Is it possible, that this is an Open GL related issue, since I'm using a Mac?

    Newbie

    25 Posts

  • #4, by afrlmeWednesday, 07. September 2016, 21:06 8 years ago
    You could try going back in the history for the wiki page. Here you go: https://wiki.visionaire-tracker.net/index.php?title=Shader_(CMS)&oldid=4820

    0.9 seems to be the current version of the shader toolkit script, so 0.8.9 should be valid for 4.2.

    By the way, is there any reason why you haven't upgraded to Visionaire Studio 4.2.5?

    Imperator

    7278 Posts

  • #5, by korpseWednesday, 07. September 2016, 21:53 8 years ago
    I'll be damned, now it works like charm. Many thanks! I should've written here yesterday...

    The reason I'm sticking with 4.2 is, that I installed 4.25, but when I tried to run my project, Visionaire kept constantly crashing.

    Newbie

    25 Posts

  • #6, by afrlmeWednesday, 07. September 2016, 22:38 8 years ago
    Crashing in general when you try clicking on things in the editor? or only crashing when you try to run your game?

    Did you check the log file after it crashed or did it open up a prompt to submit a report / generate a dmp (dump file)? If it was the player crashing then it's likely an issue with some script or something that was corrupted. 4.2.5 mac version works fine as far as I know. I have it installed on my mac mini & it seems to work apart from a few issues with text / number input fields in the editor. My windows laptop is my primary machine though, so I'm not 100% familiar with the mac version of the engine.

    Imperator

    7278 Posts

  • #7, by korpseThursday, 08. September 2016, 20:46 8 years ago
    Haven't checked the log files. After my pulse settled in, I uninstalled the new version and went with the old and working one. I might have to reconsider at some point, but now I'm happy.

    One more thing about the shaders. When using the shaderZoom function, hotspots (object borders) seem to remain at their original places, although the scene itself zooms in. Is there any way to get the object borders to work with the zoom? We have a few large scenes in our game, and it would be super cool to have action areas, that zoom in on a few objects once character steps on it.

    Newbie

    25 Posts

  • #8, by afrlmeThursday, 08. September 2016, 21:16 8 years ago
    I think SimonS redid the way zoom functions work for 4.2.5, but you will have to ask him exactly what he did to them as I've no idea.

    Imperator

    7278 Posts

  • #9, by korpseThursday, 08. September 2016, 21:23 8 years ago
    Okay, hopefully there's a solution. If not, I might have to switch to 4.2.5 smile

    And one more thing: We're using 2D characters, is it possible to add a shadow underneath the character in some easy manner, or are we forced to rework every single animation frame?

    Newbie

    25 Posts

  • #10, by afrlmeThursday, 08. September 2016, 22:06 8 years ago
    if you aren't bothered about it being animated then you can probably create a scene object with the object center value set to -1 so that it's always behind the character (north) & then you create an animation in the animation tab for the object, set the loop to infinite & the delay to 1ms (we can actually create a natural loop with the animation itself). Next you assign it as the default animation inside of the objects properties tab. Now back to the animation, click the edit button & then the actions section (lighting icon) in the window that pops up. Inside of this create an execute a script action part & add this line to it...
    ActiveAnimations["name"].AnimationCurrentPosition = {x = game.CurrentCharacter.Position.x, y = game.CurrentCharacter.Position.y}
    

    ... replace "name" with whatever you decided to name the animation. Do this for each scene.

    Other alternative which is probably easier. Create another character & define it as a basic blob shadow. Each time you swap scene make sure you also bring this character in. You will need to create a loop somehow, either in characters animation or with a Lua mainLoop event handler.

    The best thing though would be to add it directly to your character animations.

    Imperator

    7278 Posts