SUGGESTIONS: non blocking WAIT and set speed for CyclePalette

Started by BOYD1981, Mon 21/08/2006 17:44:57

Previous topic - Next topic

BOYD1981

i think a non-blocking alternative or setting to Wait would be handy for when people want a delay between actions taking place in Repeatedly_Execute_Always (such as two characters having a looping conversation in the background) for those of us who are not that experienced with either timers or custom functions.

a way to change the speed of CyclePalette (although it is hardly ever used by anyone) other than changing the game speed would be nice too as the way i'm slowing it down now is by including repeating colours in the cycle next to eachother.

Limey Lizard, Waste Wizard!
01101101011000010110010001100101001000000111100101101111011101010010000001101100011011110110111101101011

MrColossal

ew, the repeating colours method sounds quite messy and counter productive...

you could do... in terrible code:

int gocycle;

rep_exec:

gocycle++;

if (gocycle == 5){
cycle pallete code
gocycle=0;
}

that should, ever time the gocycle int gets to 5 run the palette cycling... though Gilbert will be able to tell you better since he's the dude I always go to when I need palette cycling help.

but this, I guess, a work around to your actual post.
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

BOYD1981

i was originally going to use SetPalRGB and UpdatePalette, but as i am terrible with timers i decided my way was easier, each colour is only repeated 3 times, but there are 8 of them, luckily the game itself only uses 16 colours, but if i wanted to use more then a way to control CyclePalette speed would be really great as i can see myself using this feature more often for simple animation, i'm using it to animate painted white lines on a road which would otherwise be a 7 frame animation which would be doable as an animated object as the animation doesn't really take up much space on the background and only add another 20k to the file size, but i want to play around with using it to animate on a larger scale some day (such as water/waves like in older games).
i'll experiment with your code a little later on, maybe a module could be developed to save CJ adding a feature very few people would use...

Limey Lizard, Waste Wizard!
01101101011000010110010001100101001000000111100101101111011101010010000001101100011011110110111101101011

SSH

My understanding of how AGS threads work is that a non-blocking wait isn't possible. But its easy to code something:

Code: ags

int count;
function repeatedly_execute_always() {
  if (something) {
    if (count==0) {
    // Do stuff for first bit
    else if (count==10) {
    // Do second lot of stuff
    } 
    count++;
  }
}

As for looping conversations in the background, I think there are various modules that can help you with that...    
12

SMF spam blocked by CleanTalk