Author |
Message |
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sat Jul 25, 2009 12:15 pm Post subject: <c> flagutil |
|
|
|
|
Couple of modules for doing things with flags: http://bitbucket.org/d1st0rt/flagutil
flagfreeze lets you save and restore the state of the flags in an arena, flagtime is the basis for scoring we use in the Hyperspace flag control event. _________________
|
|
Back to top |
|
|
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: Sat Jul 25, 2009 1:14 pm Post subject: |
|
|
|
|
Nice work. If someone is carrying a flag while you use decide to freeze the state of the flags, will the flag just be dropped if you restore the previous state? If so, is it neutralized or does it become owned?
And I'm not quite sure I understand the flagtime, does it just keep track of how long a flag has been dropped? What exactly do you mean by adding one second per flag to a player/team every second? |
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Sat Jul 25, 2009 4:31 pm Post subject: |
|
|
|
|
If someone is carrying a flag when you stored the state and you then restore it later after they have dropped it, they will find themselves carrying a flag again. There might be some issues if a player is carrying a flag when it's stored and they disconnect before you restore, but I haven't really messed around with it that much.
Ok, the way flag time works is that every second, it checks to see which flags are dropped. If a flag is dropped it gives a +1 to the player that dropped it. So for example if a player has dropped 3 flags, every second they will get +3 added to their "flag seconds". The FlagTeam structure also contains the total of all accumulated flag seconds for that team since it was last cleared. The "breakdown" hashtable keeps track of who on that team is responsible for how much, and keeps incrementing even if they disconnect. |
|
Back to top |
|
|
Hakaku Server Help Squatter
Joined: Apr 07 2006 Posts: 299 Location: Canada Offline
|
Posted: Sat Jul 25, 2009 7:08 pm Post subject: |
|
|
|
|
Thanks for the detailed explanation. What happens if you restore the state of the flag and the player is no longer there, he's on a different side of the map, or he changed teams? |
|
Back to top |
|
|
|