Visionaire Studio 4.2.5 Released

  • #130, by sebastianSunday, 28. August 2016, 18:43 5 years ago
    because of preventing redundant code.
    The workaround i am doing now is using a "call action" action part under F5 and call the function which does the screenshot (so moving it somewhere else) and also call this function via Lua when pressing "select".

    Thread Captain

    2346 Posts


  • #131, by afrlmeSunday, 28. August 2016, 19:35 5 years ago
    ah for the controller support, I should have known. I was actually going to suggest possibly adding the screenshot stuff into a called by other action, but I guess you already thought of it. wink

    Imperator

    7008 Posts

  • #132, by sebastianMonday, 29. August 2016, 00:53 5 years ago
    It seems that SHIFT (Left/RIght) and Alt (Left/RIght) are also not recognizable via keycode or character... weird. Even if the keycode is printed i cant handle it via an LUA "if" .

    Thread Captain

    2346 Posts

  • #133, by sebastianSaturday, 08. October 2016, 16:12 5 years ago
    Am I right that i now can do this with 4.2.5 to start an action from character with ID 4 ?:
    startAction(Characters[4].Actions["my_action_name"])
    1
    2


    (background is that "my_action_name" could occur also in other characters)
    But it doesn't work... Did i get something wrong or is this iterating through the objects not available for character ids?

    Thread Captain

    2346 Posts

  • #134, by afrlmeSaturday, 08. October 2016, 16:26 5 years ago
    Why use ID? & no idea as I've never tried using anything other than names for objects, characters, etc before.

    Imperator

    7008 Posts

  • #135, by sebastianSaturday, 08. October 2016, 16:31 5 years ago
    because the id is much shorter here. I also used my name to define some attributes the character has.
    Like "character_name EAT PUNCH" to overwrite talk with "eat" and "use" with "punch". It would be easier for me to have an ID (from the character table) which never changes while developing something instead of name which may vary...

    Thread Captain

    2346 Posts

  • #136, by afrlmeSaturday, 08. October 2016, 16:51 5 years ago
    You can return the id of a character easy enough, which should remain constant for said character. As for animations, if you use the same names for each animation in all of said characters outfits, then you can just use the .CurrentOutfit field to access the correct animation.

    Problem with ID is that you will need to manually remember which belongs to which character. For me that's impossible due to my memory, so names work best for me. I guess quickest method to return all ID's would be to use a for loop & print id of all characters to the log file, something along the lines of...
    for i = 1, #game.CharacterLinks do
    print( i, game.CharacterLinks[i]:getName(), game.CharacterLinks[i]:getId().id )
    end
    1
    2
    3
    4

    ... seems the id index starts at 0.

    Imperator

    7008 Posts

  • #137, by sebastianSaturday, 08. October 2016, 17:04 5 years ago
    I use the explorer, going to the said char in eCharacters and R-Click>Dump to Log to see which ID the wanted character has.

    Here is what i did now. Seems to work...:
    local uuid = 4
    startAction(getObject("(0," .. uuid ..")").Actions["my_action_name"])
    1
    2
    3

    0 is the table ID for eCharacters, 4 is the object ID (wanted character)

    Thread Captain

    2346 Posts

  • #138, by afrlmeSaturday, 08. October 2016, 17:20 5 years ago
    Seems id method only works with getObject("(tableid, objectid)"). Couldn't get it to work in shorthand.

    Imperator

    7008 Posts

  • #139, by sebastianSaturday, 08. October 2016, 17:52 5 years ago
    As long as it works like that, im okay with it^^

    Thread Captain

    2346 Posts