Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey Cecil, I hope you can help out with this. I'm developing an entity for laser beam type particle effects and I just can't get it to interact with triggers. So far it can be activated and deactivated manually in the editor, but not with a trigger set to "activate/deactivate event" as it's supposed to.

The entity in question.

If you only intend on toggling particle effects without any logic surrounding them, you can remove Active() and Inactive() procedures entirely and replace this block:

    // go into active or inactive state
    if (m_bActive) {
      jump Active();
    } else {
      jump Inactive();
    }

With this:

    // Wait for the game to start
    autowait(0.05f);

    wait() {
      on (EActivate) : {
        m_bActive = TRUE;
        resume;
      }
      on (EDeactivate) : {
        m_bActive = FALSE;
        resume;
      }
      otherwise() : { resume; }
    }

Sadly, this is still not working.

The class should be derived from CRationalEntity in order to process logic. Easy mistake to make.

class CBeam: CEntity {

Oh, so that's why it's called that. Thanks, it works now.