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
Misc ASSS Questions
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  per-arena commands? Post :: Post ASSS Zone crashed after 120 days of be...  View next topic  
Author Message
Samapico
No, these DO NOT look like penises, ok?


Age:33
Gender:Gender:Male
Joined: May 08 2003
Posts: 1252
Location: Montreal, Canada
Offline

PostPosted: Wed Apr 21, 2010 1:39 pm    Post subject: Reply to topic Reply with quote

Cheese wrote:
what is the possible range for *objon?
i would guess its a power of 2, and i know its over 256...

and what is the point of failure?
does the lvz builder break first or the objon cmd?

PS:
also, it looks like theres a 256 object max?


edit:

found it.

[..]



so its (2^16)/2
thats like a signed short int, right?


The objectID is an unsigned 15 bit integer.
The way it's packed in the lvz file, the first bit indicates a mapobject or screenobject, and the following 15 bits are the objectID. Then you have other data such as x/y coordinates, layer, etc.

http://wiki.minegoboom.com/index.php/LVZ_Format


Note that Continuum has a limit of 255 (or maybe 256?) DIFFERENT images (see Image Number)
_________________
DCME co-developer
17th Parallel Head Sysop
Subspace: The Future
Back to top
View users profile Send private message Add User to Ignore List
JoWie
Server Help Squatter


Gender:Gender:Male
Joined: Feb 25 2004
Posts: 215
Offline

PostPosted: Wed Apr 21, 2010 5:17 pm    Post subject: Reply to topic Reply with quote

I thought it was 255 max images per lvz file and 256 max total
Back to top
View users profile Send private message Add User to Ignore List
Samapico
No, these DO NOT look like penises, ok?


Age:33
Gender:Gender:Male
Joined: May 08 2003
Posts: 1252
Location: Montreal, Canada
Offline

PostPosted: Wed Apr 21, 2010 5:23 pm    Post subject: Reply to topic Reply with quote

JoWie wrote:
I thought it was 255 max images per lvz file and 256 max total
Could be so... though I don't see why a single lvz could not have 256 images, unless the Continuum's implementation is kind of screwed up.
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Fri Apr 23, 2010 10:09 pm    Post subject: Reply to topic Reply with quote

how do i set up a callback?
ive tried:

in x.c
Code: Show/Hide

DO_CBS(CB_X,a,xFunc,(a,p,freq));



in x.h
Code: Show/Hide

#define CB_X "x"
typedef void (*xFunc)(Arena *a, Player *p, int freq);




but i have yet to get a single callback to work without crashing the zone.
what am i missing?


edit:
also, why on earth is DO_CBS defined as a

do
{
} while(0)

macro?
isnt that completely pointless?
_________________
SSC Distension Owner
SSCU Trench Wars Developer
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Arnk Kilo Dylie
Seasoned Helper


Age:32
Gender:Gender:Male
Joined: Jul 14 2006
Posts: 108
Offline

PostPosted: Sat Apr 24, 2010 12:08 am    Post subject: Reply to topic Reply with quote

No, adding a new {} block allows you to define new variable names under non-C99 compilers.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Sat Apr 24, 2010 1:01 am    Post subject: Reply to topic Reply with quote

but u can just use a normal { } to do that, why the do while
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Arnk Kilo Dylie
Seasoned Helper


Age:32
Gender:Gender:Male
Joined: Jul 14 2006
Posts: 108
Offline

PostPosted: Sat Apr 24, 2010 2:47 am    Post subject: Reply to topic Reply with quote

Might be for added compatibility. I don't know any compiler that requires it as such.

If you're getting a crash a backtrace might be in order if DO_CBS is failing. Which is to say, you're probably doing something else wrong, but knowing where the crash is happening will give some vital information.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Sat Apr 24, 2010 1:53 pm    Post subject: Reply to topic Reply with quote

how do i do a backtrace if im not on linux?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Sat Apr 24, 2010 5:04 pm    Post subject: Reply to topic Reply with quote

Same way as on linux: use a debugger.
_________________
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
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Sat Apr 24, 2010 5:47 pm    Post subject: Reply to topic Reply with quote

found out using the MyBrain debugger:

logic: zone crashes largely due to null pointer usage, where in do_cbs does it use a pointer?

i now know why dr brain has the curious habit of putting
mm=mm2;
at the beginning of every load.

just like any other interface, if you call it without loading it, it crashes the zone.
you still cant use a null pointer...
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
JoWie
Server Help Squatter


Gender:Gender:Male
Joined: Feb 25 2004
Posts: 215
Offline

PostPosted: Sun Apr 25, 2010 5:45 am    Post subject: Reply to topic Reply with quote

the do { ... } while(0) is a common method to support using macro's in one liners, for example:

Code: Show/Hide

#define hmm(A,B) do { A *= 4; B += 6 } while(0)

int a = 5, b = 7;

if (1)
   hmm(a, b);

Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Tue Apr 27, 2010 5:58 pm    Post subject: Reply to topic Reply with quote

so im terrible with pointers and memory stuff, and im trying to do:

Code: Show/Hide

Player *pstats[10];
//lock
FOR_EACH_PLAYER_IN_ARENA(p,a)
{
    //stuff

      pstats[0]=p;
}
//unlock
     //more stuff

    pstats[0]->name



but its crashing, im making 10 calls, some work properly, some output odd chars, and some crash the zone with a deadlock.

which is extremely confusing :S
what am i doing wrong?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Hakaku
Server Help Squatter


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

PostPosted: Tue Apr 27, 2010 6:38 pm    Post subject: Reply to topic Reply with quote

What exactly are you trying to achieve? And why don't you just use player data?
Back to top
View users profile Send private message Add User to Ignore List Send email
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Tue Apr 27, 2010 6:54 pm    Post subject: Reply to topic Reply with quote

because im saving a player pointer?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Samapico
No, these DO NOT look like penises, ok?


Age:33
Gender:Gender:Male
Joined: May 08 2003
Posts: 1252
Location: Montreal, Canada
Offline

PostPosted: Tue Apr 27, 2010 7:20 pm    Post subject: Reply to topic Reply with quote

I'm taking a wild guess here, and I haven't worked with ASSS at all... But chances are the pointers you use are not safe to use because the data might be moved around, or even deleted when the player list changes.

The safest way would be to store some unique info (name or some ID) instead of a pointer, and find that info in the list everytime you want to take an action on a player.
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Tue Apr 27, 2010 7:38 pm    Post subject: Reply to topic Reply with quote

which is why theres the lock and unlock, to stop that from happening

ive also tried copying the entire player struct:

Code: Show/Hide

Player pstats[10];
//lock
FOR_EACH_PLAYER_IN_ARENA(p,a)
{
    //stuff

      pstats[0]=*p;
}
//unlock
     //more stuff

    pstats[0].name

Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Tue Apr 27, 2010 10:10 pm    Post subject: Reply to topic Reply with quote

Which line does the debugger say it's crashing on?
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Thu Apr 29, 2010 2:24 am    Post subject: Reply to topic Reply with quote

i have set an arena [team] to only allow freqs 0-1, and set it to a 1 person limit (so players cant =1) with the new team settings.

however, for some reason it places a person on freq 0, then 1, then the rest of anyone who joins on freq 0, eventually making it 1000v1.

how can i get it to be 500v500 instead, while still not allowing =1?
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Mon May 03, 2010 10:56 pm    Post subject: Reply to topic Reply with quote

why does


int totalrp[2];
lm->Log(L_DRIVEL,"0a 0=%i 1=%i",totalrp[0],totalrp[1]);

output

D 0a 0=2293240 1=4207083



what the hell is going on?
its only 2 lines of code, nothing else
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Samapico
No, these DO NOT look like penises, ok?


Age:33
Gender:Gender:Male
Joined: May 08 2003
Posts: 1252
Location: Montreal, Canada
Offline

PostPosted: Mon May 03, 2010 11:55 pm    Post subject: Reply to topic Reply with quote

Cheese wrote:
why does


int totalrp[2];
lm->Log(L_DRIVEL,"0a 0=%i 1=%i",totalrp[0],totalrp[1]);

output

D 0a 0=2293240 1=4207083



what the hell is going on?
its only 2 lines of code, nothing else
Well... because your ints are not initialized?
Back to top
View users profile Send private message Add User to Ignore List
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Tue May 04, 2010 11:07 am    Post subject: Reply to topic Reply with quote

ints are always auto initialized to 0
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Arnk Kilo Dylie
Seasoned Helper


Age:32
Gender:Gender:Male
Joined: Jul 14 2006
Posts: 108
Offline

PostPosted: Tue May 04, 2010 1:40 pm    Post subject: Reply to topic Reply with quote

...

.....


no lol
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Tue May 04, 2010 1:44 pm    Post subject: Reply to topic Reply with quote

Variables are not initialized except in certain specific situations (situations such as using a completely different programming language, lol). Memory too, is not guaranteed to be zeroed when allocated (which is why amalloc zeros it out before returning it).
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Cheese
Wow Cheese is so helpful!


Joined: Mar 18 2007
Posts: 1016
Offline

PostPosted: Tue May 04, 2010 1:49 pm    Post subject: Reply to topic Reply with quote

WTFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

since when omfg


spent like an hour trying to figure out why 1+2+3=1239854

:C
Back to top
View users profile Send private message Add User to Ignore List Visit posters website AIM Address
Dr Brain
Flip-flopping like a wind surfer


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

PostPosted: Tue May 04, 2010 2:25 pm    Post subject: Reply to topic Reply with quote

Since before you were born.
Back to top
View users profile Send private message Add User to Ignore List AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10  Next
Page 4 of 10

 
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: 246 page(s) served in previous 5 minutes.

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