I can't believe I can't make this work... I am so angry I'm about to pop a fuse! In a rooms repeatedly execute:
if (i = 320) {
Ã, SetCharacterView(JUBALON, 23);
Ã, AnimateCharacter(JUBALON, 0, 3, 1);
Ã, while (character[JUBALON].animating) Wait(1);
Ã, ReleaseCharacterView(JUBALON);
Ã, i = 0;
Ã, }
i++;
}
My problem is where to define integers start value?
It's supposed to be an Idle animation, where a person is sipping soda from a bottle. When the animation is running, the bottle, Object 0, should vanish.
I've tried using the Idle animation thing, but that doesn't let me turn an object off, or does it? (Actually I tried playing an empty sound file during one frame of the animation to remove Object(0) (With the help of a bit of code in rep execute), but, since AGS can't distinguish one sound from another, it didn't work correctly. If a command like IsSoundPlaying(8) would be available, it would save a lot of trouble.
Or, perhaps there is a command that reports back if a spesific View is being used? If the program could report back if my character is using view 23 I'd sure appreciate someone telling it to me.Ã, :-X
Firstly, you should write
if (i == 320)
rather than if (i = 320)
Secondly, if you're using v2.7+, you can write
if (oSodaBottle.Visible && gJubalon.View == 23 && gJubalon.Frame == 5) oSodaBottle.Visible = false;
in repeatedly_execute.
That last piece of code certainly did the trick! Thank you! :)
Quote from: SteveMcCrea on Thu 06/10/2005 04:21:33
if (oSodaBottle.Visible && gJubalon.View == 23 && gJubalon.Frame == 5) oSodaBottle.Visible = false;
in repeatedly_execute.
I'm not sure if it would take longer to check the value or to assign it (even though it will take a fraction of a second), but even if oSodaBottle.Visible is false, you can still set it to false, so unless it saves time to check it instead of just setting the value, the check is not necessary. And just to clarify, isn't
Jubalon a character, meaning it would be
cJubalon, not
gJubalon?
Good point. Seems he got it working anyway!