Page 14 of 15

Re: GTA2 ScriptPad

Posted: 24 May 2013, 20:11
by PacMani
Still didn't answer my question. phh

Re: GTA2 ScriptPad

Posted: 24 May 2013, 20:19
by B-$hep
Debug it ;)
Olly is good with this.

Re: GTA2 ScriptPad

Posted: 24 May 2013, 20:46
by PacMani
hmm for that i use "property edit", TSyntaxMemo? .o looks like delphi has good components built in

Re: GTA2 ScriptPad

Posted: 15 Aug 2013, 06:44
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.

Re: GTA2 ScriptPad

Posted: 22 Aug 2013, 01:40
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.

Re: GTA2 ScriptPad

Posted: 23 Aug 2013, 19:29
by BenMillard
If it worked we would use it.

Re: GTA2 ScriptPad

Posted: 02 Sep 2013, 05:15
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.

Re: GTA2 ScriptPad

Posted: 03 Sep 2013, 09:33
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.

Re: GTA2 ScriptPad

Posted: 03 Sep 2013, 20:59
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..

Re: GTA2 ScriptPad

Posted: 04 Sep 2013, 06:04
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.

Re: GTA2 ScriptPad

Posted: 04 Sep 2013, 08:58
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.

Re: GTA2 ScriptPad

Posted: 04 Sep 2013, 09:57
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.

Re: GTA2 ScriptPad

Posted: 04 Sep 2013, 15:38
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

Re: GTA2 ScriptPad

Posted: 04 Sep 2013, 16:24
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

Re: GTA2 ScriptPad

Posted: 04 Sep 2013, 20:21
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.

Re: GTA2 ScriptPad

Posted: 14 Dec 2015, 00:01
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.

Re: GTA2 ScriptPad

Posted: 17 Dec 2015, 18:15
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

Re: GTA2 ScriptPad

Posted: 20 Dec 2015, 21:47
by T.M.
I have a vague memory that the filenames are stored in the registry

Re: GTA2 ScriptPad

Posted: 21 Dec 2015, 07:18
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).

Re: GTA2 ScriptPad

Posted: 21 Dec 2015, 13:00
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.