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
Problem with "Adding Commands" module.

 
Post new topic   Reply to topic Printable version
 View previous topic  controllable doors Post :: Post Porting catid's biller to Linux w/ ASSS  View next topic  
Author Message
gilder
Novice


Age:35
Gender:Gender:Male
Joined: Sep 02 2006
Posts: 35
Location: Finland
Offline

PostPosted: Mon Sep 04, 2006 9:08 am    Post subject: Problem with "Adding Commands" module. Reply to topic Reply with quote

I started studying module writing two days ago with Dev-C++ 4.9.9.2 (Windows XP Pro).

I copied "Adding commands" code from:

http://wiki.minegoboom.com/index.php/Writing_Modules_In_C#Adding_Commands

The module doesn't say anything when i type ?getplayers, but ?help getplayers will show the help text properly. Can you help me?
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Mon Sep 04, 2006 9:48 am    Post subject: Reply to topic Reply with quote

You need to add either cmd_getplayers or privcmd_getplayers (or both, depending on what you're donig) to one of the files in conf/groupdef.dir/ so the zone knows who's allowed to use it.
_________________
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
gilder
Novice


Age:35
Gender:Gender:Male
Joined: Sep 02 2006
Posts: 35
Location: Finland
Offline

PostPosted: Mon Sep 04, 2006 9:58 am    Post subject: Reply to topic Reply with quote

Thanks. Didn't read those instructions well...
_________________
Hockey Zone
Back to top
View users profile Send private message Add User to Ignore List
gilder
Novice


Age:35
Gender:Gender:Male
Joined: Sep 02 2006
Posts: 35
Location: Finland
Offline

PostPosted: Tue Sep 05, 2006 5:30 am    Post subject: Reply to topic Reply with quote

I'll post a little new question here, so i don't have to make new topic.

I was trying to warp powerball with PlaceBall function, but the ball just disappeared after a few seconds.

Code: Show/Hide

local Iballs *balls;

...

    ArenaBallData data;
   
    data.balls->state=BALL_ONMAP;
    data.balls->x=512;
    data.balls->y=512;
    data.balls->xspeed=0;
    data.balls->yspeed=0;
    data.balls->carrier=NULL;
    data.balls->freq=1;
    data.balls->time=0;
   
    balls->PlaceBall(p->arena, 1, &(data.balls));


linker also gives an error (PlaceBall line): WARNING: passing arg 3 of pointer to function from incompatible pointer type.
Back to top
View users profile Send private message Add User to Ignore List
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Tue Sep 05, 2006 7:46 am    Post subject: Reply to topic Reply with quote

Sounds like you're not passing the correct struct to it. Check the PlaceBall prototype in balls.h (I'm too lazy).
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
gilder
Novice


Age:35
Gender:Gender:Male
Joined: Sep 02 2006
Posts: 35
Location: Finland
Offline

PostPosted: Tue Sep 05, 2006 8:17 am    Post subject: Reply to topic Reply with quote

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


I can't find anything wrong there.
Back to top
View users profile Send private message Add User to Ignore List
i88gerbils
Oldbie Server Help


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

PostPosted: Tue Sep 05, 2006 10:00 am    Post subject: Reply to topic Reply with quote

Don't you have to pass the pointer directly and not the value?
_________________
Oldbie Server Help
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
gilder
Novice


Age:35
Gender:Gender:Male
Joined: Sep 02 2006
Posts: 35
Location: Finland
Offline

PostPosted: Tue Sep 05, 2006 2:29 pm    Post subject: Reply to topic Reply with quote

Now the server started crashing.

After a few test times i noticed the following:

Code: Show/Hide

    ArenaBallData* data;
   
    data->balls->x=512*16;
    data->balls->y=512*16;
    data->balls->xspeed=0;
    data->balls->yspeed=0;
    data->balls->carrier=NULL;
    data->balls->freq=0;
    data->balls->time=0;
    data->balls->state=BALL_ONMAP;
   
    balls->PlaceBall(p->arena, 1, data->balls);

The ball will be warped, you can see the ball only in big radar (Alt) and server crashes after few seconds.


Code: Show/Hide

    ArenaBallData* data;
   
    data->balls->x=512*16;
    data->balls->y=512*16;
    data->balls->xspeed=0;
    data->balls->yspeed=0;
    data->balls->carrier=NULL;
    data->balls->freq=0;
    data->balls->time=0;
    data->balls->state=BALL_ONMAP;

Server crashes


Code: Show/Hide

    ArenaBallData* data;
   
    data->balls->x=512*16;
    data->balls->y=512*16;
    data->balls->xspeed=0;
    data->balls->yspeed=0;
    data->balls->carrier=NULL;
    data->balls->freq=0;
    data->balls->time=0;


nothing happends


Code: Show/Hide

    ArenaBallData* data;
   
    data->balls->x=512*16;
    data->balls->y=512*16;
    data->balls->xspeed=0;
    data->balls->yspeed=0;
    data->balls->carrier=NULL;
    data->balls->freq=0;
    data->balls->time=0;

    balls->PlaceBall(p->arena, 1, data->balls);

nothing happends


"data->balls->state=BALL_ONMAP;" seems to crash the zone.
Back to top
View users profile Send private message Add User to Ignore List
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Tue Sep 05, 2006 2:32 pm    Post subject: Reply to topic Reply with quote

Number one, you are overriding memory. ArenaBallData's balls is a pointer to struct Balls and not a memory space in itself. So you are clobbering data with that. Try this instead:
Code: Show/Hide
struct BallData data;

data.state=BALL_ONMAP;
data.x=512;
data.y=512;
data.xspeed=0;
data.yspeed=0;
data.carrier=NULL;
data.freq=1;
data.time=0;

balls->PlaceBall(p->arena, 1, &data);

If you really wanted to use ArenaBallData for this:
Code: Show/Hide
ArenaBallData data;

data.balls = (struct Balls*)amalloc(sizeof(struct Balls));
data.balls->state=BALL_ONMAP;
data.balls->x=512;
data.balls->y=512;
data.balls->xspeed=0;
data.balls->yspeed=0;
data.balls->carrier=NULL;
data.balls->freq=1;
data.balls->time=0;

balls->PlaceBall(p->arena, 1, data.balls);
afree(data.balls);
Back to top
View users profile Send private message Add User to Ignore List Send email
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: 659 page(s) served in previous 5 minutes.

phpBB Created this page in 0.446421 seconds : 34 queries executed (91.8%): GZIP compression disabled