Zurik

  • #1, by zurikMonday, 25. February 2019, 21:32 5 years ago
    Hi.
    I have been working on a game for a few months now, but now I decided to move it over to Visionaire Studio from another platform (AGS). I spent a few hours on understanding all the aspects of VS, watching tutorials, and I must say it looks very simple and cool, but my problem would be to "move over" all the scripts. I am not a professional programmer, but I have worked with development. In the previous platform I used commands like player.Say(""), Wait(200), Character7.Changeroom(), player.Walkto() etc.
    After reading for a while on this forum and the Lua documents, I see that it's fully possible, but I need to understand it a bit more.
    So my questions would be pretty general: Shall I write small scripts in the Script tab and call them from the Actions? What should I know about scripting in Lua after working in AGS, and How would you for example "translate" the commands I wrote above, so I get a more clear picture of how I should think.
    Thank you very much smile

    Newbie

    40 Posts


  • #2, by afrlmeMonday, 25. February 2019, 23:46 5 years ago
    A'llo, welcome to the VS forum.

    First things first, you are assuming that Visionaire is a script based game engine. Now while scripting is possible (Lua script), it is not necessary.

    To get a character to say something, use a display text action part. You can let it handle the duration automatically or you can insert a ptag at the end of the text.


    You can add a pause between action parts in multiple ways, some action parts come with an optional wait option built into them. There are also action parts which you can use to tell the engine to wait until a character stops talking, stops walking, a sound stops playing, etc. & then there's the pause action part, which you can use to insert a custom pause value between action parts.

    There is no reason to tell the character to walk to x - unless you need to do that for a cutscene or something. You can assign interaction positions & alignment in the properties section of the selected scene object. If a scene object has a position assigned to it, then clicking on the scene object will automatically make the character walk over to the scene object & align to the specifed alignment direction. You can also specify commands, items, execute actions/events at destination, or even execute actions/events immediately as soon as the player clicks on the scene object.

    If you speak/understand German, then I would recommend watching Sebastian's video tutorial series - if not, then give William Kruger's video tutorial series a try. Both can be found via this page here.


    Imperator

    7278 Posts

  • #3, by zurikTuesday, 26. February 2019, 18:06 5 years ago
    Thank you for your answer. I managed to "copy" almost everything over to VS, but I am wondering if there is a possibility to do this:
    I have a block of "code" (see the attached image), but I want to reuse it in several places. In AGS I used function for this, but what is the best way to do it here? 

    Is there any way to set a default comment to an action? For example every time I try to use something on a character, it say "I should rather give it to him" etc.

    I know I am going to have more questions, but it looks like I understand VS very good now smile

    Thanks

    Newbie

    40 Posts

  • #4, by sebastianTuesday, 26. February 2019, 18:11 5 years ago
    you can create "called by other action" Actions, which you can start from everywhere in the engine where you use action parts with a "call action" part.

    Regarding default comments, look at the comment sets of your playable character. There you can define default responses. 
    Depending on your needs you also can create an own system - based on "called by othet action" parts smile 

    ~Sebastian 

    Thread Captain

    2346 Posts

  • #5, by zurikTuesday, 26. February 2019, 21:19 5 years ago
    Thank you, that's exactly what I was looking for! 

    I hope I can ask another question, I am trying to find similar questions on the forum, before I post. How can I display and change a text in the interface, for example mood, life, etc? Should I somehow connect an interface text box with a string variable?

    Thanks

    Newbie

    40 Posts

  • #6, by zurikFriday, 01. March 2019, 11:24 5 years ago
    For example how can I edit (and later change) the text inside this box? With Action parts or script? 
    Thanks.

    Newbie

    40 Posts

  • #7, by afrlmeFriday, 01. March 2019, 12:21 5 years ago
    That box is for action text. Action text is the text that's displayed when you mouse over something that has a name associated with it.

    Are you just wanting to display some text on the screen like a gui element?

    Imperator

    7278 Posts

  • #8, by zurikFriday, 01. March 2019, 12:34 5 years ago
    Ah, I see.
    Yes. Like for example amount of money or life etc. 

    Newbie

    40 Posts

  • #9, by afrlmeFriday, 01. March 2019, 13:56 5 years ago
    You can use the display object text action part for that in combination with a value. Just like with ptags, you can insert values into display texts.


    You would need to update it in an at begin of scene each time you change scene & you would also need to update it each time you change the value that you are using, so it might be best to create a called by other action part, rename it to something appropriate, insert the display object text action part into that, & call the action you just created inside of the at begin of scene actions & after updating the relevant value.

    Imperator

    7278 Posts

  • #10, by zurikSunday, 03. March 2019, 21:29 5 years ago
    Thanks. I managed to do it, but only with numbers.
    I tried to apply the similar function to show a text, both with and without scriping, but didn't manage to do it.

    I made the following script:

    function promilleTextUpdate()
    promilleText= "NOTHING"
    if pr== 1 then promilleText = "one" end
    if pr== 2 then promilleText = "two" end
    if pr== 3 then promilleText = "three" end
    if pr== 4 then promilleText = "four" end
    end

    and I also tried to apply value with action parts, but I am not sure how to "set value" to a string variable:  

    Could you show me how to do it with both? Thank you smile

    Newbie

    40 Posts

  • #11, by afrlmeSunday, 03. March 2019, 22:51 5 years ago
    You can only update the string field of a value with Lua script.

    Values["example"].String = "some text"

    Imperator

    7278 Posts