|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Chambahs Power attack
Joined: Jun 19 2005 Posts: 820 Offline
|
Posted: Fri Jan 06, 2006 12:25 am Post subject: Help please |
|
|
|
|
Ive gone through this module over and over again, and i cant seem to find what is wrong with it. I get no error messages, no nothing. The module just doesnt work. ?start1 does nothing and I really dont know why.
from asss import *
chat = get_interface(I_CHAT)
game = get_interface(I_GAME)
def count_playing(arena):
players = [ 0 ]
def cb_count(p):
if p.arena == arena and p.ship < SHIP_SPEC:
players[0] += 1
for_each_player(cb_count)
return players[0]
def kill(arena, killer, killed, bounty, flags, pts, green):
# promote
if killer.ship != SHIP_WARBIRD:
game.SetShip(killer, killer.ship - 1)
# check for game over
elif killer.ship == SHIP_WARBIRD:
arena.leader_killcb = None
chat.SendArenaMessage(arena, "Game over. %s is the winner!" % killer.p.name)
# demote
if killed.ship != SHIP_SHARK:
game.SetShip(killed, killed.ship + 1)
return pts, green
def c_start_game(cmd, params, p, targ):
"""\
Module: <py> leader
Min. players: 2
Everyone starts as Shark, kill to get ship changed.
First to make a kill in a Warbird wins.
"""
players = count_playing(p.arena)
if players >= 2:
def cb_setship(i):
if i.arena == arena and i.ship < SHIP_SPEC:
game.SetShip(i, SHIP_SHARK)
for_each_player(cb_setship)
chat.SendArenaMessage(p.arena, "The Game Has Started, Begin Killing To Get Promoted. If You Are Killed You Will Get Demoted.")
game.LockArena(p.arena, 0, 0, 0, 0)
else:
chat.SendArenaMessage(p.arena, "Not enough players, %d more needed." % (2 - players))
cmd1 = add_command("startl", c_start_game)
def mm_attach(arena):
arena.leader_killcb = reg_callback(CB_KILL, kill, arena)
def mm_detach(arena):
arena.leader_killcb = None
arena.leader_cmd1 = None
|
|
|
Back to top |
|
|
Muskrat Server Help Squatter
Age:37 Joined: Aug 24 2004 Posts: 829 Location: Swamp Offline
|
Posted: Fri Jan 06, 2006 12:41 am Post subject: |
|
|
|
|
Sure you put the command in the groupdef files? It looks like it should at least be doing something. |
|
Back to top |
|
|
Chambahs Power attack
Joined: Jun 19 2005 Posts: 820 Offline
|
Posted: Fri Jan 06, 2006 12:47 am Post subject: |
|
|
|
|
everything is done in the confs, i attached, i did everything, all that good stuff lol |
|
Back to top |
|
|
Grelminar Creator of Asss
Joined: Feb 26 2003 Posts: 378 Offline
|
|
Back to top |
|
|
Chambahs Power attack
Joined: Jun 19 2005 Posts: 820 Offline
|
Posted: Fri Jan 06, 2006 3:18 pm Post subject: |
|
|
|
|
Thanks grel, although there were some p's places there should be and other tiny things. But on the way of fixing the module i realized there are great bugs. Like when your in game you can spec and the game will keep going. Another is you can ?startgame over and over. I tried to fix a number of these but they failed once again. Here is the new working but still buggy leader module.
#Leader by Chambahs
#12-16-05
#dec 29 2005 smong
#Chambahs jan 06, bugs and ect.
from asss import *
chat = get_interface(I_CHAT)
game = get_interface(I_GAME)
def count_playing(arena):
players = [ 0 ]
def cb_count(p):
if p.arena == arena and p.ship < SHIP_SPEC:
players[0] += 1
for_each_player(cb_count)
return players[0]
def c_start_game(cmd, params, p, targ):
"""\
Module: <py> leader
Min. players: 2
Everyone starts as Shark, kill to get ship changed.
First to make a kill in a Warbird wins.
"""
players = count_playing(p.arena)
if players >= 2:
def cb_setship(i):
if i.arena == p.arena and i.ship < SHIP_SPEC:
game.SetShip(i, SHIP_SHARK)
for_each_player(cb_setship)
chat.SendArenaMessage(p.arena, "The Leader Game Has Started By: " + p.name + ", Begin Killing To Get Promoted. If You Are Killed You Will Get Demoted.")
game.LockArena(p.arena, 0, 0, 0, 0)
else:
chat.SendArenaMessage(p.arena, "Not Enough Players, %d More Needed." % (2 - players))
def kill(arena, killer, killed, bounty, flags, pts, green):
# promote
if killer.ship != SHIP_WARBIRD:
game.SetShip(killer, killer.ship - 1)
# check for game over
players = count_playing(arena)
if players < 2:
arena.leader_killcb = None
chat.SendArenaMessage(arena, "Game over. %s is the winner!" % killer.name)
elif killer.ship == SHIP_WARBIRD:
arena.leader_killcb = None
chat.SendArenaMessage(arena, "Game over. %s is the winner!" % killer.name)
# demote
if killed.ship != SHIP_SHARK:
game.SetShip(killed, killed.ship + 1)
return pts, green
def mm_attach(arena):
arena.leader_killcb = reg_callback(CB_KILL, kill, arena)
arena.leader_cmd1 = add_command("startgame", c_start_game, arena)
arena.leader_cmd2 = add_command("stopgame", do_game_over, arena)
def mm_detach(arena):
arena.leader_killcb = None
arena.leader_cmd1 = None
arena.leader_cmd2 = None
|
Whoever wants to help work on it, be my guest. |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Jan 06, 2006 3:51 pm Post subject: |
|
|
|
|
You want us to locate your bugs for you? _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him. |
|
Back to top |
|
|
D1st0rt Miss Directed Wannabe
Age:36 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Fri Jan 06, 2006 3:58 pm Post subject: |
|
|
|
|
You haven't been on the bot chat very much have you, Cyan? _________________
|
|
Back to top |
|
|
Chambahs Power attack
Joined: Jun 19 2005 Posts: 820 Offline
|
Posted: Fri Jan 06, 2006 4:23 pm Post subject: |
|
|
|
|
LIES, i know what my bugs are, i said specifically:
"Whoever wants to help work on it, be my guest."
i didnt say: "I dont know whats wrong can you please find my bugs for me"
I stated the bugs and said this is whats wrong with the module, if you want it...take it, if you dont, then dont mind this thread. So -READ- before you -POST- thank you very much. |
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Jan 06, 2006 10:53 pm Post subject: |
|
|
|
|
Never, as far as I know, d1s. |
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Mon Jan 09, 2006 4:17 am Post subject: |
|
|
|
|
I don't see a do_game_over function, you should try and write one. |
|
Back to top |
|
|
Chambahs Power attack
Joined: Jun 19 2005 Posts: 820 Offline
|
Posted: Mon Jan 09, 2006 10:08 am Post subject: |
|
|
|
|
i did smong, its just it didnt work and looked crappy so i deleted it |
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 964 page(s) served in previous 5 minutes.
|