Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: jhonberg on Sun 11/06/2017 17:03:57

Title: Starting with Basic Movement, Idle , thinking views
Post by: jhonberg on Sun 11/06/2017 17:03:57
So i am bit lost here i mean to make my player show up in room which i managed to do, he can walk.  But my idle animation does not seem to be called.

Where should i set up this logic in the room.asc script ? 

I mean if i want to make him walk and talk for example i saw that there is no onMove  or onObjectMoving...  any ideas?

Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: jhonberg on Sun 11/06/2017 17:11:04

function room_RepExec()
{

}

i was thinking that maybe i should set up everything here... but then i don't understand how do i use the Idle views and thinking views available.(https://i.gyazo.com/4611c9f166625acac66ac679b3eba24c.png)

Addressing this problem seems not so trivial for me atm :S i might just overthinking something simple...
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: jhonberg on Sun 11/06/2017 17:21:05
Code (ags) Select
// room script file
bool moveStarted=false;
function room_FirstLoad()
{
  objFlower.SetView(2, 0, 2);
  objFlower.Animate(0, 5, eRepeat,eNoBlock);
 
  cEgo.LockView(3);
  cEgo.Animate(0, 30, eRepeat, eNoBlock);
  cEgo.UnlockView();

 
 

  cEgo.Say("HEllo");
   
  //cEgo.Animate(0, 45, eRepeat,eNoBlock);
  objFlower.Animate(0, 5, eRepeat,eNoBlock);
 
   

 
}

function room_RepExec()
{
  if(cEgo.Moving){
     moveStarted=true;
    }
   
  if(!cEgo.Moving && moveStarted == true){
     cEgo.Say("I stop now");
     moveStarted=false;
    }

}


here is how it's going so far.  So at least now when he stops moving he can say something...
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: Khris on Mon 12/06/2017 11:56:53
Have you done the manual's tutorial yet?

An Idle View only needs to be set, and should automatically start after a certain delay.
You can also use a script command to do this, you'd usually put it inside the GlobalScript's game_start function, which will run once before the first room is loaded.
  player.SetIdleView(ALIENIDLE, 3); // start idling after three seconds of not moving

As for setting up rooms, that's usually done in the function associated with the "player enters room before fadein" event.
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: jhonberg on Tue 13/06/2017 21:05:31
Wait i have to recheck this again because it was not working for me last time. BRB
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: jhonberg on Tue 13/06/2017 21:58:57
Yeah it works.
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: jhonberg on Tue 13/06/2017 22:25:08
Now that we are here, i wanted to ask  where the heck is the right edge line ??  there is left ,top , bottom  but no right??? wtf :D  i think i missed something here.
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: jhonberg on Tue 13/06/2017 22:26:38
Well seems that my background is too small and the right edge never got shown if it happens to any of you. :) just import a bigger image and move it to the center.
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: Khris on Tue 13/06/2017 23:48:19
Glad it works, but please use the Reply button at the bottom instead of pointlessly quoting the previous post.
Title: Re: Starting with Basic Movement, Idle , thinking views
Post by: Gilbert on Wed 14/06/2017 02:37:56
Cleaned the thread a bit from the unnecessary quotes.
Also, it is more preferable to edit your post to add details instead of making new posts in a row without a short time period.