Beginning with LUA

  • #30, by SmithersSaturday, 06. September 2014, 14:04 8 years ago
    I too am just starting to learn Lua. I bought the book mentioned by the OP a while ago. It's a useful reference and has some good exercises in it, so I would recommend it. I also worked through the online exercises that AFRLme referenced, they're useful too. Basically I'm learning from the beginning again how to program. Last time I did any programming it was in Basic in the 1980s!

    Newbie

    3 Posts


  • #31, by ikarusSaturday, 06. September 2014, 21:11 8 years ago
    I too am just starting to learn Lua. I bought the book mentioned by the OP a while ago. It's a useful reference and has some good exercises in it, so I would recommend it. I also worked through the online exercises that AFRLme referenced, they're useful too. Basically I'm learning from the beginning again how to program. Last time I did any programming it was in Basic in the 1980s!


    Do you mean Programming in LUA by Roberto Ierusalimschy?

    Newbie

    37 Posts

  • #32, by SmithersSaturday, 13. September 2014, 12:35 8 years ago
    Yes, I meant Programming in Lua by Roberto Ierusalimschy. Sorry, I didn't make it very clear.

    Newbie

    3 Posts

  • #33, by ounisFriday, 09. January 2015, 12:16 8 years ago
    Hey. We bought this lovely software about a week ago with my friend. I'm a little confused where to start using some scripting while in game.
    What I'd like to start with, is to print some different properties above my main (current) character to see how I can manipulate the objects and their fields. Just something simple.
    For example, how do I print the name of the current character and a name of a certain item on the character (let's say "Plank") at the start of a scene, or by a left click of a button to object (for example a "tree" on a scene.
    I go to scene->actions->at the beginning of the scene->execute a script, but what do I execute?

    Newbie

    1 Posts

  • #34, by afrlmeFriday, 09. January 2015, 12:58 8 years ago
    What do you mean by print?

    The Lua print function is for printing messages to the log such as information & errors. It is not used for displaying text in-game.

    What you are talking about are action texts. You have to include names inside of scene objects, characters & your commands etc. You also need to enable the display action text inside of the game properties section & set it to display at cursor position or inside of a specified section of the viewport.

    If you want it to display something like "use shovel on x" then you would need to add "use" as the name to a command you created for use & in the properties tab for the command you would set the command to be a combined command & set the conjunction word to "on" & then you would need to add names to both the shovel item & the scene object.

    Imperator

    7137 Posts