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
Creature Spawn toggle
Débuté par
Snottling
, sept. 12 2012 04:38
#1
Posté 12 septembre 2012 - 04:38
#2
Posté 13 septembre 2012 - 01:00
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
Kato
Modifié par Kato_Yang, 13 septembre 2012 - 01:19 .
#3
Posté 13 septembre 2012 - 02:48
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
Does that sound possible?
-Snottling
#4
Posté 13 septembre 2012 - 03:10
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
{
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
Posté 13 septembre 2012 - 08:53
Thanks a lot! I'll try it out as soon as possible.
#6
Posté 14 septembre 2012 - 11:56
Works perfectly. Thanks Kato.





Retour en haut







