Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: janker on Wed 02/09/2009 06:57:44

Title: Idle View Frame Looping Problem... Please HELP!!!
Post by: janker on Wed 02/09/2009 06:57:44
Alright! Here it is... I want to make my playable character animated when he is in idle view with delay set to 0. Let's go step by step... My character is called Kabal. I made view about 10 frames called KABALSTANCE with ID number 2. Well now, I know that default idle timing is about 20 seconds but I want it to be 0 so my character can be idle all the time when it is not walking. I want it to be animated with those 10 frames I made... and now I don't know which one script I have to use to do this. I tried something called  SetCharacterIdle(2,0); but it doesn't work properly. I put it in global script in line 63 where is "function repeatedly_execute()" but what happens! Only first frame out of 10 of view called KABALSTANCE is displayed! I don't know what script to use so I can see idleview animation working with all ten frames with delay of 0! PLease help me with this! It would be nice if you could write me that script so I can copy paste it in global script on a right place (please name where is excatly right place where I have to put right scrip code) I am only 2 day AGS user! I found out many thing all by myself but now I am stuck! Please, I need your assistance! I will be very thankful to you!
Title: Re: Idle View Frame Looping Problem... Please HELP!!!
Post by: Gilbert on Wed 02/09/2009 07:27:39
You don't need to set the idle timer every game loop (as you reset it repeatedly, this is why the character is constantly on the first frame). You only need to change it once in the game (unless you want to change it to some other values in latter part of the game).

You may try to put this in game_start() of the global script. If that doesn't work (as during game_start() the game materials are not fully loaded yet, so this may not work there), put it in the 'first time enters room' event of the first loaded room of the game.
Title: Re: Idle View Frame Looping Problem... Please HELP!!! (SOLVED)
Post by: janker on Thu 03/09/2009 11:45:53
The script you gave me doesn't work but place in global script is right! And I have found the right script code to do that! So I just want to say thank you for you assistance and time! So let there be written officially for the other AGS Forum users! If you want to decrease idle view delay you should do next:


Put Code     cCharacter.SetIdleView(2,0);    (where is cCharacter put your character name there example: if your desired character is named Igor  you should put there cIgor.SetIdleView(2,0)... and where is (2,0)   number 2 is ID number of your view and 0 is idle view delay time)... and now put your   cIgor.SetIdleView(2,0)          between {} in global sript named function game_start()   so it will actually look like this:

function game_start() {   

  cIgor.SetIdleView(2,0);

}



but!   you already have function game_start() by default in you global script editor somewhere around line 44 you will see so feel free to add your  cIgor.SetIdleView(2,0); there between {} is that right!? I hope that I was pretty accurate and that this solves the problem for the others! It worked for me! I wish you all luck in future game developing! Just go for it! You can make it!!! Janker