GTA2 ScriptPad

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
User avatar
PacMani
Car Jacker
Car Jacker
Posts: 39
Joined: 29 Mar 2013, 17:13
GH nick: PacMani

Re: GTA2 ScriptPad

Post by PacMani »

Did you use Scintilla for the edit control?
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Add a hotkey to compile/compile and run (without prompt) for quick testing.

imageshack blocks my IP range from viewing some images like the ones you linked. I don't know why. I've tried to contact them twice but they didn't reply.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

@PacMani
No, far better component than Scintilla.
I wanted to use Scintilla but its too complex. It will take "years" to set up in Delphi and for .mis syntax.
Im not interested in this.

Sektor, i will try to change image hosting then.
Can you see now?
Image
Image

I will add this hotkey.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Yes images display now. Thanks.
User avatar
PacMani
Car Jacker
Car Jacker
Posts: 39
Joined: 29 Mar 2013, 17:13
GH nick: PacMani

Re: GTA2 ScriptPad

Post by PacMani »

Yeah, Scintilla didn't work for me too. What are you using then?
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Why you ask? Creating your own GTA2 scriptpad?
Always wear safety glasses while programming.
User avatar
PacMani
Car Jacker
Car Jacker
Posts: 39
Joined: 29 Mar 2013, 17:13
GH nick: PacMani

Re: GTA2 ScriptPad

Post by PacMani »

No, I was always just interested in syntax hilighting capable controls :D
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

I have problems with my XP and i must reinstall it. Skype is crashing like crazy and there are alot of other problems. I will get back after that is done.

Reason for delay is that i was unable to make MRU list look good with new theme, now i found better component and will use that.
Always wear safety glasses while programming.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

New version finally: ScriptPad v2.5.0.31
Get it from first post.

Why it took so long? Because i was too busy with my other things. Especially tuning my car. Because of the good weather i didn't want to sit in front of pc. Im getting tired of this.

It has many new features. Autocompletion and hints are not yet added back.
I need to make them better anyway, so it's pointless to add half done things.

Whats new:
*) You can now select many lines and comment them out with one click
*) You can also indent and unindent the selected lines
*) You can now use autoreplace feature, this is useful for making things like collectibles like
"machinegun" into COLLECT_00 or something, whatever you need.
Don't overdo it. It's not for autocompletion. It allows you to make things easier. You can edit
the supported keywords on your own in Options dialog under "Autoreplace"
*) All settings are now stored in registry under HKCU\BShep ScriptPad.
If you have any problems with that on some OS, let me know.
At first time you should choose the options you need in Options dialog.
There will be more later.
*) You can associate and unassociate the scriptpad with .mis files, like previously in Tools menu.
*) If you know your script is valid and compiles you can now just hit F9 and run your script in GTA2.
For this to work you must fill up the run dialog (F8) and the GTA2 path, map file used etc.
It compiles and runs GTA2 immediately. No error checking is done at that point. Will do this later.
But test out the stuff, there may be some bugs.

Known bugs:
1) Options dialog "Cancel" button does nothing yet.
2) Weird random crash sometimes when you close scriptpad. Occurs rarely. I will try to fix it asap.

There may be more things added, changed besides the UI but please report any bugs you find.


Enjoy.
Last edited by B-$hep on 23 May 2013, 00:00, edited 2 times in total.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Thanks!
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

I forgot to mention that the "Autoreplace items" listbox should containt something like this:

Code: Select all

plp=player_ped
levs=levelstart
leve=levelend
card=car_data
So when you type plp in editor, it will be replaced with player_ped
levs will be replaced with levelstart
etc. Hopefully you will get the idea.

You don't have to press Enter always, you can use Space also, so you can continue typing the rest of the command, names, brackets or whatever.

As i said you can add more commands to this list also and edit / delete the existing ones.

EDIT:
Ok, i noticed that there is some random crash when you close scriptpad. Very rarely happens but i don't know the exact location or reason yet. I will try to debug it.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

It's using the old HKLM instead of HKCU, so the registry/F8 run options don't work with GTA2 v11.43.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Using HKCU.

Did you specified the .scr file output in General tab of options dialog?
I know it should actually copy to there or use actual .scr file path.

Probably i forgot that. But if you specifiy .scr file output path into gta2\data, it should work.

EDIT: ok, it seems that i forgot to use actual .scr file path. I got it, but i never use it.

Im fixing it

EDIT2: ok, stupid thing. The path thingy code was commented out, dunno why i did it.
This should fix it.

EDIT3: run dialog uses HKLM.
Last edited by B-$hep on 22 May 2013, 21:02, edited 1 time in total.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

The F8 run option definitely wrote to HKLM.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Ok, i reuploaded it.
I will get the 11.43 and will test with this more.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

I think you just fixed SCR but the other run settings (Skip frontend, run in window, GMP, STY) still use HKLM.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Ok, i reuploaded.
Test it.

All stuff is now saved / read from HKCU.

Now the question, if user executes the scr with F8 and clicks "Run" button, should it recompile the script or not? Currently i modified it to use currently opened mis file, so it compiles and uses that by default.
But should it recompile it everytime you Run the scr or not.

Now there is also messagebox shown if there were any compilation errors, then you must fix them first. Before you are allowed to run gta2.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Works now. F8 should just be run, no need to compile, it's fine as is.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

Ok, i think you should get it again. I fixed some other things related to run.
It was not reading the run dialog editbox values unless you modify the editboxes stuff by hand.
Now on closing it always saves the contents of editboxes.
Always wear safety glasses while programming.
User avatar
B-$hep
Immortal
Posts: 568
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: EU

Re: GTA2 ScriptPad

Post by B-$hep »

New update:
I added an option to choose either v9.6 or 11.43.
The Vike's version is active by default because i noticed that many users use it here.
If 9.6 is active then it uses HKLM for debug stuff, else HKCU.

I tested and it seems to work fine for 9.6. 11.43 needs testing.
Always wear safety glasses while programming.
Post Reply