Dear AGS'ers, I'm trying to convert the old style coding for audio to the new format.
I have no clue where to begin. Ags tells me that I can't convert an AudioClip to an int which makes sense but its been so long away from scripting I've lost my touch.
This is my current code (old format):
Code: ags
As you might see, its a little dated. Anything I'm missing that I need to add in order for this function to work with the latest incarnation of AGS?
Merry wishes,
Sparky.
I have no clue where to begin. Ags tells me that I can't convert an AudioClip to an int which makes sense but its been so long away from scripting I've lost my touch.
This is my current code (old format):
function room_RepExec()
{
//===== FOOTSTEP SOUNDS =====//
ViewFrame *vf;
int fstep, idle, norm;
if (Region.GetAtRoomXY(player.x, player.y) == region[2]) {
idle = footstep2Bfx; norm = footstep2Afx;
}
else {
idle = footstep1Bfx; norm = footstep1Afx;
}
while (fstep<8) {
vf = Game.GetViewFrame(EGOWALK, fstep, 0);
vf.Sound = idle; // idle footstep
vf = Game.GetViewFrame(EGOWALK, fstep, 4);
vf.Sound = norm; // regular footstep
vf = Game.GetViewFrame(EGOWALK, fstep, 10);
vf.Sound = norm; // regular footstep
fstep++;
}
}
As you might see, its a little dated. Anything I'm missing that I need to add in order for this function to work with the latest incarnation of AGS?
Merry wishes,
Sparky.