Jump to content

Home

Scripting: Clear all enemies = trigger


Kengo

Recommended Posts

I donno how to do it realy, only just learning scripting so this is a semi-educated guess.

But i think stuff like this is possible, remember in The Ladder

the next squad spawns after you kill all the members of the current one.

So you might want to look there for a possible method for doing this sort of thing.

Link to comment
Share on other sites

give your stormtroopers an NPC_target key with a value like "deathcount1"

 

then create a target_counter with the key "count" and the corresponding value (amount of stormtroopers where every killed stormtrooper adds 1 to the count). If you have 4 Stormtroopers, then add 4 as the value for the count key.

Give your target_counter the key "targetname" with the value "deathcount1".

Then implement a usescript-command into the target_counter entity and you can run as many cinematics as you want :)

 

 

hope this helps

Link to comment
Share on other sites

Why, to me it seems as simple as it can be, considering the building blocks you actually have in Radiant (and the game). Maybe I should invent some way to implement that kind of stuff to my map, though I have no idea yet, where I'd need such counter deeds. No, wait. One might actually use it also with switches, so that you had to use multiple switches in many places to get some machine, door or whatever to work. That's what I'm gonna do.

 

Thanks Drakewl for the idea.

Link to comment
Share on other sites

  • 5 months later...

Man....this is an old topic - still, good to see people are using the search function eh? :)

 

I don't see the problem - the target_counter is fired after a certain number of other things are killed/used, then it fires something else like a cutscene or some other big of scripting. Why would you not want it to be removed after?

Link to comment
Share on other sites

in my map the game spawns randomly one, two or three opponents. After all opponents are killed the map should 'reset' the trigger so another wave can spawn. This all works untill I get a certain wave for the second time. IE, I get a wave of three, then a wave of two, then another wave of three. After the three are killed the trigger does not reset because the counter removed itself

Link to comment
Share on other sites

I think, now this may get complicated, that you could have an individual counter for each wave.

 

As each wave completes...the trigger fires...and another counter tracks the number of waves.

 

This other counter will fire when all waves are complete.

 

Make sense?

Link to comment
Share on other sites

Ahh....now THAT is clever!

 

So you can count target counters? Nice :)

 

It isn't as flexible, but you can spawn one NPC when another is killed by linking the first NPC to another, the one you want to spawn after they die. You could link 10 together and one would spawn as soon as you killed another. But this is just another, not as good way of doing things :)

Link to comment
Share on other sites

Another thought, borrowed from kejim_post.

 

All NPCs have same target (death).

 

First timer counts deaths and fires at say 3 and triggers respawn of however many.

 

Second timer counts deaths but fires at 4 and triggers respawn, etc.

 

Third timer fires at 7, fourth at 8, etc...

Link to comment
Share on other sites

Thank you for all your sugestions, however I would still be limited to a fixed number of waves.. I was thinking maybe I could make my own counter with relays, enables and disables.. but sofar I've been unable to, any ideas on that?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...