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
?centerball (python)

 
Post new topic   Reply to topic Printable version
 View previous topic  Connection Error [Software Firewall Is... Post :: Post Possible asss error in objects.c  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


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

PostPosted: Tue Jul 25, 2006 12:50 pm    Post subject: ?centerball (python) Reply to topic Reply with quote

I've searched high and low. I played with this all day. I now would like to try some help. I have a full Dodgeball module done. Everything works perfectly. When you enter the arena the ball spawns in the correct spot and all. The only issue is, what if you want to play dodgeball again without recreating the arena? I want to be able to put the ball back to its orginal spawnx and spawny coords. How can I do this? This would be sending the ball back to 512 512 when someone types ?centerball in python.

Again everything else is functional and fine. I just need to be able to center the ball on command. Thanks.
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
xsp0rtsfanx
Seasoned Helper


Age:36
Gender:Gender:Male
Joined: Dec 27 2004
Posts: 168
Location: California
Offline

PostPosted: Tue Jul 25, 2006 12:59 pm    Post subject: Reply to topic Reply with quote

I think you'd use MoveBall or something like that.
Back to top
View users profile Send private message Add User to Ignore List MSN Messenger
BDwinsAlt
Agurus's Posse


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

PostPosted: Tue Jul 25, 2006 2:01 pm    Post subject: Reply to topic Reply with quote

http://asss.yi.org/asss/files/userguide.html
That only works with flags (?moveflags)

Can someone help me please.
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
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Tue Jul 25, 2006 4:04 pm    Post subject: Reply to topic Reply with quote

I don't know much about the soccer code in asss, but I found this in balls.h:

Code: Show/Hide

        void (*PlaceBall)(Arena *arena, int bid, struct BallData *newpos);
        /* sets the parameters of the ball to those in the given BallData
         * struct */
        /* pyint: arena, int, balldata -> void */


It looks like that may work by looking at the code in balls.c.

There's also an EndGame function, but no StartGame though I've only taken 5 minutes to look into this.
_________________
Oldbie Server Help
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
BDwinsAlt
Agurus's Posse


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

PostPosted: Tue Jul 25, 2006 4:56 pm    Post subject: Reply to topic Reply with quote

I saw that too :\
I have the arena and ballid set. Just the last bit that is troubling me. newpos...
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
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Tue Jul 25, 2006 6:26 pm    Post subject: Reply to topic Reply with quote

newpos is the variable name for the BallData struct. It looks like you can access that in python though ArenaBallData seems safer.

Code: Show/Hide

struct BallData
{
        /* pytype: struct, struct BallData, balldata */
        int state; /* the state of this ball */
        int x, y, xspeed, yspeed; /* the coordinates of the ball */
        Player *carrier; /* the player that is carrying or last touched the ball */
        int freq; /* freq of carrier */
        ticks_t time; /* the time that the ball was last fired (will be 0 for
                       * balls being held). for BALL_WAITING, this time is the
                       * time when the ball will be re-spawned. */
};
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
BDwinsAlt
Agurus's Posse


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

PostPosted: Tue Jul 25, 2006 7:54 pm    Post subject: Reply to topic Reply with quote

Yea I tried that too. It will let me use ball.PlaceBall but not BallData or anything like that. I've tried this all day so yea. I've looked at all of that. Thanks though.

Edit: Fixed thanks to smong.
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: Wed Jul 26, 2006 7:41 pm    Post subject: Reply to topic Reply with quote

Here's the solution incase anyone else is looking for it.
Code: Show/Hide
from asss import *

balls = get_interface(I_BALLS)

def mm_attach(a):
   bd = balldata()
   bd.state = BALL_ONMAP
   bd.x = bd.y = 512 * 16
   bd.xspeed = bd.yspeed= 0
   bd.carrier = None
   bd.freq = -1
   bd.time = current_ticks()
   balls.PlaceBall(a, 0, bd)

def mm_detach(a):
   pass
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions 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: 181 page(s) served in previous 5 minutes.

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