Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
>goal< spree module

 
Post new topic   Reply to topic Printable version
 View previous topic  SkyBill - TCP BILLER alpha. Post :: Post <c> zombie  View next topic  
Author Message
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Sat May 05, 2007 9:42 pm    Post subject: >goal< spree module Reply to topic Reply with quote

Would anyone be willing to introduce me to a goal spree module. It'd be just like a spree module, there fore doing this:
1.recgoinzing a goal, and who scored it.
2.addinga goal to spree "tracker" data
3.arena messages anouncing spree achievements(for example 10 goals);
4.include bongs in arena messages


some great others would be
1.assists(player that touched the ball b4 player that scored scores)

ty very much.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Animate Dreams
Gotta buy them all!
(Consumer whore)


Age:36
Gender:Gender:Male
Joined: May 01 2004
Posts: 821
Location: Middle Tennessee
Offline

PostPosted: Sat May 05, 2007 11:33 pm    Post subject: Reply to topic Reply with quote

I modified my points_kill module to work based off of spreeing, it's fairly easy. First, you'll need playerdata, which should go something like this:

Code: Show/Hide
/* player data */

typedef struct SpreeData
{
    int kills;
} SpreeData;
local int playerKey;


Then I just added this code to the beginning of the function:

Code: Show/Hide
    SpreeData *killerSpree = PPDATA(killer, playerKey);
    SpreeData *killedSpree = PPDATA(killed, playerKey);
   
    killerSpree->kills++;
    killedSpree->kills = 0;


And then at the end, points are updated with the line *totalpts += pts; , so right before that line I decided I'd reward points based on a multiplier equal to their number of kills: pts = pts * killerSpree->kills; , so I put that line of code right before the *totalpts += pts; . Er, um... you should also, in the MM_ATTACH section, allocate your data( playerKey = pd->AllocatePlayerData(sizeof(SpreeData)); ), and then free that data(just like in the C tutorial for modules, but I just realized I never did that, yet my module works... wtf.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sat May 05, 2007 11:38 pm    Post subject: Reply to topic Reply with quote

EDIT: ACK nvm you replied b4 me.

Untest but you can try this. (ATTACHED and TYPED)
Code: Show/Hide

from asss import *

chat = get_interface(I_CHAT)

def mm_attach(arena):
    arena.cb1 = reg_callback(CB_GOAL, goalspree, arena)
    arena.cb2 = reg_callback(CB_PLAYERACTION, paction, arena)

def mm_detach(arena):
    arena.cb1 = None
    arena.cb2 = None

def goalspree(arena, p, bid, x, y):
    p.goalspree_spree += 1
    if p.goalspree_spree == 10:
        chat.SendArenaSoundMessage(arena, SOUND_GOAL, "%s Blah Blah Blah! (10:0)" % (p.name) )
    elif p.goalspree_spree == 15:
        chat.SendArenaSoundMessage(arena, SOUND_GIRL, "%s No me gusta a Bill Gates! (15:0)" % (p.name) )

def paction(p, action, arena):
    if action == PA_ENTERGAME:
        p.goalspree_spree = 0
    elif action == PA_LEAVEARENA:
        p.goalspree_spree = None




goalspree.py - 0.73 KB
File downloaded or viewed 39 time(s)
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Thu May 17, 2007 2:35 pm    Post subject: Reply to topic Reply with quote

Just wondering when does the spree get reset? When the player dies?
_________________
ss news
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
tcsoccerman
Server Help Squatter


Age:31
Gender:Gender:Male
Joined: Jan 15 2007
Posts: 694
Location: Atlantis
Offline

PostPosted: Thu May 17, 2007 3:17 pm    Post subject: Reply to topic Reply with quote

although i don't need it anymore, i would reset every game? if not that then login/out for sure
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 693 page(s) served in previous 5 minutes.

phpBB Created this page in 0.464890 seconds : 32 queries executed (81.2%): GZIP compression disabled