Visionaire Studio 4.2.5 Released

  • #60, by tristan-kangWednesday, 02. December 2015, 15:41 9 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

    Great Poster

    267 Posts


  • #61, by afrlmeWednesday, 02. December 2015, 16:29 9 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.

    Imperator

    7278 Posts

  • #62, by darren-beckettWednesday, 02. December 2015, 17:32 9 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?

    Great Poster

    384 Posts

  • #63, by ke4Wednesday, 02. December 2015, 17:42 9 years ago
    And why the brackets?

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

    Key Killer

    810 Posts

  • #64, by afrlmeWednesday, 02. December 2015, 18:03 9 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.

    Imperator

    7278 Posts

  • #65, by darren-beckettWednesday, 02. December 2015, 18:10 9 years ago
    This works:
    for i = 1, table.maxn(game.CharacterLinks) do
    	print( Characters[i]:getName() )
    end
    

    Thanks for the pointers.

    Great Poster

    384 Posts

  • #66, by darren-beckettWednesday, 02. December 2015, 18:15 9 years ago
    This wont help us iterate through fonts etc though.

    Great Poster

    384 Posts

  • #67, by ke4Wednesday, 02. December 2015, 18:25 9 years ago
    This doesn't work?

    fonts = game.FontLinks
    
    for i = 1, #fonts do
        print( fonts[i]:getName() )
    end
    

    Key Killer

    810 Posts

  • #68, by darren-beckettWednesday, 02. December 2015, 18:34 9 years ago
    Ok, nice one.

    Great Poster

    384 Posts

  • #69, by SimonSWednesday, 02. December 2015, 20:11 9 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
    

    Thread Captain

    1581 Posts

  • #70, by afrlmeWednesday, 02. December 2015, 21:27 9 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?

    Imperator

    7278 Posts