Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - georgeh

#1
Hello again.I am having a little trouble with timers(among others...).In my game i want a letter to be slipped under the door after lets say 10 sec,the player turns to face the letter,walk towards it,picks up and reads it.So far so good.I have set the timer in loadroom and the actions in room_repexec(with the "if isTimeExpired").The problem is that this action keeps repeating every 10 sec instead of once as i want to.I have read the manual,read most of the other posts about timers and repexec but i am a bit confused since i just have started using AGS.Here is my code:
function room_Load()
{
  SetTimer(1, 400);
}
//After more lines...//
function room_RepExec()
{
if (IsTimerExpired(1)==1){
  oenvelope.Visible=true;
  oenvelope.Move(162, 260, 2, eNoBlock, eAnywhere);
  cego.FaceObject(oenvelope,);
  Wait(80);
  cego.Walk(205, 260, eBlock, eWalkableAreas);
  cego.Say("What is this ???");
  SetTimer(1, 0);
}
}
The last"SetTimer" was put after i've tried many times the rest of the script to run once,as a final solution,but no.
Wouldnt the timer had expired in the above script?If i wanted to reset it ,wouldnt i have to put"SetTimer(1,400) again at the end of the script?
I saw that maybe the problem would be the"Wait" and "eBlock".I am confused about that after reading the manual.And again if i remove the "wait" and change the"eblock",the player doesnt walk at the specific command.He stays where he was.

PS(1) please be as specific as possible because in my first post for another problem i had i've recieved a vague answer like "the manual explains it better"and so i couldnt figure a solution and dropped it off.No disrespect,i am gratefull for your help but for us begginers something more specific would have been more help.
PS(2)forgive my looong post...
#2
Hello to everybody.This is my first post and very thrilled about it.A question about where to put my script.I have my character finding a ticket and i want after this a bus arriving to pick him up.I have done the scripting and its working with sound and everything but i have put the whole function after room_fadein.For this to work i have to leave the room and come back again.I have tried putting it in the GlobalScript but i get an error.It doesnt recognise my "obus" object.Where should i put this script to run on cue?
SMF spam blocked by CleanTalk