Question about characters in "hidden" scenes

  • #1, by skribent1Tuesday, 08. July 2014, 09:54 10 years ago
    Hi

    After much research in both more advanced and more simple game engine it looks like Visionaire is the right one for a project of mine. However I must ask a thing about the way system, before I go with the Visionaire engine. If I set an NPC to walk through a set of connected scenes, like from 1 to 4, and it walks slowly. Can the engine keep track were the NPC should bee after a certain time, so the player can run and catch up with the NPC in the scenes 2 and 3? Or is this something I have to script with Lua? With other words, can hidden scenes be loaded and running in memory?

    Thanks

    Martin

    Newbie

    4 Posts


  • #2, by andiliddellWednesday, 16. July 2014, 11:19 10 years ago
    I would imagine you would need to use some basic LUA to do this. I can't think of anything specific in the engine that lets you keep track of this kind of variable, and add to it over time.

    don't let this put you off though, it should be pretty simple to do the variable math in an lua script then use the IF condition actions within the engine to check where the NPC has got too off screen:


    • Create a variable for the scene the NPC is on.
    • Create a variable for the scene position of the npc between 0 and the screen width
    • Increase this value every second by an amount similar to the NPC walking speed
    • Each time this number reaches the screen width, update the screen number variable +1


    This means you will have variables being updated in the background by LUA, which you can check as you enter each scene in the engine.

    So using an "on enter scene" action in the engine, you would check the scene variable to see if the npc should be in this scene, and if so, position him at the position variable. If the NPC isn't in the current scene then don't show him.

    Hopefully this gives you some insight into how you can use LUA to do some simple math, and adding to variables, and use the intuitive action system in the engine to check the status of those variables.

    Hope this helps, and doesn't just confuse further smile

    Forum Fan

    178 Posts

  • #3, by afrlmeTuesday, 22. July 2014, 13:15 10 years ago
    Hmm I believe you could do this with editor action parts alone & maybe some action areas.

    Quick example (off the top of my head - don't know if it will work): use the send character to position action part to make it walk to the action area you created & inside the action area create a character enters action linked to that specific character & when it enters use the set character to position or set character to object action part to swap them to the next scene & then use the send character to position action part again, rinse & repeat etc.

    Like I said: I don't know if it will work as I've not attempted sorting out anything like that thus far.

    Imperator

    7278 Posts

  • #4, by brut69Tuesday, 22. July 2014, 14:54 10 years ago
    There is also another way.
    If you set the 4 scenes to be independent then there is also the "Switch to Scene of Character" command on the editor which will do exactly what you are asking.

    Great Poster

    266 Posts

  • #5, by afrlmeTuesday, 22. July 2014, 15:19 10 years ago
    hmm? From what I gathered he meant that an npc should keep moving even though a scene is not currently active or in memory. But I think he meant for the character position to update every x time based on some kind of math instead of the send to action part, which would be quite complicated, methinks?

    Imperator

    7278 Posts

  • #6, by brut69Tuesday, 22. July 2014, 17:44 10 years ago
    From what I understood , he basically wants the "Send to Location" but to be able to re-focus on that character. If the character keeps changing scenes (which is easy to do since once he reach location you can set it to go to another and then loop) , then the Switch to Scene will be easy to do but the only problem I think there will be that once he switches he will also need to stop the character from moving as he will eventually switch scene again.
    It really depends on what he is doing (we need more details)

    Great Poster

    266 Posts

  • #7, by brut69Tuesday, 22. July 2014, 17:45 10 years ago
    Reading again my post I estimate it may be confusing... sorry about that

    Great Poster

    266 Posts