Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Rocco on Fri 15/06/2012 11:33:23

Title: repeatedly_execute_always for Rooms?
Post by: Rocco on Fri 15/06/2012 11:33:23
i would need a room function
Code (AGS) Select
function room_RepExec_always()
cause when the player performs an additional animation with LockView and animate....
some things that are going on in the background stucks meanwhile.
Is there a an similar function like the normal repeatedly_execute_always() function for rooms?
Title: Re: repeatedly_execute_always for Rooms?
Post by: EchosofNezhyt on Fri 15/06/2012 12:28:58
room_RepExec ?
Title: Re: repeatedly_execute_always for Rooms?
Post by: Khris on Fri 15/06/2012 12:29:10
Just use exactly that:
Code (ags) Select
// inside room script

function repeatedly_execute_always() {
  ...
}


Edit: room_RepExec isn't executed during blocking events, that's why Rocco asked for rep_ex_always
Title: Re: repeatedly_execute_always for Rooms?
Post by: Rocco on Fri 15/06/2012 13:10:17
perfect, big thx.  :-D
Code (AGS) Select
function khrismuc_knows_everything_always()

and if i read the manual more attentively next time, i would too.  :P
Quote from: AGS-HelpTo create repeatedly_execute_always, you can simply paste it into the script as above -- but you can also paste it into room scripts.
Title: Re: repeatedly_execute_always for Rooms?
Post by: EchosofNezhyt on Fri 15/06/2012 13:14:02
Oh whoops I read it backwards.
Title: Re: repeatedly_execute_always for Rooms?
Post by: monkey0506 on Fri 15/06/2012 15:53:14
I still think the default name for the room-based rep_ex function should be repeatedly_execute not room_RepExec. I get that CJ was trying to show that this is a function that has to be linked to the room's events, but still it's a complete regression against every other ASC script file. It would also be nice if events could be automatically linked if no event handler existed but a function was added with the default name (would save a lot of Beginner's threads for the lightning bolt icon, no?).
Title: Re: repeatedly_execute_always for Rooms?
Post by: EchosofNezhyt on Fri 15/06/2012 16:43:38
Quote from: monkey_05_06 on Fri 15/06/2012 15:53:14
I still think the default name for the room-based rep_ex function should be repeatedly_execute not room_RepExec. I get that CJ was trying to show that this is a function that has to be linked to the room's events, but still it's a complete regression against every other ASC script file. It would also be nice if events could be automatically linked if no event handler existed but a function was added with the default name (would save a lot of Beginner's threads for the lightning bolt icon, no?).

Yeah, That seems simple enough and starting off you could get confused with that error if you delete the code but leave the event.
Title: Re: repeatedly_execute_always for Rooms?
Post by: ThreeOhFour on Fri 15/06/2012 17:00:19
Quote from: monkey_05_06 on Fri 15/06/2012 15:53:14
I still think the default name for the room-based rep_ex function should be repeatedly_execute not room_RepExec.

I agree with this, it's a sensible change.