Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Julius Dangerous on Wed 01/07/2015 14:03:28

Title: Tween for repeating actions?
Post by: Julius Dangerous on Wed 01/07/2015 14:03:28
is it possible, with tween features, to make a character (guard) distract, then he moves far from the player and made the player take a "forbidden object, having only some seconds to take it, until the character (guard) comes back ?

(This question split off the Tween module (http://www.adventuregamestudio.co.uk/forums/index.php?topic=51820.0) thread since it's really about a different issue entirely. - Snarky)
Title: Re: Tween for repeating actions?
Post by: Crimson Wizard on Wed 01/07/2015 14:36:28
Quote from: Julius Dangerous on Wed 01/07/2015 14:03:28
is it possible, with tween features, to make a character (guard) distract, then he moves far from the player and made the player take a "forbidden object, having only some seconds to take it, until the character (guard) comes back ?

AFAIK what Tween module does is changing given object parameters over time using particular formulae.
While it's still may be possible to find a use of Tween in your case, patrolling characters and delays are easily scripted with built-in AGS features too.
See, for example:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=40122
Title: Re: Tween for repeating actions?
Post by: Julius Dangerous on Thu 02/07/2015 17:32:30
i found it!

just used standard "set timer" command inside the dialogue and set variable (guardturned=true),
when dialogue stops, the guard walk to a far away position. Then, as part of  function room_RepExec(),
    the guard comes back..

function room_RepExec()
  {
   if (guardturned==true && IsTimerExpired(1))
    {
       etc..




guard come back to his position after X seconds :) and in the meanwhile i stealed the object, (sorry for my english)

thanks! :)