My fireflies freeze when other characters talk

Started by FocusHillGames, Tue 14/05/2024 14:12:52

Previous topic - Next topic

FocusHillGames

I've got fireflies in my game (they are not meant to be interacted with, they're just decorative), and I've created them as characters, and they are on their own walkable area.

I have this code in Repeatedly Execute -


Code: ags
function room_RepExec()
{
if (cFly3.Room == player.Room) {
   if (cFly3.Moving == false) {
     cFly3.WalkStraight(Random(Room.Width), Random(Room.Height));
  }
}
}


This works great, except when the player talks to another character, as the fireflies then stop moving.

It's not a massive problem, but ideally I'd like to fix it.

eri0o

Leave this function blank and put this code in the
Code: ags
void repeatedly_execute_always()
{
  // Your code
}


FocusHillGames

Thanks!
Is it better to use "void" or "function" before it, in this scenario?

Crimson Wizard

Quote from: FocusHillGames on Tue 14/05/2024 15:13:04Is it better to use "void" or "function" before it, in this scenario?

This is mostly irrelevant.
"function" is a traditional type of functions in AGS.
"void" is a way to explicitly tell that the function returns no result.

SMF spam blocked by CleanTalk