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
noise upon entering

 
Post new topic   Reply to topic Printable version
 View previous topic  Galactic Empire project Post :: Post Quick Links to Projects  View next topic  
Author Message
tcsoccerman
Server Help Squatter


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

PostPosted: Fri Apr 06, 2007 3:16 pm    Post subject: noise upon entering Reply to topic Reply with quote

could someone make me a module that would send a private "bong" upon entering the zone. I pretty sure a bot can do this, but a as3 module would probably be better. ty.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Dr Brain
Flip-flopping like a wind surfer


Age:38
Gender:Gender:Male
Joined: Dec 01 2002
Posts: 3502
Location: Hyperspace
Offline

PostPosted: Fri Apr 06, 2007 8:42 pm    Post subject: Reply to topic Reply with quote

Look at the messages module. That should be a good place to start for example code.
_________________
Hyperspace Owner

Smong> so long as 99% deaths feel lame it will always be hyperspace to me
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
BDwinsAlt
Agurus's Posse


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

PostPosted: Fri Apr 06, 2007 10:42 pm    Post subject: Reply to topic Reply with quote

In python you could use the playeraction.

Code: Show/Hide

from asss import *

chat = get_interface(I_CHAT)

def paction(p, action, arena):

    if action == PA_ENTERARENA:
        chat.SendSoundMessage(p, SOUND_GIRL, "Welcome to my sexy zone, %s." % (p.name) )

cb1 = reg_callback(CB_PLAYERACTION, paction)


Or something similar. The code is untested but should work. You could replace the SOUND_GIRL with a number if you wanted to.

If you only want a bong and no message just leave the message as "" with no text inside.
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
tcsoccerman
Server Help Squatter


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

PostPosted: Sat Apr 07, 2007 4:31 pm    Post subject: Reply to topic Reply with quote

Don't you need a .dll along with it since it's py..how do you do that without compiling?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Sat Apr 07, 2007 5:24 pm    Post subject: Reply to topic Reply with quote

No, python doesnt compile. You simply write a python module, put it in your bin, and add it in your modules.conf or ?insmod <py> name. And thats it, no compiling nessecary, thats why I love python lol.
Back to top
View users profile Send private message Add User to Ignore List
BDwinsAlt
Agurus's Posse


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

PostPosted: Sat Apr 07, 2007 6:01 pm    Post subject: Reply to topic Reply with quote

Exactly. Thanks Chamby. All you do is create soundenter.py (or name the file something else) in your bin folder.

Somewhere after pymod:pymod in your module.conf add: <py> soundenter

DO NOT ADD TO ARENA.CONF

Only add that if you add mm_attach to the module so it only works in one arena.

You can add this to the code above if you want it to attach to an arena.

Code: Show/Hide

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

def mm_detach(arena):
    arena.cb1 = None


Then remove the old one --> cb1 = reg_callback(CB_PLAYERACTION, paction)

Good luck icon_smile.gif

EDIT:
Tested the first code I made in a post before this one. It worked perfectly. I'll attach both of the modules. Just place them in your bin folder or copy and paste the code yourself.
(Assuming you haven't done so already)

Be sure pymod:pymod is enabled and working.




Arena sound on entry (Attachable)

soundenter2.py - 0.32 KB
File downloaded or viewed 128 time(s)

Zone-wide sound on entry of zone

soundenter.py - 0.24 KB
File downloaded or viewed 117 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
tcsoccerman is postingthi
Guest


Offline

PostPosted: Sun Apr 08, 2007 9:11 am    Post subject: Reply to topic Reply with quote

E <pymod> python error calling callback CB_PLAYERACTION

I got that error in "soundenter", not "soundenter2". I'll paste my edited version i have...

Code: Show/Hide
from asss import *

chat = get_interface(I_CHAT)

def paction(p, action, arena):

    if action == PA_ENTERARENA:
        chat.SendSoundMessage(p, 33, "" % (p.name) )

cb1 = reg_callback(CB_PLAYERACTION, paction)


ty again in advance.. also what would i do in "soundenter2" to make it only in public, arena "0" i believe?. ty .
Back to top
Animate Dreams
Gotta buy them all!
(Consumer whore)


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

PostPosted: Sun Apr 08, 2007 9:30 am    Post subject: Reply to topic Reply with quote

I was going to say you forgot an interface, but playeraction is in core.h, isn't it? Anyway, Python actually does compile. Try checking your /bin after using a python module, you should see another file with the same name, but a .pyc extension. It gets done automatically, though.
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: Sun Apr 08, 2007 9:30 am    Post subject: Reply to topic Reply with quote

Try adding a space inbetween the "" I guess.

To make it appear on the second one simply attach it to the arena.conf.

Where it says stuff like fg_wz \, add soundenter2
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
Solo Ace
Yeah, I'm in touch with reality...we correspond from time to time.


Age:36
Gender:Gender:Male
Joined: Feb 06 2004
Posts: 2583
Location: The Netherlands
Offline

PostPosted: Sun Apr 08, 2007 9:47 am    Post subject: Reply to topic Reply with quote

Code: Show/Hide
chat.SendSoundMessage(p, 33, "" % (p.name) )


Wtf?! There's no format for p.name to be put into.

Code: Show/Hide
chat.SendSoundMessage(p, 33, "")
Back to top
View users profile Send private message Add User to Ignore List
Animate Dreams
Gotta buy them all!
(Consumer whore)


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

PostPosted: Sun Apr 08, 2007 2:46 pm    Post subject: Reply to topic Reply with quote

Lol, I just assumed the error had to do with the callback itself, not the function called by the callback, so I didn't even bother to check. >_<
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Sun Apr 08, 2007 4:07 pm    Post subject: Reply to topic Reply with quote

When python throws an error it's a good idea to check the console since there is more info there that doesn't find its way into the logs (such as exact line number).
_________________
ss news
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
BDwinsAlt
Agurus's Posse


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

PostPosted: Sun Apr 08, 2007 7:22 pm    Post subject: Reply to topic Reply with quote

Solo: He just didn't understand that %s was later defined by p.name.

Use this to help you. http://docs.python.org/lib/typesseq-strings.html

I should have thought about there being no % (p.name). It's my fault. I didn't think ahead.

Sorry.

Good luck.
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
tcsoccerman
Server Help Squatter


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

PostPosted: Mon Apr 09, 2007 8:50 am    Post subject: Reply to topic Reply with quote

Ty solo ace icon_smile.gif. that fixed it. I can kinda see what the problem was, i only code C. ty bdwinsalt for making it too. ty to everyone else who tried.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Hakaku
Server Help Squatter


Joined: Apr 07 2006
Posts: 299
Location: Canada
Offline

PostPosted: Mon Apr 09, 2007 9:28 am    Post subject: Reply to topic Reply with quote

I had tried this earlier myself, but I couldn't figure out why it wouldn't work. I later figured out that I had forgotten to change ?sound=0. tongue.gif

Comparing with BD's version, what's the difference between PA_ENTERARENA and PA_ENTERGAME ?
Back to top
View users profile Send private message Add User to Ignore List Send email
tcsoccerman
Server Help Squatter


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

PostPosted: Mon Apr 09, 2007 11:11 am    Post subject: Reply to topic Reply with quote

i guess game=zone and arena=arena. arena is just more specific? don't ask me
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: Mon Apr 09, 2007 11:47 am    Post subject: Reply to topic Reply with quote

I believe entergame is kind of like enter ship. Basically, any time someone goes from spec > ship, or enters the zone in a ship(after he is connected and starts sending/receiving packets as normal), PA_ENTERGAME will be called.
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: Mon Apr 09, 2007 4:47 pm    Post subject: Reply to topic Reply with quote

I've run into issue with ENTERGAME. I just use ENTERARENA now. I guess it doesn't really matter. What ever floats your boat.
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: Mon Apr 09, 2007 7:59 pm    Post subject: Reply to topic Reply with quote

The enter game action is called when the player has fully entered the arena, ie: downloaded all the lvz files.
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: Mon Apr 09, 2007 8:53 pm    Post subject: Reply to topic Reply with quote

I'm using entergame now, since i have a custom bong. i replaced it with 12, so when i used enterarena, it played that chick, and my brother's(little were in room) not good ....lol, i turned down volume fast enought though.
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: Mon Apr 09, 2007 8:58 pm    Post subject: Reply to topic Reply with quote

tcsoccerman wrote:
I'm using entergame now, since i have a custom bong. i replaced it with 12, so when i used enterarena, it played that chick, and my brother's(little were in room) not good ....lol, i turned down volume fast enought though.


LOL
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: Mon Apr 09, 2007 9:42 pm    Post subject: Reply to topic Reply with quote

LOL. I modified it a bit and decided to use ENTERGAME also. I have an eletric zapping sound though.
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
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: 668 page(s) served in previous 5 minutes.

phpBB Created this page in 0.432821 seconds : 49 queries executed (87.4%): GZIP compression disabled