Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: cipberbloom on Tue 23/03/2021 20:11:02

Title: Changing Idle default delay with SetIdleView [SOLVED]
Post by: cipberbloom on Tue 23/03/2021 20:11:02
Hullo everyone,

I'd like the delay until my character switches into idle mode to be shorter (two seconds to be precise; in this post https://www.adventuregamestudio.co.uk/forums/index.php?topic=54519.0 (https://www.adventuregamestudio.co.uk/forums/index.php?topic=54519.0) the default is said to be 20 seconds).

So I wound up putting

Code (ags) Select
cMalcolm.SetIdleView(15, 2);

in the game_start function in the global script, which works great if he's walking forwards (Y axis), but if he walks to the side (X axis) or even towards the back of the room the game crashes. 'The game engine does not appear to have shut down properly. If the problem persists, post the problem on the Tech forum.'

Alternatively, I've tried it in the room_load function in the main room, but get the same crash. Apologies in advance if this is a completely bizarre/wrong thing to do. Still learning!

Thanks!  ;-D
Title: Re: Changing Idle default delay with SetIdleView
Post by: Khris on Tue 23/03/2021 21:02:06
AGS supports directional IdleViews; did you put sprites in all first four loops of View #15?
Because if you only put them in the first loop, that's why AGS crashes: it tries to display viewframes that don't exist.

A good rule of thumb is to put at least one (placeholder) sprite in each of the four main loops for any new view, unless it is used exclusively for animations where only a specific loop is used.

Edit: hmm, I could've sworn that's how IdleViews work; take my post with a grain of salt then
Title: Re: Changing Idle default delay with SetIdleView
Post by: arj0n on Tue 23/03/2021 21:08:21
Odd, in my case the player has diagonal loops set to yes, and the view used for idleview has only 1 loop activated/with frames, 'loop 0 (down)'.
When the player is standing sideways or up the idle view plays fine.
Title: Re: Changing Idle default delay with SetIdleView
Post by: cipberbloom on Tue 23/03/2021 22:22:03
Quote from: Khris on Tue 23/03/2021 21:02:06
AGS supports directional IdleViews; did you put sprites in all first four loops of View #15?
Because if you only put them in the first loop, that's why AGS crashes: it tries to display viewframes that don't exist.

Oh my god, thank you! *smacks forehead* That makes perfect sense! He's turned to the left or going backwards or whatever and yet I only had idle frames in the front-facing (0) loop.

Before I checked back here on this thread I was trying to mess about with custom properties.  ???

Again, thanks a million!  :-D
Title: Re: Changing Idle default delay with SetIdleView
Post by: Khris on Tue 23/03/2021 23:24:43
Great, so did you test this? Given that arj0n says an idle view with a single loop works fine for him?
Title: Re: Changing Idle default delay with SetIdleView
Post by: cipberbloom on Mon 29/03/2021 10:21:58
Quote from: Khris on Tue 23/03/2021 23:24:43
Great, so did you test this? Given that arj0n says an idle view with a single loop works fine for him?

Hey!

Apologies, I didn't see this until now. Yes, it did fix it for me.

Again, thank you! ;-D