Aller au contenu

Photo

How do I fire a plot flag when a team of monsters is dead?


4 réponses à ce sujet

#1
PavelNovotny

PavelNovotny
  • Members
  • 344 messages
I have a team of monsters that attack the PC and I want to set a plot flag when all the monsters are dead. I think someone else asked about this once, but my forum searching is not bringing it up and I can't find it in the wiki.

Any suggestions?

Thanks!

#2
Challseus

Challseus
  • Members
  • 1 032 messages

PavelNovotny wrote...

I have a team of monsters that attack the PC and I want to set a plot flag when all the monsters are dead. I think someone else asked about this once, but my forum searching is not bringing it up and I can't find it in the wiki.

Any suggestions?

Thanks!


Obviously, make sure they are all given a unique team id, like 10. In the area that the encounter takes place, you will need to setup an area core script and catch the event like so:

...
        case EVENT_TYPE_TEAM_DESTROYED:
        {
            int nTeam = GetEventInteger(ev, 0);
            switch (nTeam)
            {
                //Team 10 was killed
                case 10:
                {
                    //you set your plot stuff here
                    break;
                }
            }
            break;
        }
...


#3
BillHoyt

BillHoyt
  • Members
  • 109 messages
If I have only one creature to kill, is it generally accepted to put the creature on a unique team and add the quest update code in the area's script as in the above? Or is it easier to modify a creature_core script for the specific monster and run the quest-update code that way?

#4
Magic

Magic
  • Members
  • 187 messages
I suggest to do what is easier for you. Since the team destroyed mechanism is not requiring more than one creature, I'd say this counts as "generally accepted". If you have a custom area script for team destroyed events anyway, I suggest to just use another team ID. If this creature has an own script already, its death event is also an option. Making an extra script is not desirable.

#5
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages

BillHoyt wrote...

If I have only one creature to kill, is it generally accepted to put the creature on a unique team and add the quest update code in the area's script as in the above? Or is it easier to modify a creature_core script for the specific monster and run the quest-update code that way?


I tend to like to script all my death functionality through the team death even on the area, even if the team only has a single creature. It keeps things in one place. The death event on the creature works just as well however: it’s a question of organization and preference really.