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 »

Still didn't answer my question. phh
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Debug it ;)
Olly is good with this.
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 »

hmm for that i use "property edit", TSyntaxMemo? .o looks like delphi has good components built in
User avatar
Sektor
Boss
Boss
Posts: 1393
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

HKEY_CURRENT_USER\Software\DMA Design Ltd\GTA2\Debug\scriptname isn't always written. I was wondering why scriptpad wasn't running my script even though in the scriptpad "use these" menu it had the right name.
User avatar
Sektor
Boss
Boss
Posts: 1393
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

When I select "save as" the path gets set to c:\ in an open dialog instead of the last folder that I saved in or my GTA2 data folder.

Each time I open scriptpad, the gta2.exe name gets reset to "gta2" without the exe part and I have to find the exe again.
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 ScriptPad

Post by BenMillard »

If it worked we would use it.
User avatar
Sektor
Boss
Boss
Posts: 1393
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

If I set scriptpad to start with a template, when I try to open an existing .mis, it says "Do you want to save changes to existing.mis?" even though I didn't even open it yet. I assume it is asking me to save the untitled mis that I didn't actually change.
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Indeed Sektor, it saves to C:\ because it was hardcoded for Open and Save dialogs.
I shouldnt code at nights.

I will get to them after i get back to home.
Always wear safety glasses while programming.
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Ok, fixed most of the problems reported by Sektor. It didnt wrote always the script name because the logic was wrong a bit, it saved info to HKLM for Vikes exe when it should have save it to HKCU for default 9.6 exe. That thing if it ask to save changes after using template script is actually not very wrong. Dunno if it should be option to choose from either ask to save or just ignore.
Sektor
How you noticed that gta2.exe gets to gta2?
I couldnt reproduce that bug.


EDIT
Get newest version from first post.
Should work better now as i also found some other bugs and possible crashes. Now it throws an error if you try to run unsaved script.
There is no point trying to compile not saved script.
Save first and then compile.

Etc, some other small things..
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1393
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Thanks. Now it pops up saying to save when I push F9 but it still launches GTA2 anyway. Previously it saved, compiled and then ran GTA2 which was quicker. Now I have to push ctrl+s and then push F9.

It's also not writing the HKCU registry keys, now even GMP and STY aren't being saved. I have Vike's exe set in the scrpad options.
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

But HKCU is not use by Vike exe? Or is it?
I thought that Vike uses HKLM for his things and dma uses HKCU.

Im confused now.

EDIT: it seems to ask GTA2 path again from me also, after pc turned off and on again.
Have to check why that happens.

EDIT2 Download again and see if that made any changes.
Always wear safety glasses while programming.
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: GTA2 ScriptPad

Post by BenMillard »

B-$hep wrote:I thought that Vike uses HKLM for his things and dma uses HKCU.
Other way round. Vike's GTA lets different users have different settings on the same computer.

You could support both places for all settings which are relevant.
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

So i should save svg, gmp, sty, scr in both locations?

I dont use Vikes exe so i dont know nothing about it.
If i must guess all the things then it will take much longer to fix bugs
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1393
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Saving in both won't help with mixups since you still need to read from the correct location based on the user choice.

Vike = HKCU
Rockstar = HKLM
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Ok so i broke the code that was actually correct.
Great. Gtg fix it now.

I will work with that combobox only, based on the choice in settings dialog, i either read stuff from vikes reg settings or dma settings.

EDIT: first post updated! New upload.
Always wear safety glasses while programming.
User avatar
Sektor
Boss
Boss
Posts: 1393
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

How does scriptpad tell compiler.exe the filename to compile? Is it through a DLL? I'm curious what was changed between official miss2.exe and modified compiler.exe.
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

You should ask JernejL what he did if he remembers.
Basically he faked the file opening with DLL or something like that.

I dont have sources atm near me, cant tell. But you have all his sources on your site.
Download the pack and mispad src should be there
Always wear safety glasses while programming.
User avatar
T.M.
Immortal
Posts: 957
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: GTA2 ScriptPad

Post by T.M. »

I have a vague memory that the filenames are stored in the registry
User avatar
Sektor
Boss
Boss
Posts: 1393
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

I compared the exe files and looked at the mispad source. miss2.exe was renamed to compiler.exe and hex edited to change comdlg32.dll to compiler.dll. That was the only important exe change. I don't think the source code to compiler.dll was included with mispad source (I could be wrong) but it wouldn't be much code since it just needs to return a filename.

sendmessage is used to "click" the compile/run parser menu item. getclassname and various winapi commands are used to read the listbox text.

I only looked into it because Logofero was asking for a command line compiler and I also think that would be useful.

compiler.dll reads filename from registry, mispad HKEY_CURRENT_USER\SOFTWARE\dnk development\gta2miscompilerdllhookfilename or scrpad HKEY_CURRENT_USER\SOFTWARE\BShep\ScriptPad\Settings\gta2miscompilerdllhookfilename (REG_SZ).
User avatar
B-$hep
Immortal
Posts: 546
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Finland

Re: GTA2 ScriptPad

Post by B-$hep »

compiler.dll source is included.
How i could fix the long filenames bug then??

In my compiler, compiling from command line is supported.
Simplest way to go is probably create simple exe that calls miss2 and compiles the supplied script.
I.e you drop test.mis into that exe and it gets compiled.


I actually did such app. But im not sure if i have the src with me on my usb stick atm.
Im not home.

I will take a look.
Always wear safety glasses while programming.
Post Reply