Raised This Month: $51 Target: $400
 12% 

SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011


Post New Thread Reply   
 
Thread Tools Display Modes
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-31-2011 , 12:29   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #41

Quote:
Originally Posted by berni View Post
Did you actually test it or do you just think so ?

I just tried it out for you:

Compile time with includes: 1.00 seconds
Compile time without: 1.00 seconds
Did you try modifying and including only 1 of the includes, such as #include <smlib/world> or are you continually including EVERYTHING by using #include <smlib>?

Did you try this using a large system where multiple source files need 1 or 2 functions from 1 or 2 files instead of everything? I do not have time to test this at the moment, especially since this is Month End, but I will get back to you when I do.

Quote:
Originally Posted by berni View Post
Also wrong, Functions of <sourcemod> and <sdktools> (fake included in smlib.inc) are used in almost every include file.
Again, they aren't really included for the compiler as it will cancel before in smlib.inc.
So, #include the files required for those functions (<sourcemod> & <sdktools> and whichever <smlib/*> files that might be required, as you almost did in smlibs/clients.inc (instead of the generic <smlib> include), it's not that difficult.

Quote:
Originally Posted by berni View Post
SourcePawn just isn't C++, so we have to take what we get.
While it's true that SourcePawn isn't C++, the basic concepts are the same and are still applicable.
naris is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 01-31-2011 , 12:41   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #42

The preprocessor include system is almost the same in both languages.
__________________
FaTony is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2011 , 12:52   Re: SMLIB 0.9.2 BETA (269 Function Stocks) | updated 28.01.2011
Reply With Quote #43

Quote:
Originally Posted by naris View Post
Did you try modifying and including only 1 of the includes, such as #include <smlib/world> or are you continually including EVERYTHING by using #include <smlib>?
You should have read the latest update changes, this doesn't need to be discussed anymore.

Quote:
Originally Posted by berni View Post
Redesigned the smlib includes to allow including of single smlib includes and save some milli seconds.
And no, I thought he is talking about just removing #smlib out of every include file, and still use #include <smlib> in the plugin.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-31-2011 , 12:59   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #44

Doh!

Sorry about that, Indeed I should of read the last update changes
naris is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2011 , 13:12   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #45

By the way, the sourcemod compiler automatically includes <sourcemod> (with all its 60 subincludes), even if you don't have it specified in your plugin.
If you want to complain, I would start there
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-31-2011 , 16:42   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #46

This function needs to be fixed:

PHP Code:
/**
 * Returns whether the entity has specific Spawnflags.
 *
 * @param entity            Entity index.
 * @param flags                Flags value.
 * @return                    True if the entity has the spawnflags set, false otherwise.
 */
stock bool:Entity_HasSpawnFlags(entityflags)
{    
    return 
Entity_GetSpawnFlags flags;

naris is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-31-2011 , 16:48   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #47

Quote:
Originally Posted by berni View Post
By the way, the sourcemod compiler automatically includes <sourcemod> (with all its 60 subincludes), even if you don't have it specified in your plugin.
If you want to complain, I would start there
Yeah, that's true -- but those are mostly native declarations and not so many stocks.

Also, you usually need to use parts of most of the sourcemod includes in any given plugin while many of the smlib includes are more stand-alone without really needing the others.
naris is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 01-31-2011 , 16:58   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #48

The Entity_Flags look suspect, are EFL_KEEP_ON_RECREATE_ENTITIES and EFL_HAS_PLAYER_CHILD both supposed to be bit 4?

PHP Code:
enum Entity_Flags
{
    
EFL_KILLME =                            (1<<0),    // This entity is marked for death -- This allows the game to actually delete ents at a safe time
    
EFL_DORMANT    =                            (1<<1),    // Entity is dormant, no updates to client
    
EFL_NOCLIP_ACTIVE =                        (1<<2),    // Lets us know when the noclip command is active.
    
EFL_SETTING_UP_BONES =                    (1<<3),    // Set while a model is setting up its bones.
    
EFL_KEEP_ON_RECREATE_ENTITIES =         (1<<4), // This is a special entity that should not be deleted when we restart entities only

    
EFL_HAS_PLAYER_CHILD=                    (1<<4),    // One of the child entities is a player.

    
EFL_DIRTY_SHADOWUPDATE =                (1<<5),    // Client only- need shadow manager to update the shadow... 

Also, you might want to define it as

PHP Code:
enum Entity_Flags (<<= 1)
{

instead of specifying the value for each bit.
naris is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2011 , 20:34   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #49

Quote:
Originally Posted by naris View Post
This function needs to be fixed:

PHP Code:
stock bool:Entity_HasSpawnFlags(entityflags


Quote:
Originally Posted by naris View Post
Also, you usually need to use parts of most of the sourcemod includes in any given plugin while many of the smlib includes are more stand-alone without really needing the others.
Like you say, only parts, I use ~20% of all sm includes in plugins.

Quote:
Originally Posted by naris View Post
The Entity_Flags look suspect, are EFL_KEEP_ON_RECREATE_ENTITIES and EFL_HAS_PLAYER_CHILD both supposed to be bit 4?

Also, you might want to define it as

PHP Code:
enum Entity_Flags (<<= 1)
{

instead of specifying the value for each bit.
It looks suspect to me too, I also wondered back then, but we copied it straight from Valve's hl2sdk and it's used there widely,
so I'm quite sure it's correct
I think it's ok like it is now.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 01-31-2011 at 20:40.
berni is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-01-2011 , 23:56   Re: SMLIB 0.9.4 BETA (278 Function Stocks) | updated 31.01.2011
Reply With Quote #50

I just wanted to note that using:
stock Client_GiveWeapon(client, const String:className[], bool:switchTo=true);

will override any restrictions that other mods may have on the weapon.

For example you can use this command to give a zombie weapons in a ZR server. I do not know if this was intended or not. Note however that the normal GivePlayerItem command does not allow zombies to get weapons.
__________________
zeroibis is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode