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
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-11-2011 , 15:53   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #81

Was wondering if your php script at: http://www.sourcemodplugins.org/smlibfunctions.php

Could be used to make it easier to read other include files like the one attached?
Attached Files
File Type: inc War3Source_Interface.inc (62.0 KB, 157 views)
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-11-2011 , 16:03   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #82

This was just a quick & dirty thing.
I have written a much more powerful Pawn Parser that I maybe will release together with the dynamic API documention, don't know yet
__________________
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
zeroibis
Veteran Member
Join Date: Jun 2007
Old 02-11-2011 , 19:33   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #83

Ah, cool. Yea I have been trying to find a better way to see the list of natives and descriptions for that mod so that I and others can have an easier time writing programs for it.
__________________
zeroibis is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 02-25-2011 , 00:08   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #84

Handles to convars don't need to be closed, as you're not making a new one when you find a convar.
bl4nk is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-25-2011 , 07:22   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #85

Quote:
Originally Posted by bl4nk View Post
Handles to convars don't need to be closed, as you're not making a new one when you find a convar.
? doesn't Sourcemod create a new Handle for each call to FindConVar ?
__________________
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
psychonic

BAFFLED
Join Date: May 2008
Old 02-25-2011 , 08:17   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #86

Quote:
Originally Posted by berni View Post
? doesn't Sourcemod create a new Handle for each call to FindConVar ?
noOnly if SM did not already have a handle for that convar, but there will still only be one handle at most per convar.

Citation: http://hg.alliedmods.net/sourcemod-c...nager.cpp#l451
psychonic is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-25-2011 , 08:21   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #87

Quote:
Originally Posted by psychonic View Post
noOnly if SM did not already have a handle for that convar, but there will still only be one handle at most per convar.
ok thx then, I will also cache the handle, since calls to FindConVar are very expensive, I have also added caching to the team edict functions already.

If I get everything done I have in my head, I will make a bigger release today, including extensive chat color support.
__________________
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
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 02-25-2011 , 16:33   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #88

Quote:
Originally Posted by berni View Post
ok thx then, I will also cache the handle, since calls to FindConVar are very expensive, I have also added caching to the team edict functions already.
SM already does this (see the link psychonic posted), so there's no reason for you to do it in Pawn, which is slower than C++.
bl4nk is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 02-25-2011 , 16:39   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #89

Quote:
Originally Posted by bl4nk View Post
SM already does this (see the link psychonic posted), so there's no reason for you to do it in Pawn, which is slower than C++.
In my tests this was not the case, I called FindConVar on a srcds convar 100.000 times and the profiling time was significantly higher than when it was cached.
__________________
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; 02-25-2011 at 16:41.
berni is offline
psychonic

BAFFLED
Join Date: May 2008
Old 02-25-2011 , 17:35   Re: SMLIB 0.9.7 BETA (295 Function Stocks) | updated 08.02.2011
Reply With Quote #90

Quote:
Originally Posted by bl4nk View Post
SM already does this (see the link psychonic posted), so there's no reason for you to do it in Pawn, which is slower than C++.
Quote:
Originally Posted by berni View Post
In my tests this was not the case, I called FindConVar on a srcds convar 100.000 times and the profiling time was significantly higher than when it was cached.
Creating the handle to the convar isn't the slow part; finding the var is.

SM calls FindVar to first make sure the convar exists before looking to see if it already has a handle to it. FindVar iterates through all cvars and commands, doing string compares.

This is why it is slow even if SM already has a handle to it, and thus, why you should still cache the handle.
psychonic 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 01:39.


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