AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   TOGs SourcePawn Syntax Converter [MS Excel Based for now] (https://forums.alliedmods.net/showthread.php?t=290805)

nergal 05-14-2017 03:06

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by ThatOneGuy (Post 2520379)
Firstly because I didnt know VBA -> Python translators exist (though I just looked and there is one). Secondly, because I have only learned basic python and have issues getting the proper tools set up to even utilize python. Also, then I assume you couldnt make a web based program for converting? Good idea though...would you be willing to take that on? I found this one here: http://vb2py.sourceforge.net/

I meant a python transcompiler that converts old sp to new syntax.

ThatOneGuy 05-14-2017 06:09

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by nergal (Post 2520403)
I meant a python transcompiler that converts old sp to new syntax.

Well, if such a thing is out there, it would be nice to be made available to others. If you're proposing I develop it, again, I dont know python (yet), and would encourage you to develop it if that is your idea. I'm still leaning towards php with the code made open source, as then it can be utilized on the web by anyone, anywhere, with no need to install anything to run the tool.

Side Note: Perhaps someone can get me started with the right setup for coding/compiling scripts in Python. I've installed python 3.5 in the past and read several tutorials to learn the language....seems pretty straight forward....but I couldnt figure out what I was doing in the software and wasnt committed enough to spend forever looking for tutorials on how to compile, etc. Every tutorial I did find looked nothing like what I was looking at on my screen or had options that I was missing, etc. So, I dropped it for the time.

headline 05-15-2017 02:35

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by ThatOneGuy (Post 2520431)
Well, if such a thing is out there, it would be nice to be made available to others. If you're proposing I develop it, again, I dont know python (yet), and would encourage you to develop it if that is your idea. I'm still leaning towards php with the code made open source, as then it can be utilized on the web by anyone, anywhere, with no need to install anything to run the tool.

Side Note: Perhaps someone can get me started with the right setup for coding/compiling scripts in Python. I've installed python 3.5 in the past and read several tutorials to learn the language....seems pretty straight forward....but I couldnt figure out what I was doing in the software and wasnt committed enough to spend forever looking for tutorials on how to compile, etc. Every tutorial I did find looked nothing like what I was looking at on my screen or had options that I was missing, etc. So, I dropped it for the time.

Python isn't compiled, but rather interpreted. I use Pycharm as my IDE and it works out of the box well

ThatOneGuy 05-15-2017 19:34

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by Headline (Post 2520667)
Python isn't compiled, but rather interpreted. I use Pycharm as my IDE and it works out of the box well

Nice. I've tried visual studio and the default install from python.org, and ran into the roadblocks mentioned (and didnt care enough at the time to work too hard to resolve the issues). I'll look into pycharm though!

T1MOXA 07-10-2017 10:03

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Error when converting https://forums.alliedmods.net/showthread.php?t=71867
http://i.imgur.com/fDByphP.png
http://i.imgur.com/vzxe4s1.png

ThatOneGuy 07-11-2017 00:17

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
2 Attachment(s)
Quote:

Originally Posted by T1MOXA (Post 2534433)

Thanks for the feedback! I just patched this for you. Try the new version (1.1.6) in the OP.

Note: The processor doesnt handle splitting lines into multiple when multiple variable types are declared and the default values are set in the same line. This plugin has an instance of that. After fixing that, some view_as<>() stuff, and the AskPluginToLoad2 function, this is what I got.

cigzag 07-12-2017 00:28

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
How in the world do you even get this too work?

T1MOXA 07-12-2017 10:03

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
@ThatOneGuy :3 Thanks!

ThatOneGuy 07-12-2017 23:59

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Quote:

Originally Posted by T1MOXA (Post 2534847)
@ThatOneGuy :3 Thanks!

Your welcome!

Quote:

Originally Posted by SnowTigerVidz (Post 2534767)
How in the world do you even get this too work?

It is a Microsoft Excel based tool for now. All you need to do to use it is:
  1. Open the tool. If there is a yellow bar at the top asking if you want macros enabled, say yes (that allows the code to run). If there is a dialogue asking if ActiveX should run, say yes. This allows the button to work, though you could say no and run the code directly from the VBA window.
  2. Make sure your include path is set. The includes arent edited, but are used to define variable types, natives, forwards, etc.
  3. Click the button, and find the .sp file you want converted, and click ok.
  4. The file will now be processed. The original file is left as is, and the new one is in the same location and has the text " newsyntax" added to the end. After this, the tool is done.
  5. After processing, you will see the following at the top of the code:
    PHP Code:

    /* put the line below after all of the includes!
    #pragma newdecls required
    */ 

    Move the line of code (#pragma newdecls required) to be just past the last inlude. I may automate this step in the future as well.
  6. Make final edits for anything not handled by the processor (see original post for what all that is) until it compiles.

vortex. 07-14-2017 18:42

Re: TOGs SourcePawn Syntax Converter [MS Excel Based for now]
 
Cool! Thank you.


All times are GMT -4. The time now is 22:04.

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