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
Powerballs

 
Post new topic   Reply to topic Printable version
 View previous topic  freqowners with feedback Post :: Post d/c when  View next topic  
Author Message
Chambahs
Guest


Offline

PostPosted: Mon Jan 17, 2005 1:36 am    Post subject: Powerballs Reply to topic Reply with quote

currently in the ASSS setts, you can set the powerball location, but you can only set it to 1 spawn, what happens if i want to set 1 ball at a spawn, and another ball at a different spawn?

<-currently writing a module for powerballs because i cant figure it out icon_sad.gif
Back to top
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Mon Jan 17, 2005 5:06 am    Post subject: Reply to topic Reply with quote

Here is some stuff from src/balls.h that should help you figure it out on your own:
Code: Show/Hide
/* called when a player scores a goal */
#define CB_GOAL "goal"
typedef void (*GoalFunc)(Arena *arena, Player *p, int bid, int x, int y);
/* pycb: arena, player, int, int, int */

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. */
};

   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 */

You'll probably want to place the balls when the arena gets created and after a goal. You can use CB_ARENAACTION and CB_GOAL for this.

You may have to use a timer to move the ball, when I made golf I found that the server crashes if you move balls around too soon after an event.

If ball was a variable, you would be interested in changing ball.x and ball.y. I believe the coordinates are in pixels. bid or ball id starts at 0 and goes up to 7.

Getting the current ticks could be a problem, an oversight in pymod? Also I don't know too much py, but I reckon you could initialise the ball data with a tuple.
Quote:
ball.state = BALL_ONMAP
ball.x = 512 * 16
ball.y = 512 * 16
ball.carrier = None
ball.freq = -1
ball.time = ???

# same as(?)
ball = ( BALL_ONMAP, 512 * 16, 512 * 16, None, -1, 0 )

balls.PlaceBall(arena, bid, ball)
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Chambahs
Guest


Offline

PostPosted: Mon Jan 17, 2005 11:34 am    Post subject: Reply to topic Reply with quote

well, grel said it probably wont be possible, so meh...lol close this if you would like
Back to top
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Mon Jan 17, 2005 3:02 pm    Post subject: Reply to topic Reply with quote

It's not possible with the standard modules and probably wont be.

I've never let that stop me with my development of zones, and nor should it stop anyone else.
_________________
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
stag shot
Newbie


Joined: Jan 18 2005
Posts: 10
Offline

PostPosted: Tue Jan 18, 2005 2:00 am    Post subject: Reply to topic Reply with quote

Well, it's been a looooong time since I dug through the balls module...But a quick look indicated you'd have to intercept at

void SpawnBall(Arena *arena, int bid)

Perhaps add custom code to check arena name or something...And of course the settings would be hardcoded, unless you wanna add new settings! It's dirty, but doable.

stag
Back to top
View users profile Send private message Add User to Ignore List
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Tue Jan 18, 2005 3:45 am    Post subject: Reply to topic Reply with quote

There's a much easier way than the ugly stuff all you people are suggesting: just make the spawnx, y, and radius values in the arena data in the balls module arrays, 4 elements long. then add code to read extra settings Soccer:Spawn{X,Y,Radius}{1,2,3}. Then do the same thing that cont does with the freq spawn settings: if only one is set, use it for all balls. If two are set, use 0 for the even balls and 1 for the odds. If four are set, do it mod 4.

This probably won't be enough to create your game, but it's a start, and it might be useful for others anyway.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
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: 931 page(s) served in previous 5 minutes.

phpBB Created this page in 0.776271 seconds : 28 queries executed (96.8%): GZIP compression disabled