Collection of gta scripting and map weirdness

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: Collection of gta scripting and map weirdness

Post by T.M. »

- crane ranges are squares (instead of circles as you would think), 4 blocks away from the crane.

replace:
- "Some cars will instant crash GTA2. (eg. HOTDOG_D4)."
to:
- "(GTA2 CRASH) Cars that will insta crash GTA2: TRAINCAB, TRAIN, TRAINFB, BOXCAR, CAR9, CAR15, CAR20, CAR43."

replace:
- "Declarations must always be before LEVELSTART command."
to:
- "Declarations should always be before LEVELSTART command to avoid possible crashes."

replace:
- "Spray car shop with CREATE_OBJ will always crash compiler if using 2d coordinates."
- "Objects BIN and CAR_SHOP (spray) with CREATE_OBJ will always crash compiler if using 2d coordinates, however 255.0 makes 2d coords possible."
to:
- "(COMPILER CRASH) CREATE_OBJ using 2d coords with ammo or remap value (spray shop), will crash compiler. workaround: use 3d coords with 255.0 as z-position."

replace:
- "All car shops that were not created with CREATE_OBJ will crash compiler if using 2d coordinates or 255.0 as z-position."
to:
- "(COMPILER CRASH) Car shop (except spray shop) that was created with OBJ_DATA will crash compiler if using 2d coordinates and it is the first OBJ_DATA declaration in the script. workaround: use 3d coords with 255.0 as z-position, or move it to not be the first declaration."
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Collection of gta scripting and map weirdness

Post by T.M. »

WHAT THE FUCK!

Code: Select all

CAR_DATA auto2 = (100.50, 215.50, 255.0) 1 0 TRUKTRNS SPRITE
Equals:

Code: Select all

CAR_DATA auto1 = (100.50, 215.50, 255.0) 1 0 SPRITE
CAR_DATA auto2 = (100.50, 215.50, 255.0) 1 0 TRUKTRNS
PUT_CAR_ON_TRAILER(auto1,auto2)
CRAZY!!

it seems to work only for those 3 different trailer models, i think... need to test.

i found this on a map called "frenzy" after i decompiled the script and looked at the mis file in my editor: i spotted weird looking car combination which had a car as the trailer and the trailer as the car, but in game it wasnt looking like that at all.

Edit: Tested all cars and noticed it works only with TRUKTRNS model as the car!
Here is how it looks, see how it gives default remap for the car on top of it:
trailertrick.jpg
trailertrick.jpg (13.14 KiB) Viewed 37975 times
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Collection of gta scripting and map weirdness

Post by elypter »

thats indeed very weird
yur sa'nok ngeyä
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Collection of gta scripting and map weirdness

Post by elypter »

Pyro wrote:A few things (mostly about trailers):
  • Trailers are ignored if you use the PARKED_CAR_DATA and only shows the towing vehicle. Work around: Use CAR_DATA instead. (I know this is listed but I thought I'd expand on it a little)
  • You can make any type of vehicle have any type of trailer (such as Dementias with Tanks as a trailer) but there are some (lots!) issues:
    • Only trucks (TRUKCAB1 and TRUKCAB2) can tow most vehicles at full speed (3rd gear). Any other car is limited to 1st gear with poor acceleration and turning.
    • Depending on the vehicle towing and what vehicle you have as a trailer, sometimes the towing vehicle cannot start moving unless you turn slightly. Rarely you cannot move or turn at all (usually applies to small vehicles trying to tow big vehicles).
    • Using a big, powerful vehicle to tow a small car will make the towing vehicle extremely agile compared to normal and accelerate to top speed extremely quickly.
    • Entering any vehicle attached as a trailer will crash the game. Detach it and then enter it to work correctly.
    • If you have a towing vehicle that has a gun on it (vehicle guns, Armed Land Roamer Gun, tank gun etc) it will not detach until you switch to a non-vehicle weapon.
    • Setting the trailer type to TRAIN (train passenger carriage) will make the trailer not appear until you get in the towing vehicle. However, this trailer is extremely buggy and will crash the game randomly. Will instantly explode if it touches another car and crash the game. (Thanks to TM for the basic information while I went and tested this and other train ones as well)
    • Setting the trailer type to TRAINFB (train flat-bed) will also appear hidden until you get in the towing vehicle. Even more buggy than TRAIN as trailer.
    • Setting the trailer type to BOXCAR (train box carriage) will appear hidden until you get in the towing vehicle. Still buggy as TRAIN.
    • Setting the trailer type to TRAINCAB (the train itself) will appear hidden until you get in the towing vehicle. Will instantly crash the game when you enter though and doesn't appear anyway.
    • Towing a tank and then detaching it will make the tank roll over the towing vehicle destroying it leaving a tank above the wreck you now can't enter.
  • GIVE_WEAPON command on a vehicle ignores the amount you list and always gives +50. Work around: Either use GIVE_WEAPON command twice to get 99 ammo (sets car bomb to 1 ammo) on a vehicle or use OBJ_DATA to create specific weapon under the vehicle if you want to specify an exact amount such as 1 vehicle bomb but at the cost of hearing the voice over on picking up a weapon. (Thanks Sektor for pointing out the work around)
Quite a list about trailers :P As you can guess trailers were only meant for the Truck Cabs and specific trailer types hence all these weird issues.
about the trailer part: i cant really put that directly into the list. some of the points depend on the car handling values. that would not belong to the scripting weirdness part. a few could maybe go into a new GCI section but there are also some things that are just logical and not weird at all. like that weak cars cannot pull a trailer. These should be put in something like a tutorial. Ben has a page on his site where wants to put information like this and I have a txt file on my pc with various discoverings about how gci values cause weird things (eg negative values) btw i also made a non cab vehicle(tow truck in tiny tiny tiny town army) quite handleable for pulling trailers. these findings could be combined to a tutorial at some time (some time after my desktop pc is working again)

if you organize them like TM its much easier for me to put them into the list.
yur sa'nok ngeyä
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Collection of gta scripting and map weirdness

Post by T.M. »

- Cars HOTDOG_D1-4 will crash GTA2 after they explode into a wreck.

i wonder if its possible to make them to not crash, isnt there some way of setting which wreck a car will wreck into?
User avatar
Pyro
Immortal
Posts: 414
Joined: 17 Mar 2010, 04:07
GH nick: Pyro
Location: Wales, UK

Re: Collection of gta scripting and map weirdness

Post by Pyro »

Yeah there is quite a lot about trailers there. But you can definitely use/update the first bullet point about PARKED_CAR_DATA ignoring the trailer code as well as the last bullet point about GIVE_WEAPON too.

Still, handy reference for anyone wanting to mess more with trailers beyond their original design :P
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: Collection of gta scripting and map weirdness

Post by BenMillard »

Folding some of these findings into my tutorials would be do-able. Is any of it captured on existing GTA2 wiki websites? Perhaps this information was already published somewhere and we could simply refer to it.

Good to have a central list, even if many of the bullet points become links. (Or especially if that happens? Depends how you look at it.)
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Collection of gta scripting and map weirdness

Post by elypter »

i already wanted to do another article on this wiki:
http://en.wikigta.org/index.php/GTA2 but it is invite-only and Lantyz wasn't here for over a month or so.
yur sa'nok ngeyä
User avatar
Sektor
Boss
Boss
Posts: 1423
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: Collection of gta scripting and map weirdness

Post by Sektor »

Incomplete/broken command:

SET_CHAR_OBJECTIVE ( p1 , ENTER_TRAIN )
SET_CHAR_OBJECTIVE ( p1 , LEAVE_TRAIN )
SET_CHAR_OBJECTIVE ( p1 , ENTER_TRAIN, p1car )
SET_CHAR_OBJECTIVE ( p1 , LEAVE_TRAIN, p1car )

Unfortunately all they do is make the character face south instantly. It doesn't get on or off a train. There's a reason it wasn't in the documentation. It's still good to list the unused/incomplete commands since Vike might be able to fix them or replace them with his own burp/fart command.
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Collection of gta scripting and map weirdness

Post by T.M. »

Edit: oops, doesnt work that way

edit2: found something weird too: SWITCH_GENERATOR(gen1, ON, COLLECT_00) compiles fine but doesnt seem to do anything with the COLLECT_00, the output is same as without it, but compiler wont accept anything other than object type for there...

edit3: yeah, would be cool to create it already on state, i tried to twiddle with the SCR data but no success.

i also tried to manually make these work: CREATE_CONVEYOR, CREATE_GENERATOR, CREATE_DESTRUCTOR, but no success, create_generator crashed gta2, others just didnt do anything in game.
Last edited by T.M. on 13 Nov 2011, 19:28, edited 2 times in total.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Collection of gta scripting and map weirdness

Post by elypter »

would be great if you could define it in an already on state
yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: Collection of gta scripting and map weirdness

Post by BenMillard »

Maybe split a couple of the recent messages to the decompiler thread, leaving short summaries behind?
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Collection of gta scripting and map weirdness

Post by T.M. »

- CHECK_CAR_SPEED can take negative values as well, using -1 will trigger it instantly when you get inside the car.

- CHANGE_INTENSITY takes integer value, not floats.
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Collection of gta scripting and map weirdness

Post by elypter »

T.M. wrote:- CHECK_CAR_SPEED can take negative values as well, using -1 will trigger it instantly when you get inside the car.
added
T.M. wrote: - CHANGE_INTENSITY takes integer value, not floats.
thats a doc error. if you tell ben he probably fixes it.
yur sa'nok ngeyä
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Collection of gta scripting and map weirdness

Post by T.M. »

thats a doc error. if you tell ben he probably fixes it.
where is this so called fixed doc thread??
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Collection of gta scripting and map weirdness

Post by elypter »

yur sa'nok ngeyä
BenMillard
Immortal
Posts: 889
Joined: 16 May 2009, 06:14
GH nick: BenMillard
Location: London, UK
Contact:

Re: Collection of gta scripting and map weirdness

Post by BenMillard »

Yes, I do want that to be the best summary of every command you can use in GTA2 mission scripting. But only a summary. For detailed explanations, it's better to link to other pages. (Already done for a few things.)

Navigation within the document will get a lot better over time. Such as the linked lists of commands at the start of each major section. Re-arranging the sections to match the Table of Contents.

It's a lot of boring text editor work. But I do intend to complete it...eventually!
User avatar
T.M.
Immortal
Posts: 960
Joined: 29 Jan 2010, 15:00
Location: F21B3EED

Re: Collection of gta scripting and map weirdness

Post by T.M. »

checked some of the objects that i didnt have syntax highlighting in my editor:

- MOLOTOV_MOVING object explodes instantly (can hurt player). same functionality as EXPLODE_SMALL(x,y,z) function except you can use MOLOTOV_MOVING as a generator object too!
- GRENADE object doesnt fall down and explodes after some delay (can hurt player).
- ROCKET and PISTOL_BULLET objects will shoot at that object direction. (can hurt player).
- TASER_BULLET object will shoot pistol-looking bullet but it doesnt hurt player.
- SHOT object creates pistol/machinegun etc. bullet spark 2 blocks forward from the placed position at the direction it was set. (can hurt player).
- SPARK object will create blue version of BLOOD_SPARK object.

GRENADE/ROCKET was already highlighted but i added them just to know what other same style objects there are. im not sure if thats all of them, might be more.

i was surprised that "SHOT" (which shows as a spark) can kill player! (if you spam many of them on the player)
User avatar
Cuban-Pete
Immortal
Posts: 909
Joined: 29 Jan 2010, 15:03
GH nick: Cuban-Pete

Re: Collection of gta scripting and map weirdness

Post by Cuban-Pete »

Indirect bullet damage in a game from 1999, awesome!
"Mmmm, your eyes are so beautiful."
User avatar
elypter
Immortal
Posts: 1120
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: Collection of gta scripting and map weirdness

Post by elypter »

that has probbly just been added for the case that players are too close for a bullet to appear
yur sa'nok ngeyä
Post Reply