License from €75 Log in
DE EN FR ES IT CZ

Visionaire Studio 4.2.5 Released

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 11 years ago
    “
    There are a few Spanish developers on here. Last year a team of Spanish developers tried to kickstart a game called Waldemar the Warlock - I think that is what it was called? Then again my memory is not that great so it could have been you? Anyway... there are a few other developers too.
    „


    http://www.visionaire-studio.net/forum/thread/the-red-hat-po...!!/

    “
    One thing I do like about Spain is that you often get a tapa when you order a drink, which is something you would probably never get in the UK unless you managed to find an actual tapas bar / restaurant. I never saw one where I am from in the UK though.
    „


    There is tapas restaurant near me now but I should pay for each tapas.... lol

    “
    P.P.S: I think VS should have a food category. - joke.
    „


    When VS getting really popular, then the forum should be bigger and categorised suitably.

    After that, it would be great there is sub-forum named 'social life stuffs' thing. smile
  2. · 11 years ago
    “
    How can we now iterate through all the Characters using Lua?
    Something like this:
    chars = getObject("Game.Characters")
    for c in chars do
    	print("Char: " .. c.CharacterName)
    end
    
    „


    Like this...
    for i = 1, #(Characters) do
     print( Characters[i]:getName() )
    end
    

    You can add characters to a variable too if you prefer. I just showed accessing it without is all.
  3. · 11 years ago
    for i = 1, #(Characters) do
     print( Characters[i]:getName() )
    end
    


    It doesn't work, #(Characters) = 0
    and as a test #(Fonts) is also zero.

    Any ideas?
  4. · 11 years ago
    And why the brackets?

    for i = 1, #Characters do
     print( Characters[i]:getName() )
    end
    
  5. · 11 years ago
    Felt like adding the brackets. Don't have to include them. More of a visual aid than anything else. You also don't have to use the # either can use table.maxn(name) instead.

    It didn't work?

    ah. game.CharacterLinks. I would have thought could access Characters table, but I did write it off the top of my head. I've not tried iterating through characters before as I haven't needed to.
  6. · 11 years ago
    This works:
    for i = 1, table.maxn(game.CharacterLinks) do
    	print( Characters[i]:getName() )
    end
    

    Thanks for the pointers.
  7. · 11 years ago
    This wont help us iterate through fonts etc though.
  8. · 11 years ago
    This doesn't work?

    fonts = game.FontLinks
    
    for i = 1, #fonts do
        print( fonts[i]:getName() )
    end
    
  9. · 11 years ago
    Ok, nice one.
  10. · 11 years ago
    I couldn't override the getn-operator in LuaJIT, because of that you need to do this:

    for i = 1, Fonts.__len do
        print( Fonts[i]:getName() )
    end
    
  11. · 11 years ago
    Ah, cheers for letting us know why it wouldn't let us access it directly via the global tables. smile

    P.S: the # isn't needed?

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?