Starting with Basic Movement, Idle , thinking views

Started by jhonberg, Sun 11/06/2017 17:03:57

Previous topic - Next topic

jhonberg

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?


jhonberg


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.

Addressing this problem seems not so trivial for me atm :S i might just overthinking something simple...

jhonberg

Code: ags
// 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...

Khris

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.
Code: ags
  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.

jhonberg

#4
Wait i have to recheck this again because it was not working for me last time. BRB

jhonberg

#5
Yeah it works.

jhonberg

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.

jhonberg

#7
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.

Khris

Glad it works, but please use the Reply button at the bottom instead of pointlessly quoting the previous post.

Gilbert

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.

SMF spam blocked by CleanTalk