Aller au contenu

Photo

Creature Spawn toggle


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
Snottling

Snottling
  • Members
  • 98 messages
Hey guys!
I was wondering if it's possiple for a DM to toggle creature spawns on/off in an entire area with, say, a DM wand?
What scripts would I need?

Thanks,
-Snottling

#2
Kato -

Kato -
  • Members
  • 392 messages
Do you use standard encounters or a custom spawner? In the first case you could loop over the area triggers and set them to active/inactive with a few lines of code. In the second case, spawners often check a variable set on the area, so you could set the variable accordingly to start/stop the spawner. Only suggestions, I can't really say more without having more details...


Kato

Modifié par Kato_Yang, 13 septembre 2012 - 01:19 .


#3
Snottling

Snottling
  • Members
  • 98 messages
Ah yes, I use standard BioWare encounter triggers. I envision using the DM wand on the ground in an area, and via dialogue (DMFI-style) I would be able to toggle the encounters off and on.
Does that sound possible?

-Snottling

#4
Kato -

Kato -
  • Members
  • 392 messages
void SetAreaSpawning(object oArea, int bSpawning) // pass true or false to bSpawning
{
   object oEnc = GetFirstObjectInArea(oArea);
   while(oEnc != OBJECT_INVALID)
   {
      if(GetObjectType(oEnc) == OBJECT_TYPE_ENCOUNTER) SetEncounterActive(bSpawning, oEnc);
      oEnc = GetNextObjectInArea(oArea);
   }
}

The function is generic, thus it could be called from anywhere provided that the correct parameters are passed, and it also assumes that the check to see if user is a DM is performed in the client code.

Note: If your triggers follow a tagging convention you could alternatively retrieve them with GetObjectByTag() for better efficiency(i.e. ENC_ + <Area tag> for instance). 


Kato

Modifié par Kato_Yang, 13 septembre 2012 - 03:29 .


#5
Snottling

Snottling
  • Members
  • 98 messages
Thanks a lot! I'll try it out as soon as possible.

#6
Snottling

Snottling
  • Members
  • 98 messages
Works perfectly. Thanks Kato.