Login / Registrieren
DE EN FR ES IT CZ
Zurück Nach oben

Chasing character interaction.

  • #10, by ke4 11 years ago Zitieren
    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
    
  • #11, by afrlme 11 years ago Zitieren
    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...
    
  • #12, by ke4 11 years ago Zitieren
    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.
  • #13, by afrlme 11 years ago Zitieren
    Exactly! & no problem. wink