Author |
Message |
typobox43 Newbie
Joined: Sep 23 2004 Posts: 3 Offline
|
Posted: Thu Sep 23, 2004 2:35 pm Post subject: Base-style scoring? |
 |
|
|
|
I'm trying to set up my ASSS server to score similarly to the Trench Wars zone (periodic reward for every player on the flag-holding team, and a score bonus for kills while your team holds the flag.) I've looked through the User Guide and searched the posts on this forum, tried a few suggestions, and it doesn't seem to work. Can anyone give me any pointers as to what configuration options I would need to do such a thing? |
|
Back to top |
|
 |
Guest
Offline
|
Posted: Thu Sep 23, 2004 4:18 pm Post subject: |
 |
|
|
|
so you want a turf flagging game.... use turf? |
|
Back to top |
|
 |
Guest
Offline
|
Posted: Thu Sep 23, 2004 4:40 pm Post subject: |
 |
|
|
|
Yeah, but the documentation's a bit thin (or non-existent) for the turf options, and what I've seen around the forums doesn't seem to work much. Either that, or I have no clue what I'm doing. Always a possibility.  |
|
Back to top |
|
 |
typobox43 Newbie
Joined: Sep 23 2004 Posts: 3 Offline
|
Posted: Thu Sep 23, 2004 4:41 pm Post subject: |
 |
|
|
|
Gah, that was me. I forgot to log in. :/ |
|
Back to top |
|
 |
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Fri Sep 24, 2004 2:57 am Post subject: |
 |
|
|
|
Let's try the periodic part first: this should be possible with the standard modules. periodic and points_periodic should be loaded. You'll need to set Periodic:RewardDelay to something nonzero, and Periodic:RewardPoints to the number of points per flag to award. You'll also need to add points_periodic to the Modules:AttachModules line for the relevent arena(s).
I don't believe there's currently a way to award points per kill for team-owned flags. It's pretty easy to add, and I'll try to get to it soon. It's certainly possible if you write your own kill points module, which you might want to do anyway to further customize your scoring. |
|
Back to top |
|
 |
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Fri Sep 24, 2004 3:24 am Post subject: |
 |
|
|
|
Btw, here's how you'd write such a module in python. Note that this won't work in 1.3.2 due to a bug/missing feature that I just fixed, but it should work in the future:
from asss import *
cfg = get_interface(I_CONFIG)
flags = get_interface(I_FLAGS)
def mykill(arena, killer, killed, bty, flags, pts, green):
teamflags = flags.GetFreqFlags(arena, killer.freq)
ppf = cfg.GetInt(arena.cfg, "Kill", "PointsPerTeamFlag", 0)
pts += teamflags * ppf
return pts, green
cb1 = reg_callback(CB_KILL, mykill)
|
|
|
Back to top |
|
 |
typobox43 Newbie
Joined: Sep 23 2004 Posts: 3 Offline
|
Posted: Fri Sep 24, 2004 3:30 am Post subject: |
 |
|
|
|
What bug is this, exactly? Is the issue in the Python interface, or would I not even be able to write a C module to perform this task?
[edit] By the way, I'll try out your config suggestions tomorrow... err... later today. My test group is all sleeping. Slackers. [/edit] |
|
Back to top |
|
 |
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Fri Sep 24, 2004 3:56 am Post subject: |
 |
|
|
|
Sorry, I should have been more specific: it's in the python interface only. CB_KILL callbacks in C are fine. Details: I had prevented CB_KILL from appearing in python because I thought my stub generator didn't support in/out parameters for callbacks. But on closer inspection, it does, and I was being too cautious by excluding CB_KILL. |
|
Back to top |
|
 |
-Smong- Guest
Offline
|
Posted: Sat Sep 25, 2004 8:37 am Post subject: |
 |
|
|
|
To keep it subgame compatible the actual setting is Kill:KillPointsPerFlag, which also compares the killers bounty with Kill:KillPointsMinimumBounty before adding the flag bonus.
Also don't you need to increment the kill points stat? Otherwise when you re-enter the arena you will have less points. |
|
Back to top |
|
 |
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
Posted: Sat Sep 25, 2004 4:42 pm Post subject: |
 |
|
|
|
Ok, I made two changes. I'd like to know if these are acceptable.
First, there are now four settings, FlagMinimumBounty, PointsPerKilledFlag, PointsPerCarriedFlag, and PointsPerTeamFlag, all in the Kill section. FlagMinimumBounty is the minimum bounty you must have for the next three to take effect. PointsPerKilledFlag is the number of points the killer gets for each flag the killed player was carrying. PointsPerCarriedFlag is the number of points the killer gets for each flag he is carrying (including any that just transferred). PointsPerTeamFlag is the number of points the killer gets for each flag his team owns (also including any that just transferred). The setting names are different from subgame because I thought subgame's setting names were too long (why include "Kill" in the setting name when it's in the section name already?) and were misleading (KillPointsMinimumBounty sounds like it applies to all kill points, but it only applies to flag bonuses). If someone really objects, I can change them to match subgame. Note that AFAIK, subgame has no equivalent of PointsPerKilledFlag and PointsPerCarriedFlag.
Second, and this addresses Smong's question, I changed the way the kill callback works. It's no longer the responsability of each callback to call IncrementStat. They should just increment the value at *points, and the game module will handle the stats side of things. This keeps the value computed by the client and the value in the db in sync by making it impossible to change one without changing the other, and makes it slightly easier to write kill callbacks that add points.
So with this change, and the last one, my little snippet should finally work. |
|
Back to top |
|
 |
-Smong- Guest
Offline
|
Posted: Tue Sep 28, 2004 4:45 pm Post subject: |
 |
|
|
|
All sounds good to me. |
|
Back to top |
|
 |
|