GTA2 ScriptPad

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
CarThief
Hitman
Hitman
Posts: 108
Joined: 19 May 2012, 18:12
GH nick: CarThief
Location: Holland, AKA The Netherlands

Re: Illegal Objects

Post by CarThief »

Hm, perhaps i remembered it horribily wrong, seems the light theme has the colors set to something darker by default and the black one uses alot of red and yellow and such instead, the white theme doesnt seem as bad at all, perhaps i confused the two themes a bit... Even looks like i can use a custom set of colors too for the various different keywords and commands. Guess there's no problem at all, just my memory being faulty lately.

I guess if its any help the one i just checked is Scriptpad 23-10-2011 that came from one of Elypter's packs.
Havent seen any 'colormode' option though, but it does allow me to pick whatever color i like for the various pieces of code per theme.
Hm, perhaps i was remembering another (or alot older) editor instead... Well nothing wrong with this one in any case.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: Illegal Objects

Post by B-$hep »

This thing was buggy if i remember correctly. I mean modifying colors.
But themes should work fine and editor should remember the theme, so next time you start it should use the theme you set last time.
Always wear safety glasses while programming.

Galactic Boy
Immortal
Posts: 333
Joined: 15 Apr 2012, 08:26

Re: Illegal Objects

Post by Galactic Boy »

Ben Millard. Thank you for moving the above posts to the ScriptPad topic.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Sorry it took so long, but i updated it and now it should work fine.
I removed stuff that didn't work properly or was unstable.
Default theme now is always Mispad theme (white). You can't change that anymore.
It was buggy anyway.

Get the latest version from first post of this thread.
EXE is clean and not packed. There is no induc-a.


Because of my own GTA2 script compiler im writing atm, i will rewrite the IDE anyway from scratch.
The code is a big mess and i don't remember all the things i was doing there or how i was doing them.
Im surprised that it actually compiled after these years lol.
It was 2011 back then.
Always wear safety glasses while programming.

User avatar
Sektor
Boss
Boss
Posts: 1390
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Thanks for updating it. Ctrl C, X and V all work.

Bug: The compile toolbar icon is always disabled and clicking it does nothing.
Feature request: Find and find and replace (ctrl+f, ctrl+h)

Jones
Psycho
Psycho
Posts: 51
Joined: 08 Aug 2012, 21:25

Re: GTA2 ScriptPad

Post by Jones »

Great, finally working copy & paste :)

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

New version as requested:

*Added Ctrl+F (Find), Ctrl+R or Ctrl+H (Replace) both work.
*Added possibility to specify output folder for the compiled script (.scr)
So you don't have to manually copy it over each time after each compile. Good if all your scripts are compiled for example into GTA2\data and you don't store script sources inside GTA2\data
* Fixed the RUN dialog bugs (hopefully) also made it to stay on the top of the main script editor window. Now you can open the "run" dialog, edit the script, run your script, come back, modify your script, compile it and run it again, without closing / opening the "run" dialog in the meantime.
This allows quickly see changes made in script in game. I tried this and i like that.
*Fixed some small bugs / typos
*Lot's of small fixes in code + code cleanup (removed some "dead" code)

+ other things i probably forgot.

If there is any bug, let me know.
As always, get latest version from first post of this thread.

Sektor The other guys here have text's under their nicknames like: Psycho, Lunatic etc.
Why i dont have any? I really don't need it so much, but im just curious, why it was removed.


Enjoy.
Always wear safety glasses while programming.

User avatar
Sektor
Boss
Boss
Posts: 1390
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

At 300 points, you get the "Immortal" rank. I only added that because I got bored of every one being "Serial Killer". I didn't add an image for it, probably because I'd get bored of that too. I'll add more ranks and images eventually but it's low priority.

Further rank talk should go in the ranks topic: http://gtamp.com/forum/viewtopic.php?f=15&t=96

Jones
Psycho
Psycho
Posts: 51
Joined: 08 Aug 2012, 21:25

Re: GTA2 ScriptPad

Post by Jones »

AutoCompletion doesn't seem to work anymore no matter wether its activated or not. What do you think about the idea letting ScriptPad open .mmp files? So you don't have to type in the run options manually. You already use ini files so it shouldn't be a great hassle adding this feature ;)

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

I removed the autocompletion, because it seemed to be buggy for me.
I will rewrite this thing from scratch anyway and will try to make faster.
Currently all commands are in autocomplete list and this makes it extremely slow.
It must be more "intelligent".

Known bugs atm:

1) The undo after save option doesn't work. Dunno what it is.
Im currently messing with it and no matter what i do, undo after save is always disabled.
Maybe bug in the syntax editor vcl.

2) Random crash when closing scriptpad in some cases. Dunno the exact cause of that but sometimes it crashes if you do something...

Will try to find out.


I will add mmp file support. Should not be a problem, but then if you don't have mmp file for script then you must type things in.
If there is mmp file then it will try to fill things for you.
Dunno how mmp files should be handled? Do the mmp files always have the same name with scr file?
I never played multiplayer, so i don't know much about them or how they are used.

My idea (dunno if it will work):
1) I associate the .mmp file with scriptpad
2) Parse the .mmp file, try to find the .scr file in there, map filename and sty filename
3) Fill boxes with this info

Another idea
1) Dont associate scriptpad with mmp, but add possibility to open mmp with opendialog and when you open it it will immediately parse the mmp file and will fill up the boxes.

2) When .scr file is opened, try to locate .mmp file with same name as .scr file in same folder and parse this.


Dunno. Suggestions?

Thanks for using ScriptPad.
Always wear safety glasses while programming.

User avatar
Gustavob
Immortal
Posts: 407
Joined: 18 May 2009, 21:40
GH nick: Gustavob
|Gustavob|
Location: Nowhere.
Contact:

Re: GTA2 ScriptPad

Post by Gustavob »

B-$hep wrote: Dunno how mmp files should be handled? Do the mmp files always have the same name with scr file?
It basically has a few lines that tell GTA2 what files to use from GTA2\data:

Code: Select all

[MapFiles]
GMPFile = GMPFileName.gmp
STYFile = STYFileName.sty
SCRFile = SCR/MISFileName.scr
GXTFile = GXTFileName.gxt  #Optional, only available in GTA2 version ≥11.3beta1, obviously not all maps use this
GCIFile = GCIFileName.gci  #Optional, only available in GTA2 version ≥11.3beta1, obviously not all maps use this
Description = Map Name
PlayerCount = 1            #Optional, unnecessary since GTA2 version ≥11.38
Probably the only lines that matter here are the first three ones (as you can't run singleplayer GTA2 with different GXT and GCI files, singleplayer doesn't need PlayerCount and the only reason I can think you might need Description for is in case you want to show the map name in the title bar). Take a look at some MMPs with Notepad for some examples.
You just lost the game.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Yeah, i looked it and already parsed, nothing hard, it's just a ini file.
Delphi has built-in support for that.

But the question is how to handle this mmp file thing correctly.
Should scriptpad assume always that mmp file name matches the opened / saved .mis filename or not.
Then it will just try open matching mmp file from same path as mis file or where the compiled .scr is put.
Always wear safety glasses while programming.

Jones
Psycho
Psycho
Posts: 51
Joined: 08 Aug 2012, 21:25

Re: GTA2 ScriptPad

Post by Jones »

1) Dont associate scriptpad with mmp, but add possibility to open mmp with opendialog and when you open it it will immediately parse the mmp file and will fill up the boxes.
I would choose this option, more easy to implement and not hard to use :)
I removed the autocompletion, because it seemed to be buggy for me.
Some commands were missing, but I still found autocompletion useful enough. It was also fast, so no real need to improve it that much.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Jones, you are right.
But maybe it was fast because not all commands were included.
I remember that i removed lot's of them because when i was implementing this i added every possible thing in it (all commands, constants etc) and it was very slow. If i remember correctly.

I have to make one autocomplete list for usual commands for ex: IS_CAR_IN_BLOCK etc and other list for constants like: COLLECT_00, COPCAR etc. This should make it a bit better.

I actually re-enabled the autocompletion but i was unable to upload it.
Will upload a bit later after i try some more commands in autocompletion list.

Btw: do you like these hints for parameters?
Image

Does it makes things easier? It was also probably disabled but this thing also needed some tweaks.
Sometimes it randomly popped up where it shouldn't.

I will try to make it better
Always wear safety glasses while programming.

Jones
Psycho
Psycho
Posts: 51
Joined: 08 Aug 2012, 21:25

Re: GTA2 ScriptPad

Post by Jones »

Looks good, I find those hints for parameters useful for sure :)

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Ok the tooltip bug i mentioned above actually occurs because of my method of showing it.
The "(" and ")" work fine, tooltip seems to open / close properly but for things like PLAYER_PED [Player Name] etc it's just a little bit buggy.
Needs a bit of tweaking.
Always wear safety glasses while programming.

User avatar
Sektor
Boss
Boss
Posts: 1390
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: GTA2 ScriptPad

Post by Sektor »

Suggestion: Warn if filename including extension is longer than 22 characters. GTA2 crashes if the SCR filename is too long.

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

No problem. I will put this into new version, i dunno where the old mispad sources are again. But i have new version written already, months ago that i haven't released yet.

I will try to release it today or tomorrow.
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 »

I like the look of the auto-complete. Does the bold highlighted parameter change once you put in a comma ready for the next parameter?

User avatar
B-$hep
Immortal
Posts: 543
Joined: 24 Apr 2009, 21:43
GH nick: B-Shep
Location: Estonia - Finland

Re: GTA2 ScriptPad

Post by B-$hep »

Yes Pyro:

Image
Image


These are so called parameter tooltips.
Autocompletion is a small list with all supported commands that appears at the current word you type in and if some command matches already with some chars in your word it filters out the rest and when you hit enter, it writes that command for you.

But atm i disabled it, including parameter tooltips. I want to make it better / smarter.
Always wear safety glasses while programming.

Post Reply