Visionaire Studio 4.2.5 Released

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

    Čestný člen

    267 Posts


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

    Imperátor

    7285 Posts

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

    Čestný člen

    384 Posts

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

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

    Zabiják klíčů

    810 Posts

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

    Imperátor

    7285 Posts

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

    Thanks for the pointers.

    Čestný člen

    384 Posts

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

    Čestný člen

    384 Posts

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

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

    Zabiják klíčů

    810 Posts

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

    Čestný člen

    384 Posts

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

    Kapitán

    1582 Posts

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

    Imperátor

    7285 Posts