I think I understood you wrong. I tried this:
Code: ags
and this
Code: ags
First code, CHIP didn't talk. Second code, CHIP wouldn't stop animating.
timer++;
if (animating==0) {
if (timer==time) {
rand = Random(3);
SetCharacterView(CHIP,23);
AnimateCharacterEx(CHIP, 0, 5, 1, 0, 0);
if (rand == 0) {
PlaySoundEx(13, 3);
line = DisplaySpeechBackground(CHIP, "!");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
if (rand == 1) {
PlaySoundEx(14, 3);
line = DisplaySpeechBackground(CHIP, "!");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
if (rand == 2) {
PlaySoundEx(15, 3);
line = DisplaySpeechBackground(CHIP, "...");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
else if (rand == 3) {
PlaySoundEx(16, 3);
line = DisplaySpeechBackground(CHIP, ".");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
timer=0;
animating=1;
}
}
if (timer==time) {
if (IsOverlayValid(line)){
DisplaySpeechBackground(CHIP, "");
ReleaseCharacterView(CHIP);
animating=0;
timer=0;
}
}
and this
timer++;
if (animating==0) {
if (timer==time) {
if (timer==time) {
rand = Random(3);
SetCharacterView(CHIP,23);
AnimateCharacterEx(CHIP, 0, 5, 1, 0, 0);
if (rand == 0) {
PlaySoundEx(13, 3);
line = DisplaySpeechBackground(CHIP, "!");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
if (rand == 1) {
PlaySoundEx(14, 3);
line = DisplaySpeechBackground(CHIP, "!");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
if (rand == 2) {
PlaySoundEx(15, 3);
line = DisplaySpeechBackground(CHIP, ".");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
else if (rand == 3) {
PlaySoundEx(16, 3);
line = DisplaySpeechBackground(CHIP, ".");
if (IsChannelPlaying(3) == 0 && character[CHIP].animating){
ReleaseCharacterView(CHIP);
}
}
timer=0;
animating=1;
}
}
}
if (IsOverlayValid(line)){
DisplaySpeechBackground(CHIP, "");
ReleaseCharacterView(CHIP);
animating=0;
timer=0;
}
First code, CHIP didn't talk. Second code, CHIP wouldn't stop animating.
