PDA

View Full Version : When an entire team dies, restart.


Wilson [29th ID]
08-02-2006, 01:14 PM
Hey guys, I'm trying to find the most efficient way to run this realism mode plugin, and I'm hoping you can help.

I'd like this plugin to determine when an entire team has died. If so, the opposite team makes a full capture of the flags.

I have respawning disabled so people will actually stay dead, but I'd like it to act as if the other team made a full cap if the team is eliminated (the other team wins the round & it restarts)

I figured the easiest way to do it would be on client_death or the death_message Message (to count suicides). The things I've tried simply don't work and I feel like there's a more precise way to do this that you guys could suggest.

Basically my theory was,
On death {
get user's team
count how many players are alive on that team
if count is less than one, cap all the flags for the opposite team
}

But how is the most efficient way to write that?

Wilson [29th ID]
08-03-2006, 07:00 PM
Anyone know how to do this method?

diamond-optic
08-03-2006, 10:27 PM
hmm there might be some event called when a flag is capture.. you might be able to fake it and make the msgs yourself.. but im not sure..

i tried just creating a message for the RoundState and setting it to axis or allies hoping that changing that might force the round to end in that team's favor.. but it didnt do anything

=|[76AD]|= TatsuSaisei
08-04-2006, 06:45 AM
']

But how is the most efficient way to write that?

Write a plugin that "hooks" the entity in every dod map called the info_doddetect and have the plugin "convert" the map from normal to "para" style, which is ultimately what you are after. It is a "style" of maps that has long since been forgotten in favor of infinite spawning. para_ maps are what we now call CS style maps. One life per round.... which is what you are looking to do with a plugin right ?

Without a plugin, BSPedit any map and you can make the "switch", and the good news is, you can run the hacked map on your server, and noone has to download anything !!!

I can "convert" a few maps for you so you can see what I mean...

Wilson [29th ID]
08-05-2006, 03:04 AM
Wow, that made my day. I'm very glad to see that style of gameplay is still possible.

So far this is what I've managed to change. I can now successfully disable respawning but how do I make it detect if an entire team is dead to restart the round like it did in the old para maps? Is there something else I need to add?

From dod_kraftstoff:
{
"origin" "432 768 88"
"detect_wind_velocity_y" "0.0"
"detect_wind_velocity_x" "0.0"
"detect_axis_respawnfactor" "1.0"
"detect_allies_respawnfactor" "1.0"
"detect_points_timerexpired" "0"
"detect_timer_team" "1"
"detect_points_allieseliminated" "0"
"detect_points_axiseliminated" "0"
"detect_allies_paras" "1"
"detect_cls_mortar" "1"
"detect_axis_paras" "1"
"detect_axis_infinite" "0"
"detect_allies_infinite" "0"
"classname" "info_doddetect"
}

The thing I changed was the detect_axis_infinite and detect_allies_infinite (to 0)

=|[76AD]|= TatsuSaisei
08-05-2006, 03:30 AM
']Wow, that made my day. I'm very glad to see that style of gameplay is still possible.

So far this is what I've managed to change. I can now successfully disable respawning but how do I make it detect if an entire team is dead to restart the round like it did in the old para maps? Is there something else I need to add?

I get my information from here, and my experience with making maps...
http://collective.valve-erc.com/index.php?ent=info_doddetect&game=dod

There are 2 more entity properties you should try manipulating...

detect_target_allieseliminated (string) Target when allies are eliminated
detect_target_axiseliminated (string) Target when axis are eliminated
I am not sure if the "default" maps all use the same target name, BUT, what you could do is create your own end round entity from within the plugin, have the info_doddetect "target" one of these round end entities and "end" the round that way....

I will contact you on AIM and try to help with what I know about mapping, and entity programming...

diamond-optic
08-05-2006, 09:11 PM
well on client death you could have it cycle thru all the players on the server, then have it check if the player is on the same team as the victim & is alive, if it returns no one as being alive then the whole team must be dead..

Wilson [29th ID]
08-06-2006, 12:15 AM
Diamond-optic - see above that is the theory that I had originally. I've discovered that I cannot do it the way dragon-reborn suggested because the dod dev team disabled the "detect_target_allieseliminated" bit a while ago.

How would be the best way to write that, diamond, if you wouldn't mind helping me? I tried but it was very messy and didn't work properly. For now I just need it to detect if the whole team is dead when the client dies and execute a console command (I'll figure out the flag cap thing later)