GTA2 ScriptPad

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Ben
Delete old ScriptPad folder and extract new one, instead of just replacing EXE, in next time.
I see that you had old .syn files etc in there. Not good. Delete old folder and extract lates one from archive always!

[*]I fixed the bug with opening .mis file and the access violation that occurred.
[*]Gonna rewrite the themes manager code to fix any bugs that may exists in there and that could cause some random errors.
[*]Then i will just review what i forgot, by reading old posts and finish the job i have left.

Then i will post the newest version again.

EDIT
[*]I fixed some more bugs.
[*]Added file changes detection, now it asks you to reload current file, if it's modified by someone else
Always wear safety glasses while programming.
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

When error occurs in script, then the Output window is scrolled to error message.
So you don't have to scroll it by your own, and when you double click on the error line, it selects the "bad" line in editor.

If there is no error, it scrolls to last line, like MisPad.
Maybe it should scroll to "Compiler Successfully".

When there is some bad string or symbol (simply some typo), it selects it, which allows you to just delete it with backspace or Del key, whatever you prefer.

I wish miss2 would give line numbers for all his errors. Not just few of them.


Anyway, i have plan to remove miss2 messages and use my own.
Hopefully i can make them more clear, so user will actually understand what went wrong.
Internal errors etc.

Otherwise just display script info and "Compile Successful".

Some of them (if not all) of the messages from miss2 can be "decrypted" from experience and give user advice what he should try or look at or what could cause the specific error or msg.


Probably also should be configurable in Options: "use default miss2 errors / messages or more clear ones."
Always wear safety glasses while programming.
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 ScriptPad

Post by BenMillard »

Basic GTA2 multiplayer script now gives standard weapons in a loop to all players who are present. This means any level can be playable in deathmatch, even if it has no other scripting.
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 ScriptPad

Post by BenMillard »

In a script with 120 lines, the tweaked Mis Pad wasn't compiling. There was no specific error message, just said "compilation stopped" very early in the script. Eventually found it was a schoolboy error. I had this:

Code: Select all

PLAYER_PED p1 = (100.6,193.6,255.0) 05 160 // Blue Redneck
PLAYER_PED p2 = (106.2,183.3.255.0) 09 320 // Orange Krishna
PLAYER_PED p3 = (099.5,187.8,255.0) 07 020 // Yellow Scientist
PLAYER_PED p4 = (095.8,192.5,255.0) 11 150 // Green Loonie
PLAYER_PED p5 = (097.1,184.2,255.0) 10 350 // Red Russian
PLAYER_PED p6 = (092.6,185.9,255.0) 13 080 // Dark Blue Yakuza
It should have been this:

Code: Select all

PLAYER_PED p1 = (100.6,193.6,255.0) 05 160 // Blue Redneck
PLAYER_PED p2 = (106.2,183.3,255.0) 09 320 // Orange Krishna
PLAYER_PED p3 = (099.5,187.8,255.0) 07 020 // Yellow Scientist
PLAYER_PED p4 = (095.8,192.5,255.0) 11 150 // Green Loonie
PLAYER_PED p5 = (097.1,184.2,255.0) 10 350 // Red Russian
PLAYER_PED p6 = (092.6,185.9,255.0) 13 080 // Dark Blue Yakuza
Highlighting that full stop in red would have helped a lot. Don't make the code look like a fairground ride - that won't help me code better or faster. Make it red if it's wrong does help, in situations like the above.
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Im just blind or i really do not see any difference in your script snippets here?
And by "tweaked" you mean the "bugfixed" mispad? Not the ScriptPad right?

Is this bug with any big script (more than 120 lines) or just with some specific?
Always wear safety glasses while programming.
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 ScriptPad

Post by BenMillard »

Heh, that's exactly the point - glad it wasn't just me! :-) It contains a little syntax mistake. Making mistakes like this more visible would be useful.

The mistake was: A full stop (decimal point) instead of a comma. 183.3.255.0 should be 183.3,255.0
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

So there was a decimal point instead of comma and it stopped compiling?
That's the bug?

I will look at it.
Always wear safety glasses while programming.
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

I got some ideas for fixing this stuff but it's not easy.
Because user could type the coords using different ways:

Like this

Code: Select all

PLAYER_PED p1 = ( 100.6, 193.6, 255.0 ) 05 160 // Blue Redneck
And then some maybe like this:

Code: Select all

PLAYER_PED p1 = (100.6, 193.6,255.0 ) 05 160 // Blue Redneck
Just some spaces, here and there.
Ok this is easy to solve by just removing all spaces from string.


But another problem is that there may be many commands that use such 3 coord values:
PLAYER_PED is one of them. But there are many others.


So basically i should find them all and parse each of them?

Of course i could go thru all the commands but this sounds crazy.
It's like writing new compiler. I already mentioned in this thread that, i can't fix all user typos, i can't make spell checker from it.

Any ideas how to solve it?


Maybe just fix the stuff for PLAYER_PED and leave others as is?
Always wear safety glasses while programming.
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 ScriptPad

Post by BenMillard »

Anywhere outside of comments in GBHscript, the following sequence is invalid:

Code: Select all

<number>.<number>.
The format is not technically difficult to validate, just laborious. There are is sort of machine-friendly syntax definition that comes with the compiler, or was found by another GTA2 fan. Searching the GTAMP forum will probably find it, or this even have jogged your memory.
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

I wanna ask you guys, is there any interest on this tool?
If there is no interest, i will stop this project completely.

I had some nice ideas /features to put in, but if there is no interest, then it's pointless to continue.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1449
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

I've been using an older version that has the Run and Compile & Run buttons but it forgets the gta2.exe location sometimes.

The version on the first post doesn't have run.
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

I never used that feature, i even didn't know that it worked.
That's a easy thing to add back.

But all the things must be done assuming that Vike's modified GTA2.EXE is used?
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1449
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Yes. All the scripters use Vike's version, so need to support old versions.
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

I updated the ScriptPad.
New version is in first post here:


GTA2 ScriptPad v2.0.3.19
http://gtamp.com/forum/viewtopic.php?p=2159#p2159

* Added Compile & Run, like in old version.
* Fixed some bugs
* Tried to make it more stable
* Updated ReadMe.txt

I dunno if it forgets the GTA2 path now or not, but i store it in my own key now.
If you Sektor could tell me exactly where GH stores GTA2 path, then i could try first read the path from there.

Currently at first run, you must point him to the GTA2.exe.
Always wear safety glasses while programming.
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 ScriptPad

Post by BenMillard »

When I choose Tools > Options, Colors tab and set Active Color Scheme to MisPad Theme I get this error:
Cannot open file "C:\Program Files\Rockstar Games\GTA2\tools\Script Editor (B-Shep)\Themes\MisPad.lcf". The system cannot find the file specified.
If I then select the default Dark Theme it gives a very similar error:
Cannot open file "C:\Program Files\Rockstar Games\GTA2\tools\Script Editor (B-Shep)\Themes\Dark.lcf". The system cannot find the file specified.
The code is being displayed in the Dark Theme from when I launched it by double-clicking GTA2 ScriptPad.exe.

Word Wrap is way nicer than having horizontal scrollbar. But I can't use this editor in the dark theme. Last time I spent a long while tuning the syntax highlight profile, hoping to share an updated file. But all my changes were lost, like it wouldn't save any settings due to the other theme files being missing.

It remembers window size and position. Which is nice.
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Hi Ben.

Very strange, never ending problem with syntax highlighter files.
I will review the code to see what im doing wrong there.

Btw how did you replaced old ScriptPad? Did you removed old and copied new one or just extracted main exe? The old version used some different filenames if i remember correctly and in this version i renamed them in sourcecode.

So you say that: MisPad.lcf and Dark.lcf file exist in Themes folder and in same folder with exe, but it says it can't find them?

Are you using Vista or Win7?
You should move away the ScriptPad from it, because "custom" apps do not have permission to mess with any files in Program Files folder.
As result, you will get File not found errors, because OS doesn't give permission to read or modify it.

XP doesn't have such problem.
Move to C:\Script Editor (B-Shep) or something like that and try it again.


EDIT Did you knew about the stuff or discovered the hints, when you type in for ex: player_ped and then space and the hints it gives to you?

Not all commands are supported atm. Very few...
Always wear safety glasses while programming.
User avatar
Pyro
Immortal
Posts: 414
Joined: 17 Mar 2010, 04:07
GH nick: Pyro
Location: Wales, UK

Re: GTA2 ScriptPad

Post by Pyro »

Tried to have a look at this, but AVG came up with a virus warning for the following files in it:

The actual 7z file itself.
compiler.dll

Both say its "Virus identified Win32/Induc.A" - again regarding Delphi. :roll:
User avatar
B-$hep
Immortal
Posts: 584
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Damn AVG. Why you use this crap? I had so many troubles in past with it. Once i installed it, did a scan on my PC and it just removed all windows components, at next reboot my windows didn't start anymore. It thought that my whole XP is virus.

I recompiled DLL and did a check:
Image

No Induca.


Download the compiler.dll from here

***LINK***

Delete old dll and use this.
Maybe avg screams because i packed files with UPX.
Always wear safety glasses while programming.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 ScriptPad

Post by T.M. »

You packed the GTA2 compiler .dll files? I checked: your dll's differs from mine. Why on earth?

Tip: exe packers are useless, dont use them... 7zip will make the final pack much smaller when they are all packed at once.

The only reason exe packers might be useful if you wanna distribute exe directly as one file and ready to be executed at any time without unzipping by separate programs. but that is clearly not the case here.
User avatar
Pyro
Immortal
Posts: 414
Joined: 17 Mar 2010, 04:07
GH nick: Pyro
Location: Wales, UK

Re: GTA2 ScriptPad

Post by Pyro »

Never had a problem with AVG. One time it thought uTorrent.exe was a virus but actually turned out to be a false positive.

Anyway, it removed the actual 7z file itself (I told it to) so I didn't actually install it in the end. I know the actual virus itself is very minor but still don't want to have any on my system (obviously!) so as you can imagine I might be a bit reluctant to try this again, especially if it comes from an .exe instead. Everything I download I always virus check it first anyway - better safe then sorry.
Post Reply