Epic GTA2 Map Editor (0.6.6602) Beta

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

Cuban-Pete wrote:I just stole some images on google and made this idea. Is it in the right direction or?

Image
Good idea, but im not sure its good idea to put text there, kinda hard to read it when its all rotated :/

Edit: Hmm... maybe i could choose object type from that list, and then from left menu i choose details, like CRANE_DATA, DESTRUCTOR, etc. And then special menu to select any type of object. So this would allow you to browse all object types too, but most used/important objects would be in that circle menu.

---


(moved) What i need to know now:

1) Tips on how to avoid the script compiler to crash.
2) Tips on how to avoid the GTA2 crash with invalid scripts.
3) Script rules on how the script should be scripted if you want it to work as intended / prevent compiler errors.

Collected so far:
1) Avoid script compiler errors:
- (CRASH) If you crashed the compiler before, and you didnt remove .tmp files, next compiled scripts will crash too!
- (CRASH) Maximum allowed objects is 1000 or crash.
- (CRASH) Objects BIN and CAR_SHOP with AmmoOrRemap value with CREATE_OBJ will always crash compiler if using 2d coordinates, however 255.0 makes 2d coords possible.
- (CRASH) Using PLAYER_PED with 2d coordinates crashes the game, however 255.0 makes 2d coords possible.

2) Avoid GTA2 errors:
- (CRASH) Overlapping cars will crash GTA2 if too many overlap. Always avoid overlapping cars as much as possible.
- (CRASH) If viewing too many objects at same time (around 600-2000 objects (depends on object type)) the GTA2 will crash.
- (CRASH) Some cars will insta crash GTA2. (eg. HOTDOG_D4).
- (CRASH) Having a car type set to train (or any of its carriages).
- (CRASH) Blowing up WRECK0-9 cars will crash GTA2.
- (CRASH) Setting PLAYER_PED location on top of a car, char or any object, will crash GTA2.
- (CRASH) Different objects have different maximum object limits.
- (CRASH) Linking to zones (from script file) that doesnt exist in GMP file will crash GTA2.
- (ERROR) Missing a restart zone will give error in GTA2 and quit without crashing.
- (CRASH) SET_GANG_INFO "arrow id" value 0-7 or crash.
- (CRASH) SET_GANG_INFO crash if pointing at a zone that doesnt exist in GMP file.
- (UNEXPECTED BEHAVIOUR) SET_GANG_INFO can read only the first 4 letters from the zone name!
- (CRASH OR ERROR) SET_GANG_INFO function must be used before LEVELSTART or it will either crash or have unexpected behaviour.
- (..GUESS..) all SET_ commands must be used before LEVELSTART?
- (CRASH) GIVE_WEAPON command will crash if you try to give a weapon to a player that doesn't exist.
- (ERROR) Using gang phones (red, yellow, green) will give error on gta2.exe if they are not on a proper gang zone.
- (CRASH) Using instabomb on trucks with trailer attached in them will insta crash.
- (CRASH) Using CREATE_GENERATOR will crash the game.
- (BUGGED) CONVEYOR object max speed is 7 and min speed -7 or it bugs (x/y speeds goes at random speeds).
- (CRASH) if you add a train zone to a place which has blocks in two or more Z-Levels (not confirmed yet).
- (NO ERROR) If two objects (not cars (nor chars?)) overlap each other, one of them will get destroyed.
- (CRASH) if z-position is greater or equal to 8.0 will cause crash. Safe to use is 7.999999 max. 7.99 preferred.
- (UNEXPECTED BEHAVIOUR) dropping grenades on a conveyor which X and Y speed is set to zero will make the grenades unable to explode until you move them off the conveyor.
- (CRASH) using conveyors at the edges of the map (1 block away) may crash GTA2 if any object is moving on the conveyor and touching the map edge invisible walls. Fix: place conveyors 1 block away from the invisible wall! (or 0.5 blocks etc).
- (CRASH) using 2d coordinates on a position which has no collideable ground under it will crash GTA2.
- (CRASH) getting out of a car on a DESTRUCTOR object will crash the game.
- (CRASH) if the car explodes for any reason on a DESTRUCTOR object, the game will crash.


3) Script rules:
- (ERROR) Coordinates must always be written at least with 1 decimal precision.
- (ERROR) Declarations must always be before LEVELSTART command.
- (NO ERROR) CREATE_* commands before LEVELSTART will not be visible in GTA2.
- (ERROR) You cannot use CREATE_CAR with PARKED_CAR_DATA datatype.
- (NO ERROR) MINI_CAR must be used with CREATE_CAR command or it creates a car with trailermodel instead.
- (NO ERROR) cars with trailers must be created with CREATE_CAR command or it creates a trailer with the same model as the car.
- (ERROR) Using objects that havent been declared yet.

4) Other weirdness:
- PARKED_CAR_DATA car wrecks will disappear automatically after the wreck goes out of sight, but CAR_DATA or CREATE_CAR or CREATE_GANG_CAR wrecks will never disappear, even if they are created with CAR_DATA declaration.

--

Once i know every possibility, the editor is much nicer to use since you dont have to ponder why it doesnt work.



(moved) Current TODO list:

- SET_CAR_BULLETPROOF
- SET_CAR_FLAMEPROOF
- SET_CAR_ROCKETPROOF
- SET_CAR_EMERG_LIGHTS
- SET_CAR_NO_COLLIDE
- SET_CAR_JAMMED_ACCELERATOR
- GIVE_CAR_ALARM
- GIVE_WEAPON
- MAKE_CAR_A_DUMMY
- CHANGE_CAR_LOCK
- SET_STATION_INFO (trains visible)
- RADIO_STATION
- PERFORM_SAVE_GAME
- SET_GANG_INFO
- DECLARE_POLICELEVEL
- DECLARE_CRANE_POWERUP
- DECLARE_POWERUP_CARLIST
- DECLARE_DOOR_INFO
- ADD_PATROL_POINT
- DISPLAY_MESSAGE
- DISPLAY_BRIEF_NOW
- DISPLAY_BRIEF
- SET_CAR_NUMBER_GRAPHIC
- SET_CHAR_THREAT_SEARCH
- SET_CHAR_THREAT_REACTION
- SET_CHAR_OBJECTIVE
- DELETE_ITEM
- WARP_FROM_CAR_TO_POINT

more todo:
- conveyors/destructors width/height edit (like zone editor rectangles editing).
- render car object list. (hard to make it look good)
- render obj_data object list.
- object add from the list.
- object delete.
- object copy/paste.
- show object collision boxes by pressing space or some other button.
- fix car on trailer rotation (although i really dont care if it points at wrong direction... i find it more realistic that way anyways )
Last edited by T.M. on 03 Dec 2010, 19:02, edited 16 times in total.
User avatar
elypter
Immortal
Posts: 1119
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by elypter »

I also like this circle idea. personally i have no problem reading rotated fonts. But for 2nd and 3rd selection level i think lists are maybe better. Great variations in numbers and adding or deleting stuff can be handled better with lists.
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by BenMillard »

Your choice of categories probably won't match 80% of modders because we all think about these objects differently.

The big graphical panel, like tiles, is the best option. Just consider selecting tiles using some whacky multi-level circlular weirdness...it would suck! Don't bring that pain to objects, please.
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by Cuban-Pete »

BenMillard wrote:Your choice of categories probably won't match 80% of modders because we all think about these objects differently.

The big graphical panel, like tiles, is the best option. Just consider selecting tiles using some whacky multi-level circlular weirdness...it would suck! Don't bring that pain to objects, please.
Some more constructive criticism would also be nice...

How about this than? (icon's are not good yet and I'm also not sure if I like the orange...)
text4110_block.png
text4110_block.png (544.85 KiB) Viewed 25502 times
"Mmmm, your eyes are so beautiful."
User avatar
Sektor
Boss
Boss
Posts: 1450
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by Sektor »

I like the boxes better than the circle.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

Yeah, definitely boxes.

Also the icons are kinda unclear, the "player_ped" object has a + on top right corner, why? also what is this 3 players at bottom corner? And whats the function for the brain head? And how do you open the menu for detailed object data type?

I think the box needs to have the currently selected object data type under the icon, so when you click the data type text, you can select another type (could be like drop down box)
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by BenMillard »

Steering the project away from a crap UI before it gets made is constructive. TM could easily waste a month on this, then have to start again doing it the sensible way. Pushing for whacky visuals in desktop tools is what wastes time, effort, skill and produces a tool which is terrible for everyone trying to use it.

The left sidebar is already split into map overview and texture selector. You could have a 3rd part for objects. Menu items and keyboard shortcuts would let users switch them on/off in a fraction of a second. Scrollwheel and scrollbars to move up and down within them...simple.

Do it once, do it right!
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

What about this?

Image
MID = midgame (create_*)
STA = startgame (declaration/creation)

You can click the MID/STA to switch between the type of data.

Cars have submenu which will be opened when mouse goes over it, you can click the "Car" to create normal car, if you go to submenu and select gang car, it will display "Car (gang)" at the left side.

Note how player/crane doesnt support "CREATE_*" types. Maybe i should display the "STA" left at them too? maybe grayed out somehow..

--

What kind of other objects are there? Please list all possible object types you know this image doesnt have (bot = char)
User avatar
Pyro
Immortal
Posts: 414
Joined: 17 Mar 2010, 04:07
GH nick: Pyro
Location: Wales, UK

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by Pyro »

I suppose at the end of the day it might just be easier to do a menu on the top with Scripting > Insert > XYZ ;)

I like Cuban Pete's "cube" with the script stuff inside them though. Not sure about the orange gradient background though, but it's an early design.

TM, your idea looks a little confusing with having them seperated into STA and MID. Most declares are put before LEVELSTART anyway, but can be called later in game if needs be (classic example setting a new maximum wanted level for that level - e.g. FBI to army). Other things like scripting AI for characters and switching generators on needs to be after level start command and won't work properly if put before it.

Basically, the fewer overall categories before splitting it down the better. ;)
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

I need to make it so a newbie can make a map with cars etc, without knowing everything about scripting, but also be handy for pro users...
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by Cuban-Pete »

BenMillard wrote:Steering the project away from a crap UI before it gets made is constructive. TM could easily waste a month on this, then have to start again doing it the sensible way. Pushing for whacky visuals in desktop tools is what wastes time, effort, skill and produces a tool which is terrible for everyone trying to use it.
From what I understood, we were brainstorming for idea's and you just pop up with 'crap' and 'whacky'... that is just no proper way of communicating or be it brainstorming.
The left sidebar is already split into map overview and texture selector. You could have a 3rd part for objects. Menu items and keyboard shortcuts would let users switch them on/off in a fraction of a second. Scrollwheel and scrollbars to move up and down within them...simple.
You can still have a 'mouse menu' next to having this.
"Mmmm, your eyes are so beautiful."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

I'm now seriously thinking about the .mis2 format: i found out few fallbacks in parsing the scripts... for example the SUBROUTINES. I cant detect them! Theres no way i can tell whether or not some object is declared inside a subroutine or not. So if you use extensive amounts of subs in your scripts, theres no way of hiding the subroutines, even if they arent used in the map much... that means editing maps will become total confusion since you see everything at once.

Therefore, i must make own script language at some point.

I'm thinking to make it like C (and slightly PHP) syntax:



Code: Select all

answer_phone_2:
	WHILE(NOT(IS_CAR_CRUSHED(mission_2_car)))
		IF(IS_CAR_WRECKED(mission_2_car))
			DISPLAY_MESSAGE(1125)
			DISPLAY_BRIEF(1166)	
			SET flag_on_mission = 0
			REMOVE_ARROW(mission_2_b)
			RETURN
		ENDIF
	ENDWHILE
	IF((told_get_in_car = 0) AND (NOT(IS_CHARACTER_IN_CAR(player, mission_2_car))))
		DISPLAY_BRIEF(1167)
		SET told_get_in_car = 1
	ENDIF
RETURN

GOSUB answer_phone_2: 
->

Code: Select all

function answer_phone_2(){
	while(!IS_CAR_CRUSHED(mission_2_car)){
		if(IS_CAR_WRECKED(mission_2_car)){
			DISPLAY_MESSAGE(1125);
			DISPLAY_BRIEF(1166);
			flag_on_mission = 0;
			REMOVE_ARROW(mission_2_b);
			return;
		}
	}
	if(told_get_in_car == 0 && !IS_CHARACTER_IN_CAR(player, mission_2_car)){
		DISPLAY_BRIEF(1167);
		told_get_in_car = 1;
	}
}

answer_phone_2();
I really like the C-syntax a lot more, also you wouldnt have to call a NOT function anymore... just use "!". no nesting for IF's. No separate function call when you want to set a variable. AND etc. -> "&&". ENDIF etc. -> "}". And each line must end with ";" unless its ending with "{" or "}". Im not sure what to do with the () in the function... now its mostly there to detect function calls better.

THIS doesnt mean im making own compiler. ONLY a scripting language that can and will be converted into .mis format before compiling! The conversions should work both ways.
User avatar
Sektor
Boss
Boss
Posts: 1450
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by Sektor »

For screenshots you might not want all cars to display but they should display when editing so you can edit them. I think it would be rare for an unwanted car to appear in a screenshot.

Creating a new script format that GTA2 can't read doesn't seem very useful unless you are planning on turning your editor into a GTA2 clone.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

Sektor wrote:Creating a new script format that GTA2 can't read doesn't seem very useful unless you are planning on turning your editor into a GTA2 clone.
Maybe, but im doing this for the editor actually... so i can play around with functions. But if im going to make functions work, i need to use .mis2 extension since its not compatible with the compiler. And thus, i could as well just write completely new .mis format.

I dont know will i ever make gta2 clone, but its been on my target for a long time... always something comes to stop me :D Nevertheless, making editor fully functional is a big advantage in finishing the gta2 clone (...if i ever make the clone...).

--

I just noticed something, i cant make mis -> mis2 working automatically if theres subroutines used :x
User avatar
Sektor
Boss
Boss
Posts: 1450
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by Sektor »

Best just to read/edit the existing .mis format as good as you can. It's fine to leave features out, that's what manual editing is for.
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by BenMillard »

Don't make a .mis2 format. The problems are even more obvious and profound than extending the .mmp format.

As Sektor points out, separating subroutine objects from everything else is unnecessary. For example, respawning vehicles and vehicles tied to objectives should be visible by default in the editor and be present in screenshots of the level. Same for AI characters and OBJECT commands. Indeed, what are the advantages to hiding them? How are these so compelling we should re-write every mission script and maintain 2 versions of everything new we make? :shock:

Showing every object and ped by default has the same advantages as showing every powerup: players and modders can see everything the level has to offer.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

The advantage of functions is that i can directly see which objects are created by which function. Its not all about hiding, but also KNOWING instantly what you are editing. You have to browse the source code to see which subroutine it belongs. Its really confusing and slow process.
BenMillard
Immortal
Posts: 890
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by BenMillard »

If you display the .mis in your Viewer, clicking any scripted object could scroll to that line of the code?
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

Yeah, but you wont see more than 10 lines at once. Most subscripts are longer than 10 lines.

Also note that you will see only 5 lines before and 5 lines after the object in the .mis file when you click the object.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: TradeMark's GTA2 Map Editor (0.5.32) (Only zone editor a

Post by T.M. »

Added explosions support, looks pretty cool:

Image

8-)

--

Next release is going to be big: ~3500 new code lines written for script editor :shock:

Edit: Total 38220 lines in the whole packet now. :o
Post Reply