Turning the natural name of constants into the GBHscript name of objects is the most useful thing autocompletion could do. And there's a relatively easy, lo-fi way to do this whilst keeping compatible with Mis Pad. Here's what I have in mind:
- Type "pistol" in the weapon name part of a GENERATOR.
- Press Ctrl+Space.
- It is replaced by COLLECT_01.
- A comment is added to the end if the line, which simply says // pistol.
- Now my command is valid and I can make sense of it thanks to the comment, without having to refer to a big list of numerical weapon constants, AND it's compatible with Mis Pad.
Here's a full example. This is what I've typed:
Code:
GENERATOR pistol1 = (10.0,20.0) 090 pistol|
Now I press
Ctrl+
Space and it becomes:
Code:
GENERATOR pistol1 = (10.0,20.0) 090 COLLECT_00 | // pistol
The vertical bar represents the text cursor (aka the insertion point). So I can continue typing the other parameters. If any of these later parameters get replaced, the comment just gets longer.
Predictive CodeA more sophisticated logic could be developed on this string-based searching and mapping. If I make a
GENERATOR whose
name includes "
pistol", ScriptPad could suggest
COLLECT_00 once I get to that part of the command. This would work with editing a command, so a new
name would give new suggestions if I moved the insertion point to a parameter which didn't match that name.
Mappings would be many-to-one and use case-insensitive substring matching. The most popular 3 names for each
GENERATOR type could be supported, as a maximum. Such as "
rocket", "
zooka" and "
rpg" being mapped to
COLLECT_02. Many would only need one of these pseudo-aliases. Such as "
pistol" becoming
COLLECT_00.
Syntax completioA few ways to do this but how about I start with this:
Code:
GENERATOR pistol1 |
Now I press
Ctrl+
Space and it becomes:
Code:
GENERATOR pistol1 = (_x,y,z_) rotation COLLECT_00 delay1 delay2 ammo // pistol
The part between underscore characters would be selected text.
Other ApplicationsCar names are a prime candidate for this automated editing.
The tooltips will be very handy in gang zone setups, phone templates and other complex commands. The bonus lists for cranes spring to mind!
(EDIT) Ah, cannot underline within a code sample.