About this last one feature, I guess the main problem would be multiple brackets causing errors on long IF statements, unless you're already able to figure out open brackets with no counterpart closing brackets and vice-versa like in N++. That would be something I'd love to see, and would be very helpful
Once again, nice job!
edit: just noticed I started two consecutive pages in the same topic lol
Re: GTA2 ScriptPad
Posted: 03 Apr 2011, 11:27
by B-$hep
Thanks Gustavob.
Yes, i tried one test script (bonusrace.mis) and deleted some brackets and endifs.
When i removed one endif, it displayed some internal parser error, nothing related to actual missing endif.
And when i removed some brackets, it just told me that the token before the bracket is unrecognised. Nothing helpful, just line number and token name:
IF ( IS_CHARACTER_IN_ANY_CAR (p1))
STORE_CAR_CHARACTER_IS_IN ( p1, p1car )
endif
Well bracket highlighting works. I guess i just have to count IF and ENDIF's to find missing ones and maybe same for brackets.
Dunno yet. But i will try. It would be easier if miss2 displayed more useful error msg.
It's easier to parse error messages than script.
Re: mispad
Posted: 03 Apr 2011, 14:46
by B-$hep
BenMillard wrote:Could you prevent hangs due to valid but unsupported folder and file names? I just hit a problem where I had to rename a folder to make .mis files compile.
...
You asked for it, you got it:
Should work with any "crazy" and unusual paths and filenames now.
File path in this example is same as yours Ben, just script content is simple test script.
Im loading file from MRU list, to speed up file opening.
But it shows that script with such long name and spaces in filename has compiled successfully.
Re: GTA2 ScriptPad
Posted: 03 Apr 2011, 16:07
by Pyro
Looking good
Any word on script compiler crashing with certain file names? As I mentioned earlier I want to finish my single player with missions script
Edit - if you haven't already, here's some extremely basic script to get any map working which could be useful for your default template:
Any word on script compiler crashing with certain file names? As I mentioned earlier I want to finish my single player with missions script ;)
Thanks.
Yes, crashing and such things because of certain file names should be fixed now and gone forever. Even .tmp and .### files are always removed: before and after compiling.
Edit - if you haven't already, here's some extremely basic script to get any map working which could be useful for your default template:
Thanks again, i actually had, put very poor example.
Yours is much better and nicer. I will include it and credit you.
Re: GTA2 ScriptPad
Posted: 03 Apr 2011, 16:46
by Pyro
B-$hep wrote:Yes, crashing and such things because of certain file names should be fixed now and gone forever. Even .tmp and .### files are always removed: before and after compiling.
I hope so Can't wait to test it and see if it holds up heh heh.
Re: GTA2 ScriptPad
Posted: 04 Apr 2011, 09:38
by B-$hep
OK, what's new?
[*]I added the Preferences dialog where you can change bunch of editor settings, including syntax HL, font style, font colors, editor background color, enable/disable autocompletion etc.
[*]Added possibility to choose what editor will do at startup:
Opens last used script
Creates new empty script
Or just shows splash screen
[*]Implemented saving of many other editor settings.
Because there is pretty alot of settings to save, i decided to work a bit on it.
Re: GTA2 ScriptPad
Posted: 04 Apr 2011, 13:28
by BenMillard
That template will be useful if you press File > New to start a script. It should include one weapon, so the object and the command can be copied and pasted. With a couple of environmental things and that's everything most arenas need.
// GTA2 Test Script
// by Pyro & BenMillard, April 2011
// http://projectcerbera.com/gta/2/tutorials/multiplayer
// Weapons
// Note: This respawns instantly and gives maximum ammo.
GENERATOR rocket1 = (128.0,128.0) 0 COLLECT_02 0 0 99
// Player Cars:
PARKED_CAR_DATA p1car = (126.5,126.5,255.0) 28 225 VTYPE // Red
PARKED_CAR_DATA p2car = (126.5,129.5,255.0) 24 315 VTYPE // Orange
PARKED_CAR_DATA p3car = (129.5,129.5,255.0) 35 045 VTYPE // Yellow
PARKED_CAR_DATA p4car = (129.5,126.5,255.0) 20 135 VTYPE // Green
PARKED_CAR_DATA p5car = (128.0,130.2,255.0) 14 000 VTYPE // Dark Blue
PARKED_CAR_DATA p6car = (125.8,128.0,255.0) 02 270 VTYPE // Black
// Players
/*
p1 p4
p6 RL = (128.5,128.5)
p2 p5 p3
*/
PLAYER_PED p1 = (127.0,127.0,255.0) 07 045 // Yellow Scientist
PLAYER_PED p2 = (127.0,129.0,255.0) 11 135 // Green Loonie
PLAYER_PED p3 = (129.0,129.0,255.0) 10 225 // Red Russian
PLAYER_PED p4 = (129.0,127.0,255.0) 09 315 // Orange Krishna
PLAYER_PED p5 = (128.0,129.5,255.0) 13 180 // Dark Blue Yakuza
PLAYER_PED p6 = (126.5,128.5,255.0) 08 090 // Dark Grey Zaibatsu
// Counters
COUNTER stage = 1
// End of objects...
LEVELSTART
// ...start of commands.
// Environment
SET_AMBIENT_LEVEL (0.75, 0) // reduce the value after you add lights
DECLARE_POLICELEVEL (4) // 4 = SWAT; 5 = FBI; 6 = Army
// Note: Army in multiplayer needs Vike's GTA2 v11.3 or newer.
// Weapons
SWITCH_GENERATOR (rocket1, ON)
// Main Loop
// Note: Only needed for missions, game modes and gimmicks.
WHILE_EXEC (stage = 1)
DO_NOWT
ENDWHILE
LEVELEND
Filename should be first thing in the titlebar, like Windows Explorer and MS Office. Then I can tell 3 scripts apart in the taskbar at-a-glance. So your image would have said this at the top: tiny3-arena.mis - GTA2 ScriptPad
Oh, I meant the left edge of the tooltip should align with the left edge of the parameter. If that's possible... it's the way Visual Studio 6 presents it. (For me, that's just about the nicest code editor to work in - well-balanced between simplicity and capability.)
Yeah, it's looking really cool. And exceptionally fast progress!
(EDIT) Don't try to compete with Notepad++ and other big text-based editors on total number of features. Convenience features which are highly specific to the .mis format is what makes Mis Pad favourable. Such as integrating the compiler input and output into the editor.
Aliases for the more idiosyncratic constants, tooltips and autocompletion could make ScriptPad favourable to MisPad. More refined Ctrl+Arrow behaviour for moving around and selecting code, more reliable Undo/Redo and so on would tip the balance further still. The filename fix is also very welcome!
(EDIT2) Updated template to include 6 players, with a comment shown how they are arranged. Not tested... earliest I could test this would be Wednesday evening.
Re: GTA2 ScriptPad
Posted: 04 Apr 2011, 20:52
by B-$hep
Thanks again Ben.
And exceptionally fast progress!
Yes, i would like to finish it soon, because i would like to continue or rewrite some of my old projects or even start some new one. I think actually continue some old one, taking a break and coming back to something after few months usually helps. At least it helped me many times.
That template will be useful if you press File > New to start a script
Done! I added this as option, create new empty script or create it from template you posted.
Filename should be first thing in the titlebar
Done!
More refined Ctrl+Arrow behaviour for moving around and selecting code
I think you meant Shift + Arrow.
Done!
more reliable Undo/Redo
I think it's done.
Oh, I meant the left edge of the tooltip should align with the left edge of the parameter.
Sorry Ben, i still don't understand. Isn't that the same in image i posted?
Can you make some fast ascii image or draw it in Paint?
EDIT:
Just had to run my VB6:
Like this?
Both 'M's are almost on top of each other and left side of tooltip is aligned with 'M'.
Btw. VB6 also shows MsgBox (function name at the start of tooltip). Should i do the same?
Or it will be too long tooltip then?
I guess it will be, because some GTA2 commands are pretty long.
EDIT2: But actually this VB6 tooltip isn't short either.
Re: GTA2 ScriptPad
Posted: 05 Apr 2011, 10:29
by BenMillard
I've updated the template but not tested, yet.
B-$hep wrote:[...] taking a break and coming back to something after few months usually helps.
Me too.
B-$hep wrote:I added this as option, create new empty script or create it from template you posted.
Always use the template, to keep the menus simple. Ctrl+A, Del turns the template into a blank script. But every level contains most (or all) of the things in that template, so I doubt any of it would usually be deleted. (Which makes the "blank script" option pretty useless, AFAICT.)
B-$hep wrote:
BenMillard wrote:More refined Ctrl+Arrow behaviour for moving around and selecting code
I think you meant Shift+Arrow.
Either and both are used for moving around code. For example, Ctrl+Right moves rightwards to the next word boundary. Ctrl+Shift+Right will select rightwards to the next word boundary.
Making this smarter about decimal numbers and individual parts of (x.x,y.y,z.z) patterns would be handy. (Full stop shouldn't be a word boundary within decimal numbers; it's the decimal point in that context.)
Double-click which was smarter about boundaries would also be neat. For bonus points, triple-click selection which is smart about line continuation. (As seen in Office, Wordpad, Notepad, Firefox and other places.)
B-$hep wrote:Both 'M's are almost on top of each other and left side of tooltip is aligned with 'M'.
Yes, that's what I had in mind. Aligning the first letters better would be nice but not essential.
B-$hep wrote:VB6 also shows MsgBox (function name at the start of tooltip). [...]
EDIT2: But actually this VB6 tooltip isn't short either.
Having the current parameter in a tooltip aligned to its position is good. The completion list could then go below the word, so it almost works like a ComboBox. (Only used if there's more than one relevant completion item.)
Re: GTA2 ScriptPad
Posted: 05 Apr 2011, 21:19
by B-$hep
BenMillard wrote:I've updated the template but not tested, yet
Me neither.
Always use the template, to keep the menus simple. Ctrl+A, Del turns the template into a blank script. But every level contains most (or all) of the things in that template, so I doubt any of it would usually be deleted. (Which makes the "blank script" option pretty useless, AFAICT.)
File menu is simple, ok, i will set template option as default.
To make it empty at startup user has to choose second option in preferences dialog.
BenMillard wrote:More refined Ctrl+Arrow behaviour for moving around and selecting code
I think you meant Shift+Arrow.[/quote]Either and both are used for moving around code. For example, Ctrl+Right moves rightwards to the next word boundary. Ctrl+Shift+Right will select rightwards to the next word boundary.[/quote]
I think it works already, i tried.
Consider it done, sir :) (like they said in Commandos game).
Making this smarter about decimal numbers and individual parts of (x.x,y.y,z.z) patterns would be handy. (Full stop shouldn't be a word boundary within decimal numbers; it's the decimal point in that context.)
....
Double-click which was smarter about boundaries would also be neat. For bonus points, triple-click selection which is smart about line continuation. (As seen in Office, Wordpad, Notepad, Firefox and other places.)
These 2 things i really don't understand, to be honest.
Can you explain a bit better please?
Yes, that's what I had in mind. Aligning the first letters better would be nice but not essential.
I don't know Ben, i took a quick look at this stuff, but it seems alot of work for such simple thing. It may sound strange but it seems like so.
Maybe im wrong, i repeat only quick look. I will try to finish the other important stuff first and then i will try.
Having the current parameter in a tooltip aligned to its position is good. The completion list could then go below the word, so it almost works like a ComboBox. (Only used if there's more than one relevant completion item.)
Ok, same as above.
Re: GTA2 ScriptPad
Posted: 05 Apr 2011, 22:34
by B-$hep
Can somebody drop me some multiscript?
Sektor you said (on first page of this topic) that MISS2 can compile them but mispad can't?
I would like to fix it.
B-$hep wrote:
And what it means: it doesn't compile? Crashes?
displays an error on mispad, but works on normal compiler
Re: GTA2 ScriptPad
Posted: 05 Apr 2011, 22:52
by B-$hep
Tried with mispad:
I opened bil.mis, -> "Compile"
and then in output:
Line 79: zone declare set
Compilation stopped
No errors or anything, just stopped.
My path: C:\Program Files\gta2script\example
Found f1.mis. Also has folder f1.
It's on my desktop.
miss2 now says that it can't find the f1\pkt.mis file in it's own folder ("compiler" in this case)
I guess i have to pass some more stuff to compiler to make it find the files.
Re: GTA2 ScriptPad
Posted: 05 Apr 2011, 23:02
by Gustavob
from what Ive seen, the official compiler compiles somewhat like this:
..."normal" code...
...find LAUNCH_MISSION or DO_EASY_PHONE_TEMPLATE or DO_PHONE_TEMPLATE...
...find pointed file inside folder with the same name as the main script..
...compile secondary file...
...continue main file compilation...
in case thats useful
Re: GTA2 ScriptPad
Posted: 05 Apr 2011, 23:24
by B-$hep
Fixed!
Just had to add one line to source, thats all.
Even the da*n bil.mis compiled now.
Re: GTA2 ScriptPad
Posted: 06 Apr 2011, 08:54
by B-$hep
Just to show you how it looks atm in general.
It's not final of course. Many things i think will be changed.
Look in HD. Im using free CamStudio to record this.
Although, there are way too many different colors, i suggest you use just one color for all enums, like COLLECT_01 and etc... why dont you use my mis.stx definitions ? i already wasted lots of time to choose good colors there. after all, our coloring is almost the same... also it could be a nice idea to be able to see the same colors in my editor / your editor
Re: GTA2 ScriptPad
Posted: 06 Apr 2011, 20:42
by B-$hep
Thank you T.M for your kind offer.
I looked at mis.stx and it looks so simple. So it's very easy for me to get the stuff into my code.
I will add you to About box.
Thanks again.
EDIT: OK, done.
Looks familiar?
Of course user an change these colors, including background color, font etc.
Maybe Lucida Console is nicer than Courier New (that i currently use)?
But it's not on Win95 / Win98, it's on XP but on Win7?
Yeh, don't be surprised, i still use Win95 also. Love playing GTA2 on it. Nostalgia.