Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2014-08-06 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
August 06, 2014, 05:25:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://ownageclan.com/jenkins/job/War3Source-Default1/
WIKI page: http://ownageclan.com/wiki/index.php/Main_Page
War3Source GIT repo: https://github.com/War3Source/War3Source
War3Source servers: http://www.game-monitor.com/search.php?vars=a_war3_version=
War3Source Function Reference: http://ownageclan.com/war3source/functionreference/?search=player
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Sourcemod 1.7 and the transitional API  (Read 241 times)
Necavi
Hero Member
*****
Posts: 500


View Profile
« on: July 09, 2014, 06:17:17 PM »

I'm not sure how many of you have found out about it thus far, but Sourcemod 1.7 includes a new way of writing parts of sourcemod plugins, basically the beginnings of an actual object oriented language: https://wiki.alliedmods.net/SourcePawn_Transitional_Syntax

When it gets a bit further along I plan to start a War3Source branch for SM1.7 which will switch as much as possible to use the new API. From what I understand, the changes are almost entirely compiler, not runtime, so it is quite possible that my 1.7 branch will run on 1.6 as long as it is compiled for 1.7.
Logged

Revan
Sr. Member
****
Posts: 437



View Profile
« Reply #1 on: July 10, 2014, 04:50:27 AM »

Yeah I already heard of it, sounds really cool! Especially large projects like War3Source will benefit from it.
Logged

#war3source on gamesurge
-El Diablo
Hero Member
*****
Posts: 509


View Profile
« Reply #2 on: July 10, 2014, 08:38:53 AM »

I wish they would go towards Pascal instead :p

Personally, I hate and love this change.

I hate having to learn new coding practices, love that it will eventually make programming easier in the long run.
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2368


chmod -R 777 *


View Profile WWW
« Reply #3 on: July 10, 2014, 09:19:10 PM »

other than a few signature improvements and weird syntaxes, I don't see anything really improved upon. its still manual memory management, and fake classes

but still not even close to C
Logged

Necavi
Hero Member
*****
Posts: 500


View Profile
« Reply #4 on: July 10, 2014, 11:35:50 PM »

Too true, but still it  looks like it should be able to improve the readability of the code quite a bit.
Logged

-El Diablo
Hero Member
*****
Posts: 509


View Profile
« Reply #5 on: July 11, 2014, 05:37:42 AM »

Too true, but still it  looks like it should be able to improve the readability of the code quite a bit.

I personally don't like that part.   It may make it easier for you to read because your used to that kind of syntax.   For all others.. we'll need lots of coaching!
Logged
Revan
Sr. Member
****
Posts: 437



View Profile
« Reply #6 on: July 12, 2014, 08:27:14 AM »

Everyone that doesn't live in the past would be glad for such thing to happen.
With 1.7 we will be able to do something like this:
Code:
decl String:szName[64];
Race race = War3_GetRace(client);
race.GetName(szName, sizeof(szName));
race.IsSkillUltimate(4);

Pre 1.7:
Code:
decl String:szName[64];
new race = War3_GetRace(client);
War3_GetRaceName(race, szName, sizeof(szName));
War3_IsSkillUltimate(race, 4);

I know this code does not make any sense, nonetheless the SM 1.7 version is much more readable.
« Last Edit: July 12, 2014, 08:29:29 AM by Revan » Logged

#war3source on gamesurge
Necavi
Hero Member
*****
Posts: 500


View Profile
« Reply #7 on: July 12, 2014, 12:42:00 PM »

Actually, it'll be closer to:

Code:
Race race = client.race;
String raceName = race.name;
race.skills[4].isUltimate;
Logged

Necavi
Hero Member
*****
Posts: 500


View Profile
« Reply #8 on: July 14, 2014, 06:07:55 PM »

Bit of a hold on this for now, seems that the classes being talked about will only be for the C++ API to start, added for SP later on.
Logged

-El Diablo
Hero Member
*****
Posts: 509


View Profile
« Reply #9 on: July 15, 2014, 06:44:13 AM »

If I have a bit of a hard understanding of the new format, guess how hard this transition will be for those whom do not program this daily?
Logged
Necavi
Hero Member
*****
Posts: 500


View Profile
« Reply #10 on: July 15, 2014, 09:09:22 AM »

From what I've seen, you have a hard time understanding almost everything; I'm not really worried about others. Especially since it means that a lock of the hacky crap we have going on in the core can be removed.
Logged

-El Diablo
Hero Member
*****
Posts: 509


View Profile
« Reply #11 on: July 15, 2014, 10:41:14 AM »

From what I've seen, you have a hard time understanding almost everything; I'm not really worried about others. Especially since it means that a lock of the hacky crap we have going on in the core can be removed.

All it will do is appear to change the code, but the sourcepawn engine will still be the same.
Logged
Necavi
Hero Member
*****
Posts: 500


View Profile
« Reply #12 on: July 15, 2014, 07:56:59 PM »

I'm talking about War3Source hacks to get around Sourcepawn's static nature, things like the inability to return arrays/strings, lack of native dynamic arrays and lack of struct/class support (Although that one is more appearance than anything else, it keeps things cleaner, which means fewer mistakes)
Logged

-El Diablo
Hero Member
*****
Posts: 509


View Profile
« Reply #13 on: July 16, 2014, 06:44:52 AM »

It would be nice to return arrays/strings
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!