AMX Size
#1

Hey,
I seem to have a problem with the new compiler (which is apparently the same); my gamemode compiles to 3.5MB, whereas with the 0.2X compiler, it compiles to 500kb.
This (obviously) increases the time it takes to compile, and increases the time it takes for me to upload to my server, which is very annoying.
The exact same file, and the exact same includes are being used with both compilers (except, of course, the SA:MP includes), so I'm confused as to why this is happening. I thought perhaps it was the new SA:MP includes, however other scripts are not affected, and they seem to compile to roughly the same size.
Does anybody know why this is happening?


(Non-0.3-specific-problem-in-uber-small-writing-because-this-is-the-0.3-board)
Also, if anybody knows, could you please tell me why pickups created as type 23 with CreatePickup ("Pickupable, but doesn't disappear on pickup") are pickupable, and don't respawn. I am attempting to make a property system similar to the Grand Larceny system, in Grand Larceny it's pickup type 23 and you can't pick it up (which is what I want), however in my script, it's type 23 and I can pick it up, which isn't what I want.
Could anybody help me here?
Reply
#2

It mainly has to do with the includes' new definitions.

In 0.2x, MAX_PLAYERS was defined as 200, as found in a_samp.inc
In 0.3a and up, MAX_PLAYERS has been chaged to 500.

So now all of those definitions you have, i.e. 'PlayerInfo[MAX_PLAYERS];' have been increased by 2 and a half times.

These increases will cause your .amx file to be considerably larger.
Reply
#3

I suggest to make aworkaround - create your own define - e.g. MAX_PLAYERS_EX which will replace it for your maximum players number (in my case its 50) and then use Replace function and replace every MAX_PLAYERS with MAX_PLAYERS_EX .
Reply
#4

Rainmaker, that's what he has been doing ><, he #define MAXP 30 ><
Reply
#5

There are more defines than just MAX_PLAYERS, MAX_VEHICLES has been increased to 2000.

And you could just do:
pawn Code:
#undef MAX_PLAYERS
#define MAX_PLAYERS 32
Reply
#6

Quote:
Originally Posted by Joe Staff
It mainly has to do with the includes' new definitions.

In 0.2x, MAX_PLAYERS was defined as 200, as found in a_samp.inc
In 0.3a and up, MAX_PLAYERS has been chaged to 500.

So now all of those definitions you have, i.e. 'PlayerInfo[MAX_PLAYERS];' have been increased by 2 and a half times.

These increases will cause your .amx file to be considerably larger.
I suspected that, however I don't use those defines from the SA:MP includes.
I use custom defines to suit my server, so that shouldn't be the problem.

EDIT:
Yes, InstabiC is right, I use "MAXP" when I need the maximum players (not the MAX_PLAYERS from a_samp.inc), and I don't use any others.

EDIT again:
Quote:
Originally Posted by Joe Staff
There are more defines than just MAX_PLAYERS, MAX_VEHICLES has been increased to 2000.

And you could just do:
pawn Code:
#undef MAX_PLAYERS
#define MAX_PLAYERS 32
Like I said, I don't use any other defines from the SA:MP includes.
Reply
#7

Perhaps your includes do.
Reply
#8

Quote:
Originally Posted by Joe Staff
Perhaps your includes do.
Nope, checked all of them.

As a test, I set all of the MAX_PLAYERS, MAX_VEHICLES etc. in a_samp.inc to 1.
Recompiled my script, and there was no difference, because my script doesn't use those defines.
Reply
#9

Really weird because my amx didnt change at all (just few kb because of some changes - expansion)
Reply
#10

Quote:
Originally Posted by Rainmaker
Really weird because my amx didnt change at all (just few kb because of some changes - expansion)
Well like I said, this doesn't happen in other scripts I have compiled.

Maybe my gamemode just doesn't like me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)