Kills made Trigger?

Discussions about Coding and Scripting
Post Reply
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Kills made Trigger?

Post by zacman »

Ok, this might be a bit complicated to explain, but...

What I'm after is a trigger that will count the amount of kills made for the match, once x amount of kills is reached, the trigger event goes off. This way, players can fight a megacrapton of the monsters they WANT to, rather than x amount of each individual monster. Does anyone know how to impliment this?
Image[url=steam://friends/add/76561198048595886]Image[/url]
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Kills made Trigger?

Post by Rakiayn »

Im not sure what you mean.

you can make a custom mutator to do that.
take a look at the fatboy mutator.

code will be something like this

if (killer.playerreplicationinfo.score >= score)
{
do stuff
)
Meindratheal
Average
Posts: 61
Joined: Thu Jun 03, 2010 3:53 pm

Re: Kills made Trigger?

Post by Meindratheal »

Not sure how it works, it depends on a few things, but if:
1) Monster cause an event when they die and
2) You can change the event they cause

then you could just make a counter, set to the number of monsters you want to have to kill, then have the counter trigger the whatever you need triggering.
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Kills made Trigger?

Post by zacman »

Can't use counters, because I'm using ThingFactories, which automatically set the monsters to their event, which stops me using a universal event :/
Image[url=steam://friends/add/76561198048595886]Image[/url]
Meindratheal
Average
Posts: 61
Joined: Thu Jun 03, 2010 3:53 pm

Re: Kills made Trigger?

Post by Meindratheal »

If ThingFactories set the event, can't you tell them what to set it to? And if it's not configurable, you could always make a subclass and override the function that sets the event.
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Kills made Trigger?

Post by zacman »

The Thingfactories set the event to match their tag so that the death of the monster triggers them to spawn another :/
Image[url=steam://friends/add/76561198048595886]Image[/url]
Meindratheal
Average
Posts: 61
Joined: Thu Jun 03, 2010 3:53 pm

Re: Kills made Trigger?

Post by Meindratheal »

Ahh, I see. On second thoughts ,couldn't you make a subclass of the ThingFactory that causes a event when it is triggered, and use that for a counter?
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Kills made Trigger?

Post by zacman »

But then I have the problem of if a player runs over the spot that triggers it 500 times, it triggers a boss fight without the player killing anything :S
Image[url=steam://friends/add/76561198048595886]Image[/url]
Meindratheal
Average
Posts: 61
Joined: Thu Jun 03, 2010 3:53 pm

Re: Kills made Trigger?

Post by Meindratheal »

I mean, in the ThingFactory code, add a part that, when it spawns a new monster, it calls a second event which is connected to your counter. This won't trigger by touch, unless the code tells it to.
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Kills made Trigger?

Post by zacman »

Got it sussed, using Dispatchers, roundrobins and Counters :tu:
Image[url=steam://friends/add/76561198048595886]Image[/url]
Post Reply