Raised This Month: $ Target: $400
 0% 

New API and Syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
splewis
Veteran Member
Join Date: Feb 2014
Location: United States
Old 08-29-2014 , 21:13   Re: New API and Syntax
Reply With Quote #1

Quote:
Originally Posted by VoiDeD View Post
Ah, I missed that. Thanks!
__________________
splewis is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 08-30-2014 , 03:24   Re: New API and Syntax
Reply With Quote #2

What is garbage collection anyway? I tried to read on google but still can't understand at all....
iGANGNAM is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 08-30-2014 , 07:18   Re: New API and Syntax
Reply With Quote #3

Quote:
Originally Posted by iGANGNAM View Post
What is garbage collection anyway? I tried to read on google but still can't understand at all....
It's where memory is freed of unused blocks
__________________
WildCard65 is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 08-30-2014 , 08:00   Re: New API and Syntax
Reply With Quote #4

Quote:
Originally Posted by WildCard65 View Post
It's where memory is freed of unused blocks
Thank you.
iGANGNAM is offline
BAILOPAN
Join Date: Jan 2004
Old 08-31-2014 , 12:49   Re: New API and Syntax
Reply With Quote #5

iGANGNAM: Garbage collection is what would eliminate calls to CloseHandle() - it would determine when the handle is no longer in use and automatically close it.
__________________
egg
BAILOPAN is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 08-31-2014 , 16:54   Re: New API and Syntax
Reply With Quote #6

Sorry to post again but I really want to know about the difference of using entity reference vs index, why would it hold a frame sometime by using a index? (from what we told me)
Mathias. is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 08-31-2014 , 18:02   Re: New API and Syntax
Reply With Quote #7

Ent indexes aren't normally safe to store across game frames. The game could have possibly killed the entity that was in a given index and replaced it with another the following frame.

Entity references, however, store both the entity index and the serial number of that entity. So if the game changes the entity in your index, the entity reference allows you to compare the serial number to see if that's still the correct entity.

https://wiki.alliedmods.net/Entity_R...28SourceMod%29
__________________
VoiDeD is offline
Mathias.
Veteran Member
Join Date: Aug 2010
Location: Canada is my city
Old 09-01-2014 , 16:15   Re: New API and Syntax
Reply With Quote #8

Thanks allot for the information, I get it now.
Mathias. is offline
thesupremecommander
Member
Join Date: Apr 2012
Old 09-03-2014 , 12:56   Re: New API and Syntax
Reply With Quote #9

So, just to confirm that I'm understanding it correctly... there isn't any built-in support for storing related information via a methodmap or a class, and any such support should be implemented by somehow relating and storing information via either methods in SourcePawn or via a C++ extension. Is that correct?

Also, what are the practical differences between methodmap and class (besides the stricter coercion)? Is/will there be any reason to use class over methodmap?

Last edited by thesupremecommander; 09-03-2014 at 14:03.
thesupremecommander is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 09-03-2014 , 16:58   Re: New API and Syntax
Reply With Quote #10

What I understood about method maps is that, you can't store any vars in them. It's just list of methods for their data type (like increment/decrement method for integer or upper string/lower string for string).

So, if you want to store any vars you must use class.
KissLick 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 22:24.


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