ActorListIndex

v0.0.3·Updated 2025-02-22

Exposes the index an Actor was placed at for the scene's ActorList command

About this mod Author’s original text

ActorListIndex

Exposes the index an Actor was placed at for the scene's ActorList command.

Usage

This can be used to reliably identify actors within a given scene with some exceptions:

  • A mod can augment the scene's original ActorList command. I'm sort of hoping this doesn't become a common practice, as there are easier ways to remove/add actors to a given scene.
  • Some actors are spawned _after_ this ActorList command, like individual bushes of grass.

// Import function

RECOMP_IMPORT("ProxyMM_ActorListIndex", s32 GetActorListIndex(Actor* actor));

RECOMP_CALLBACK("*", recomp_after_actor_init)

void AfterActorInit(PlayState play, Actor actor) {

s32 actorListIndex = GetActorListIndex(actor);

// This will always be the front right barrel near the turtle's right fin in GBT

if (

play->sceneId == SCENE_SEA &&

play->roomCtx.curRoom.num == 13 &&

actorListIndex == 6

) {

Actor_Kill(actor);

}

if (actorListIndex == -1) {

// Spawned outside of an ActorList command

}

}

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.

Install locations vary a lot between mods — the bundled readme is the most reliable guide.

File & checksum

Filename
ActorListIndex-0.0.3.zip
File size
127.1 KiB