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

New API and Syntax


Post New Thread Reply   
 
Thread Tools Display Modes
BAILOPAN
Join Date: Jan 2004
Old 07-13-2014 , 16:46   Re: New API and Syntax
Reply With Quote #11

Quote:
Originally Posted by Arkarr View Post
Why 'char' instend of String ?
The reason is alluded to in the post, but it's worth clarifying. In normal type systems, the concept of a "string" is a data type in and of itself. For example:

PHP Code:
string x "hello!"
In Pawn, it is:
PHP Code:
String:x[] = "hello1"
Here, "String" is really a storage modifier affecting how the array is allocated. It's not actually a string - it's just telling the array that it's an array of characters. It looks like a string, but it's a hack. Long-term we want to provide a true string type. It's important that we begin to eliminate the concept of String: ahead of time, to eliminate any confusion. char may be unfamiliar but it's much more true to what's actually going on.

I myself look forward to a point in time when we have API calls like this:
PHP Code:
native string GetClientName(int client); 
__________________
egg

Last edited by BAILOPAN; 07-13-2014 at 16:58.
BAILOPAN is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 07-13-2014 , 17:03   Re: New API and Syntax
Reply With Quote #12

1. Can you separate a class's code from it's declaration? I see all the code in the methodmap declaration.
2. Is SM 1.7 stable enough to run on a live server?
__________________

Last edited by pheadxdll; 07-13-2014 at 17:03.
pheadxdll is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 07-13-2014 , 17:22   Re: New API and Syntax
Reply With Quote #13

@BAILOPAN
If I have understand correctly, this is wrong :
PHP Code:
public bool PrintMessageToAll(string message)
{
     
PrintToChatAll(message);
     
PrintToConsole(message);
     return 
true;

and this is correct ?
PHP Code:
public bool PrintMessageToAll(const char[] message)
{
     
PrintToChatAll(message); //But PrintToChatAll() only accept 'pawn string' so char should work as well without formating value ?
     
PrintToConsole(message); //same as PPrintToChatAll() ?
     
return true;

__________________

Last edited by Arkarr; 07-13-2014 at 17:23.
Arkarr is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 07-13-2014 , 17:25   Re: New API and Syntax
Reply With Quote #14

Quote:
Originally Posted by pheadxdll View Post
1. Can you separate a class's code from it's declaration? I see all the code in the methodmap declaration.
Not (yet?). See https://bugs.alliedmods.net/show_bug.cgi?id=6182 for something similar.

Quote:
Originally Posted by pheadxdll View Post
2. Is SM 1.7 stable enough to run on a live server?
The majority of the changes thusfar are related to the compiler. The rest of SM should run just fine on a live server, at least in the current state. I assume there will be no such promises once JIT changes come into play.

Also, you should be able to run plugins compiled in 1.7 on a 1.6 server, again: at least for now.
__________________
VoiDeD is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-13-2014 , 22:15   Re: New API and Syntax
Reply With Quote #15

So, basically this is replacing all the SourcePawn 2.0 stuff that was happening before?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
BAILOPAN
Join Date: Jan 2004
Old 07-13-2014 , 23:02   Re: New API and Syntax
Reply With Quote #16

Quote:
Originally Posted by pheadxdll View Post
1. Can you separate a class's code from it's declaration? I see all the code in the methodmap declaration.
2. Is SM 1.7 stable enough to run on a live server?
1. No.
2. Right now 1.7 is basically the same as 1.6 with some compiler changes. So it should be stable. I'm hoping that 1.7 will be mostly an API refactoring release.
__________________
egg
BAILOPAN is offline
BAILOPAN
Join Date: Jan 2004
Old 07-13-2014 , 23:03   Re: New API and Syntax
Reply With Quote #17

Quote:
Originally Posted by Powerlord View Post
So, basically this is replacing all the SourcePawn 2.0 stuff that was happening before?
I don't want to commit to anything but there's a reason the API is called "Transitional".
__________________
egg
BAILOPAN is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 07-14-2014 , 07:43   Re: New API and Syntax
Reply With Quote #18

Look like i have to start all over again and catch up with the rest of the new beginner.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 07-14-2014 , 08:32   Re: New API and Syntax
Reply With Quote #19

Quote:
Originally Posted by BAILOPAN View Post
All of the changes are opt-in, and old scripts will continue to compile.
I highly doubt that old scripts can compile on SM 1.7 atm...
See: https://travis-ci.org/50DKP/FF2-Official
But other then that, taking a look at method maps documentation link, they are REALLY AWESOME! Much neater then current system as it actually makes things easier to understand.

Last edited by WildCard65; 07-14-2014 at 08:33.
WildCard65 is offline
Wliu
Veteran Member
Join Date: Apr 2013
Old 07-14-2014 , 10:40   Re: New API and Syntax
Reply With Quote #20

Quote:
Originally Posted by WildCard65 View Post
I highly doubt that old scripts can compile on SM 1.7 atm...
See: https://travis-ci.org/50DKP/FF2-Official
But other then that, taking a look at method maps documentation link, they are REALLY AWESOME! Much neater then current system as it actually makes things easier to understand.
Do note that the current compiler errors are only with morecolors.inc...which is not included with SM.
It looks to me more like a compiler bug (looking at the line numbers and error #) than "1.6 is incompatible with 1.7".
__________________
~Wliu
Wliu is offline
Reply


Thread Tools
Display Modes

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 15:22.


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