License from €75
DE EN FR ES IT CZ

Chasing character interaction.

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

  1. · 12 years ago
    Don't need a function for that i will have only one chasing character.
    I was using what i found in the wiki not sure if there is more info about shorthands somewhere. It's working like that.

    local c = Characters["kolegaNormal"].Position
    
    if game.CurrentCharacter.Position.x >= c.x then
     game.CurrentCharacter.Destination = { x = (c.x + 150), y = c.y }
    else
     game.CurrentCharacter.Destination = { x = (c.x - 150), y = c.y }
    end
    
  2. · 12 years ago
    Ok dokie. smile

    No there is not any actual information about shorthand Lua script & VisObject access. To be honest, I have no idea how I would even begin to document it as it's not set in stone & you can try various possibilities of accessing / setting something...

    game.CurrentCharacter.Destination -- or
    game.CurrentCharacter.CharacterDestination
    

    Sometimes you can really shorten the paths like in the first example line above & other times you have to type out the full table / field name or it won't work. A good example of a table where you have to type the paths out in full is the active animation table...

    ActiveAnimations["test"].AnimationLastFrame
    ActiveAnimations["test"].AnimationCurrentPosition
    -- etc...
    
  3. · 12 years ago
    Ok so it's just about trying what works in the current situation, anyway the final script is much cleaner than the first one so thanks.
  4. · 12 years ago
    Exactly! & no problem. wink

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?