Change footstep sound in 2.72 (Solved)

Started by placyd, Sat 01/12/2007 14:59:03

Previous topic - Next topic

placyd

I am making my new game in ags 2.72, and I can't change the footstep sound in a room.
In older versions I just simply use SetFrameSound, but I can't use it now.
Please tell me, how this ViewFrame.Sound works, because I can't get it.

Ashen

There's an extra step you have to take, to make it work now. While you used to be able to access the frame directly with SetFrameSound, you now have to make a ViewFrame pointer to the frame and use the ViewFrame.Sound property. The example in the manual is pretty clear for the first part (making the pointer), although it only shows getting the property, not setting it.

Basically, instead of:
Code: ags

SetFrameSound (1, 2, 0, 25); // Set Frame 0 of Loop 2 of View 1 to play sound25


You'd now use:
Code: ags

ViewFrame *frame = Game.GetViewFrame(1, 2, 0); // Create pointer to Frame 0 of Loop 2 of View 1
frame.Sound = 25; // Set frame's sound to 25


To change multiple frame sounds, you need to update the pointer and repeat:
Code: ags

ViewFrame *frame = Game.GetViewFrame(1, 2, 0); 
frame.Sound = 25; // Same as above
frame = Game.GetViewFrame(1, 2, 3); // Now setting Frame 3 of Loop 2
frame.Sound = 25; 
frame = Game.GetViewFrame(1, 2, 6); // And Frame 6
frame.Sound = 25; 
//etc


I know what you're thinking ... Don't think that.

placyd

Thank you!
I couldn't set it by the manual, but it's working now!  :)

SMF spam blocked by CleanTalk