Problem with aligning character (position to execute action) to object after moving it first

  • #1, z PascalTuesday, 31. May 2016, 21:59 hodinky 9 years ago
    Hello everyone,

    I've only started using VS so this might seem kinda stupid since it's a rather common thing in games to be needed I suppose, but I couldn't find it in the forums so here we go:

    I have an object / item that's located above the player character (a ball lying on a high wall, to make explaining easier vor me). After some interaction the object is moved via script introduced by AFRLme (https://wiki.visionaire-tracker.net/wiki/MoveObj_%28CMS%29) to a position more or less next to the feet of the character. (I reckon the script does the same as the implemented "move obj to" feature in VS, but since it works I left it that way smile).

    Now I have the following problem:
    I set the alignment of the character to the object in VS to the coordinates that correspond to the character standing in front of the wall right underneath the ball. What I already figured out is, that Visionaire keeps this alignment even after the object has moved and now the character interactions with it cannot be triggered anymore cause that point of alignment is outside the borders of the scene (he walks to the edge of the screen and then just stops naturally).
    I tried to use the align function and the align script from the wiki, but they seem only to change the direction the character is facing. My hope was that there is an easy way to call and change the coordinates (not only the angle) of the alignment of the character to the moved object so he can walk up to it and pick the frigging thing up.

    Thanks in advance and sorry if I missed some crucial information that solves that problem quite elegantly and quickly, but help is appreciated anyways smile

    Regards
    Pascal

    Bažant

    5 Posts


  • #2, z brut69Tuesday, 31. May 2016, 22:19 hodinky 9 years ago
    It would be easier to create 2 objects instead of moving one. Once the 1st object hits the floor then just remove it and make the 2nd object appear. Have the character then interact with the 2nd object.

    Čestný člen

    266 Posts

  • #3, z sebastianTuesday, 31. May 2016, 22:36 hodinky 9 years ago
    There is an direction field in the object table. But it is not scriptable via lua regarding to the wiki.
    So as brut69 mentioned it would be the easiest way to set a condition to true after the movement and by that hide the object and show a new object in the new position.

    Kapitán

    2346 Posts

  • #4, z afrlmeTuesday, 31. May 2016, 22:55 hodinky 9 years ago
    Yeah, it's much less complicated to duplicate your object & just move it & its polygon/images/animations to the new position on the scene, then show / hide it & the old object via a condition as needed.

    Messing around with object position isn't all that good to be honest as it affects the position of all images / animations & interaction polygons associated with said object & I believe it also affects the object center value too, but I don't know if it affects object center values that are -1 before moving said object.

    The only real reason you might need to move an objects position is if you had some kind of mini-game in which the player has to click on a moving object (a shooting gallery type game, or something along those lines).

    Imperátor

    7285 Posts

  • #5, z PascalTuesday, 31. May 2016, 23:21 hodinky 9 years ago
    Thanks a lot everyone, that sorted out my problem really quickly!

    Bažant

    5 Posts