Create table rows in LUA

  • #10, by DundilSaturday, 30. March 2013, 11:56 8 years ago
    About the "timer" function, it's interesting. I'll think on it.

    Editor: I use Notepad++, out of VS editor, yes. I import the script files at the beginning as I saw in a forum post.

    Global values... At the beginning I had an object called "GLOBAL", to store all of them. Now I just add them in an "init" function.

    Finally, about functions I've created, for the moment just some of the basic ones: addItemToChar, removeItemFromChar and things like that, so all the other scripts become clearer.

    Newbie

    19 Posts


  • #11, by afrlmeSaturday, 30. March 2013, 12:52 8 years ago
    if you open up your projects .ved file in notepad++ you can manually edit / add a lot of things via code if you like.

    I recommend having a look at sublime text editor - it's much nicer than notepad++ & it has an unlimited try before you buy policy; meaning you can use it as long as you like without limitations & then pay the single time $80 license key fee when you are ready or if you decide you want to use the application permanently wink

    http://www.sublimetext.com/

    --*--

    P.S: Divo showed me how to do the include script thing wink
    if you check the wiki (via header above), he also shows how to include custom or other third party libraries too - I've not looked into it myself yet.

    Also there's the open source love2d lua framework which has some nice libraries/functions etc - I've been wondering if it would be possible to get some of them to work with VS too as they have certain things like physics, timers, image manipulation & so on which might be useful for some people.

    Imperator

    6861 Posts

  • #12, by DundilTuesday, 02. April 2013, 14:17 8 years ago
    Well, I've tried some of the commands in the url you sent to me and I can't make them work. Have you?
    I'm afraid at the end I'll have to work on VS to put the initial parameters. A pity.

    Thanks!

    Newbie

    19 Posts

  • #13, by afrlmeTuesday, 02. April 2013, 14:31 8 years ago
    I haven't tested the data structure commands yet ...
    I know the syntax is confusing for most of them which is why I have been writing up my own versions with examples for the new wiki.

    As Alex said: the data structure commands aren't really made to be used in game as they are for the editor itself & he should know seeing as he is the main programmer of Visionaire Studio.

    As recommended: you should really create all conditions/values & so on in the editor itself & just use lua for controlling various things or creating functions/features that are easier done with LUA or aren't possible to achieve with the editors action parts.

    sorry roll

    P.S: I have been considering - at some point - that it might be a good idea to expand on the data structure page & show some working examples for some of the scriptable commands that have no documentation.

    Imperator

    6861 Posts

  • #14, by DundilTuesday, 02. April 2013, 15:35 8 years ago
    Good idea.

    I'll make it as recommended. Anyway, I think the best is always to give control to people, so more tools and more powerful can be shared. For the moment is enough for me.

    Thanks a lot smile

    Newbie

    19 Posts

  • #15, by afrlmeTuesday, 02. April 2013, 17:16 8 years ago
    yes I too would like more control over various things.

    for example some of the data structure that is listed says it isn't scriptable but some of them are to a point but I guess they are declared non-scriptable because it isn't recommended to script them ...

    a good example would be the objectCenter one which defines the forward/back (z) position of an object/button yet we can check & set it with lua, even though the data structure says otherwise, but in order for the change we made with lua to take effect you need to refresh/reload the scene or it will not look like it worked.

    P.S: the next build has more lua commands if you check the links I added to the event handler thread you posted in earlier - mostly audio related commands but there's a couple more too like the systemLanguage one added to getProperties() & the setWindowTitle() in which you can declare a custom title to be displayed on the window bar for people playing the game in window mode.

    Imperator

    6861 Posts

Write post