Hello guys i didn't know where to post this it seemed for me more then a discussion then a question because i want to know HOW exactly you can make it.
However my question is : let's say a script has a build number now every-time we compile we have to go through it and change it before we compile (+1) and to be honest it will be pain in the ass if you are compiling a lot.
Are there any ways that we can increase the build number every-time the compiler compiles the script ?
Posts: 298
Threads: 22
Joined: Jan 2012
Reputation:
0
That's a nice question and something I could see as useful, although sadly I don't think it could be done. Not through SAMP scripting alone at least.
Posts: 2,593
Threads: 38
Joined: Aug 2007
Reputation:
0
I suppose nothing automated is possible within Pawno itself, but I have seen one or two third party programs that I suppose could be modified for this feature. Look around the forums.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Having a build number for a community/live server confuses players, just keep the version numbering system simple so players know when an update has been implemented.
If you're just doing this script for yourself/generally in private, you could (probably) make a batch script to +1 a version number somewhere in the Pawn file and then run the compiler for it.
I read something like that in the forums two years ago but i really can't remember where, and when.
It really is useful for some case scenarios.
Posts: 15,941
Threads: 0
Joined: Jun 2008
Quote:
Originally Posted by Vince
I currently run SVN which keeps track of version numbers as long as I don't forget to actually log the changes. Then I run a batch file which copies the svn log to my server directory and creates a file in the scriptfiles directory with content like:
.
|
I'm pretty sure SVN has an inbuilt feature for that (properties/keywords), but I'm not sure of the syntax. Plus that's just commit number, not build number.
Quote:
Originally Posted by Sniper Kitty
It's called Batch programming/scripting.
|
No it isn't, all that code does it generate a VB script and run that instead.
Anyway, I've been trying to think of an elegant way to do this, but can't (I even checked the documentation and there was nothing). So it does look like you'll have to use a custom script. Anyway, this is what things called "makefiles" are explicitly designed for - you might want to look them up!
Posts: 15,941
Threads: 0
Joined: Jun 2008
Well yes, sort of:
pawn Код:
) > Modify.vbs
CSCRIPT //NOLOGO Modify.vbs
That is a batch script, but all it does is print some lines to a file, save it as a .VBS file, then run that file instead (even though everything they want can be done in pure batch scripting). "echo" is like "print", or in this case like "fwrite".
Posts: 15,941
Threads: 0
Joined: Jun 2008
Quote:
Originally Posted by zgintasz
Maybe I didn't understand, but why to recreate all .pwn file? It can be very huge. You can just create another file, add "const BuildNumber = 1" to that file and do the same, what you are doing for .pwn file. And of course, include that file to main gamemode file.
|
That's the way I would do it, in fact you can even put half the declaration in one file and just the number in another.