|
 |
|
|
|
|
|
Attention:
MISSION CODING 3 - for all post beta code official main.scm discussion, releases
 |
|
 |
| |
Demarest  |
|
what could be

Group: BUSTED!
Joined: Jul 12, 2003

|
| QUOTE (CraigKostelecky @ Jun 3 2004, 19:58) | | Do you know who actor 0667 is? That may help to answer why that flag is always doubling. |
I don't know what it is, but it's always doubling because each step indicates the next bit in binary. It's a great way to get a lot of information into a single/few bytes if you can afford the routines to pack/unpack it. | QUOTE (TbM2k @ Jun 3 2004, 22:22) | | PS: It's the Actor you are "hunting"... I made the tires invulnerable, but you have to test if it's working ok... |
I'm going to make part of the environmental threads check to see if you're driving a new car and if so, make the tires unpoppable. Perhaps even only turn on that particular thread if the master key for pure mode is off. Is it possible for different threads to refer to the same car without the engine freezing? | QUOTE (CraigKostelecky @ Jun 4 2004, 02:44) | | And I updated the emergency crane so it accepts the Barracks OL and it pays you $200,000 per vehicle collected (just like in GTA3) |
Just like LC = GTA3 -350X, LC$ = GTA3$ /10. | QUOTE (CraigKostelecky @ Jun 4 2004, 02:44) | | EDIT: I may have found a bug in the I/E code, but I cannot see where the error is in the code. But on two occasions, after delilvering 3 vehicles, the garage would not accept any more cars on the list. The door will still open, but the player would not exit out of the car. Manually getting out and leaving the garage doesn't solve anything, because the fuction isn't called unless the player is forced out of the car and the garage. Looking at the code there should be no reason that the player would not exit the car after the garage door has been opened. |
Use my updated code and see if you get the same thing. When tweaking it, I found quite a few holes. In fact, prior to finding one major one in my own tweaking, the code was actually about 50 lines shorter. Okay, onto TwoZero's Portland IE_Garage. I revamped it. While it is 560 lines compared to his 562, he was missing quite a few key lines. Either way, this tweaked version weighs in at 18 less global vars and behaves MUCH more like the GTA3 garage. @2-0: I'm not hijacking your work, just tweaking it. You can test it and make any revisions you'd like. Just know that with any code, I will be approving it. I'll post the code, then my comments specific to the code before/after, and then my critique of your general coding technique | CODE | :LCIEGARAGEPORTLAND 03A4: name thread "IMPORT1" 0004: $IE_PORT_TOTAL = 0? \\ integer values 0004: $IE_IMPORT_CAR = 0? \\ integer values 0004: $IE_IMPORT_CAR_1 = 0? \\ integer values 0004: $IE_IMPORT_CAR_2 = 0? \\ integer values 0004: $IE_IMPORT_CAR_3 = 0? \\ integer values 0004: $IE_IMPORT_CAR_4 = 0? \\ integer values 0004: $IE_IMPORT_CAR_5 = 0? \\ integer values 0004: $IE_IMPORT_CAR_6 = 0? \\ integer values 0004: $IE_IMPORT_CAR_7 = 0? \\ integer values 0004: $IE_IMPORT_CAR_8 = 0? \\ integer values 0004: $IE_IMPORT_CAR_9 = 0? \\ integer values 0004: $IE_IMPORT_CAR_10 = 0? \\ integer values 0004: $IE_IMPORT_CAR_11 = 0? \\ integer values 0004: $IE_IMPORT_CAR_12 = 0? \\ integer values 0004: $IE_IMPORT_CAR_13 = 0? \\ integer values 0004: $IE_IMPORT_CAR_14 = 0? \\ integer values 0004: $IE_IMPORT_CAR_15 = 0? \\ integer values 0004: $IE_IMPORT_CAR_16 = 0? \\ integer values 021B: set garage $IE_GARAGE_PORT to accept car 181&
:IE_IMPORT_START 0001: wait 500& ms 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 00D6: if 1? 0056: player $PLAYER_CHAR 0? ()in_rectangle 1145.768! -686.3843! 1139.719! -675.7012! 00E0: player $PLAYER_CHAR driving 004D: jump if false ££IE_IMPORT_START 03C1: $IE_IMPORT_CAR = player $PLAYER_CHAR car
:IE_IMPORT_CHECK_1 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 143& 004D: jump if false ££IE_IMPORT_CHECK_2 00D6: if 0? 0039: 0@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 0@ = 1? 029B: $IE_PORT_CAR_1 = init object -32? (LINE) at 1146! -675.4375! 12.125! 0453: object $IE_PORT_CAR_1 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_2 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 170& 004D: jump if false ££IE_IMPORT_CHECK_3 00D6: if 0? 0039: 1@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 1@ = 1? 029B: $IE_PORT_CAR_2 = init object -32? (LINE) at 1146! -675.4375! 12.3125! 0453: object $IE_PORT_CAR_2 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_3 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 161& 004D: jump if false ££IE_IMPORT_CHECK_4 00D6: if 0? 0039: 2@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 2@ = 1? 029B: $IE_PORT_CAR_3 = init object -32? (LINE) at 1146! -675.4375! 12.5! 0453: object $IE_PORT_CAR_3 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_4 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 194& 004D: jump if false ££IE_IMPORT_CHECK_5 00D6: if 0? 0039: 3@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 3@ = 1? 029B: $IE_PORT_CAR_4 = init object -32? (LINE) at 1146! -675.4375! 12.75! 0453: object $IE_PORT_CAR_4 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_5 0001: wait 0? ms 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 152& 004D: jump if false ££IE_IMPORT_CHECK_6 00D6: if 0? 0039: 4@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 4@ = 1? 029B: $IE_PORT_CAR_5 = init object -32? (LINE) at 1146! -675.4375! 12.9375! 0453: object $IE_PORT_CAR_5 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_6 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 186& 004D: jump if false ££IE_IMPORT_CHECK_7 00D6: if 0? 0039: 5@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 5@ = 1? 029B: $IE_PORT_CAR_6 = init object -32? (LINE) at 1146! -675.4375! 13.125! 0453: object $IE_PORT_CAR_6 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_7 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 144& 004D: jump if false ££IE_IMPORT_CHECK_8 00D6: if 0? 0039: 6@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 6@ = 1? 029B: $IE_PORT_CAR_7 = init object -32? (LINE) at 1146! -675.4375! 13.375! 0453: object $IE_PORT_CAR_7 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_8 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 226& 004D: jump if false ££IE_IMPORT_CHECK_9 00D6: if 0? 0039: 7@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 7@ = 1? 029B: $IE_PORT_CAR_8 = init object -32? (LINE) at 1146! -675.4375! 13.5625! 0453: object $IE_PORT_CAR_8 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_9 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 153& 004D: jump if false ££IE_IMPORT_CHECK_10 00D6: if 0? 0039: 8@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 8@ = 1? 029B: $IE_PORT_CAR_9 = init object -32? (LINE) at 1146! -674.5625! 12.125! 0453: object $IE_PORT_CAR_9 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_10 0001: wait 0? ms 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 200& 004D: jump if false ££IE_IMPORT_CHECK_11 00D6: if 0? 0039: 9@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 9@ = 1? 029B: $IE_PORT_CAR_10 = init object -32? (LINE) at 1146! -674.5625! 12.3125! 0453: object $IE_PORT_CAR_10 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_11 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 138& 004D: jump if false ££IE_IMPORT_CHECK_12 00D6: if 0? 0039: 10@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 10@ = 1? 029B: $IE_PORT_CAR_11 = init object -32? (LINE) at 1146! -674.5625! 12.5! 0453: object $IE_PORT_CAR_11 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_12 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 133& 004D: jump if false ££IE_IMPORT_CHECK_13 00D6: if 0? 0039: 11@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 11@ = 1? 029B: $IE_PORT_CAR_12 = init object -32? (LINE) at 1146! -674.5625! 12.75! 0453: object $IE_PORT_CAR_12 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_13 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 185& 004D: jump if false ££IE_IMPORT_CHECK_14 00D6: if 0? 0039: 12@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 12@ = 1? 029B: $IE_PORT_CAR_13 = init object -32? (LINE) at 1146! -674.5625! 12.9375! 0453: object $IE_PORT_CAR_13 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_14 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 167& 004D: jump if false ££IE_IMPORT_CHECK_15 00D6: if 0? 0039: 13@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 13@ = 1? 029B: $IE_PORT_CAR_14 = init object -32? (LINE) at 1146! -674.5625! 13.125! 0453: object $IE_PORT_CAR_14 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_15 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 148& 004D: jump if false ££IE_IMPORT_CHECK_16 00D6: if 0? 0039: 14@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 14@ = 1? 029B: $IE_PORT_CAR_15 = init object -32? (LINE) at 1146! -674.5625! 13.375! 0453: object $IE_PORT_CAR_15 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_16 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 158& 004D: jump if false ££IE_NOT_NEEDED 00D6: if 0? 0039: 15@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 0004: 15@ = 1? 029B: $IE_PORT_CAR_15 = init object -32? (LINE) at 1146! -674.5625! 13.5625! 0453: object $IE_PORT_CAR_15 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_DOOR 021B: set garage $IE_GARAGE_PORT to accept car $IE_IMPORT_CAR
:IE_IMPORT_GARAGE 0001: wait 100? ms 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_GARAGERETURN 00D6: if 1? 00B0: $IE_IMPORT_CAR 0? ()in rectangle 1146.1! -667.75! 1173! -685.68! 80B0: NOT $IE_IMPORT_CAR 0? ()in rectangle 1147! -686.3843! 1139.719! -675.7012! 004D: jump if false ££IE_IMPORT_GARAGERETURN 00D6: if 1? 8056: NOT player $PLAYER_CHAR 0? ()in_rectangle 1146.1! -667.75! 1173! -685.68! 8056: NOT player $PLAYER_CHAR 0? ()in_rectangle 1147! -686.3843! 1139.719! -675.7012! 004D: jump if false ££IE_IMPORT_GARAGE 01B4: set player $PLAYER_CHAR frozen state 0? (frozen) 0361: close_garage $IE_GARAGE_PORT 0008: $IE_PORT_TOTAL += 1? \\ integer values 030C: set mission points += 1? 0109: player $PLAYER_CHAR money += 100? 01C3: remove references to car $IE_IMPORT_CAR
:IE_IMPORT_GARAGERETURN 0051: return
:IE_IMPORT_ENOUGH 00BC: text highpriority "IMPORT5" 4000& ms 1? \\We got more of those then we can shift. Sorry man, no deal. 0002: jump ££IE_IMPORT_GET_AWAY
:IE_NOT_NEEDED 00BC: text highpriority "IMPORT2" 2000& ms 1? \\We are not interested in that model 0002: jump ££IE_IMPORT_GET_AWAY
:IE_IMPORT_GET_AWAY 0001: wait 500& ms 00D6: if 0? 0056: player $PLAYER_CHAR 0? ()in_rectangle 1147! -687! 1139! -675! 004D: jump if false ££IE_IMPORT_START 0002: jump ££IE_IMPORT_GET_AWAY
:IE_IMPORT_END 0001: wait 0? ms 00D6: if 0? 001A: 16? > $IE_PORT_TOTAL \\ integer values 004D: jump if false ££IE_IMPORT_ENDFINAL 00BC: text highpriority "IMPORT3" 3000& ms 1? \\Delivered like a pro. Complete the list and there'll be a bonus for you. 021B: set garage $IE_GARAGE_PORT to accept car 181& 01B4: set player $PLAYER_CHAR frozen state 1? (unfrozen) 0002: jump ££IE_IMPORT_START
:IE_IMPORT_ENDFINAL 00BC: text highpriority "IMPORT4" 5000& ms 1? \\All the cars. NICE! Here's a little something. 0109: player $PLAYER_CHAR money += 20000& 02FA: garage $IE_GARAGE_PORT change to type 23? 03DA: set garage $IE_GARAGE_PORT camera follows player 0360: open garage $IE_GARAGE_PORT
:IE_EXPORT_LOOP 0001: wait 500& ms 00D6: if 0? 0056: player $PLAYER_CHAR 0? ()in_rectangle 1130! -700! 1173! -667.75! 004D: jump if false ££IE_EXPORT_LOOP 0518: 0@ = create available asset pickup "PONY" at 1149! -669! 12.14! price 0? 0518: 1@ = create available asset pickup "RUMPO" at 1153.2! -669! 12.14! price 0? 0518: 2@ = create available asset pickup "BUS" at 1157.4! -669! 12.14! price 0? 0518: 3@ = create available asset pickup "RCBARON" at 1161.6! -669! 12.14! price 0? 0518: 4@ = create available asset pickup "BOBCAT" at 1165.8! -669! 12.14! price 0? 0518: 5@ = create available asset pickup "YANKEE" at 1170! -669! 12.14! price 0? 0518: 6@ = create available asset pickup "MULE" at 1170! -672! 12.14! price 0? 0518: 7@ = create available asset pickup "BLISTAC" at 1170! -675! 12.14! price 0? 0518: 8@ = create available asset pickup "WHOOPEE" at 1170! -678! 12.14! price 0? 0518: 9@ = create available asset pickup "PATRIOT" at 1170! -681! 12.14! price 0? 0518: 10@ = create available asset pickup "TRASHM" at 1170! -684! 12.14! price 0? 0518: 11@ = create available asset pickup "LINERUN" at 1165.8! -684! 12.14! price 0? 0518: 12@ = create available asset pickup "FLATBED" at 1161.6! -684! 12.14! price 0? 0518: 13@ = create available asset pickup "COACH" at 1157.4! -684! 12.14! price 0? 0518: 14@ = create available asset pickup "MOONBM" at 1153.2! -684! 12.14! price 0? 0518: 15@ = create available asset pickup "SECURI" at 1149! -684! 12.14! price 0?
:IE_EXPORT_ACTIVATED 0001: wait 250& ms 00D6: if 0? 8214: NOT pickup 0@ picked up 004D: jump if false ££IE_PICKUP_PORT_1 00D6: if 0? 8214: NOT pickup 1@ picked up 004D: jump if false ££IE_PICKUP_PORT_2 00D6: if 0? 8214: NOT pickup 2@ picked up 004D: jump if false ££IE_PICKUP_PORT_3 00D6: if 0? 8214: NOT pickup 3@ picked up 004D: jump if false ££IE_PICKUP_PORT_4 00D6: if 0? 8214: NOT pickup 4@ picked up 004D: jump if false ££IE_PICKUP_PORT_5 00D6: if 0? 8214: NOT pickup 5@ picked up 004D: jump if false ££IE_PICKUP_PORT_6 0001: wait 0? ms 00D6: if 0? 8214: NOT pickup 6@ picked up 004D: jump if false ££IE_PICKUP_PORT_7 00D6: if 0? 8214: NOT pickup 7@ picked up 004D: jump if false ££IE_PICKUP_PORT_8 00D6: if 0? 8214: NOT pickup 8@ picked up 004D: jump if false ££IE_PICKUP_PORT_9 00D6: if 0? 8214: NOT pickup 9@ picked up 004D: jump if false ££IE_PICKUP_PORT_10 00D6: if 0? 8214: NOT pickup 10@ picked up 004D: jump if false ££IE_PICKUP_PORT_11 00D6: if 0? 8214: NOT pickup 11@ picked up 004D: jump if false ££IE_PICKUP_PORT_12 0001: wait 0? ms 00D6: if 0? 8214: NOT pickup 12@ picked up 004D: jump if false ££IE_PICKUP_PORT_13 00D6: if 0? 8214: NOT pickup 13@ picked up 004D: jump if false ££IE_PICKUP_PORT_14 00D6: if 0? 8214: NOT pickup 14@ picked up 004D: jump if false ££IE_PICKUP_PORT_15 00D6: if 0? 8214: NOT pickup 15@ picked up 004D: jump if false ££IE_PICKUP_PORT_16 00D6: if 0? 8056: NOT player $PLAYER_CHAR 0? ()in_rectangle 1130! -700! 1173! -667.75! 004D: jump if false ££IE_EXPORT_ACTIVATED 0050: gosub ££IE_EXPORT_DESTROY 0002: jump ££IE_EXPORT_LOOP
:IE_PICKUP_PORT_1 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 143& \\ integer values \\Pony 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_2 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 170& \\ integer values \\Rumpo 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_3 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 161& \\ integer values \\Bus 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_4 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 194& \\ integer values \\Dodo 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_5 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 152& \\ integer values \\Bobcat 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_6 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 186& \\ integer values \\Yankee 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_7 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 144& \\ integer values \\Mule 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_8 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 226& \\ integer values \\Blista Compact (Blista) 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_9 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 153& \\ integer values \\Mr. Whoopee 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_10 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 200& \\ integer values \\Patriot 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_11 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 138& \\ integer values \\Trashmaster 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_12 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 133& \\ integer values \\Linerunner 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_13 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 185& \\ integer values \\Flatbed 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_14 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 167& \\ integer values \\Coach 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_15 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 148& \\ integer values \\Moonbeam 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_16 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 158& \\ integer values \\Securicar
:IE_CAR_REQ_PORT 00BC: text highpriority "IMPORT1" 5000& ms 2? \\Go outside and wait for your vehicle.
:IE_OUTSIDE_CHECK 0001: wait 100? ms 00D6: if 0? 8056: NOT player $PLAYER_CHAR 0? ()in rectangle 1145! -667.75! 1173! -685.68! 004D: jump if false ££IE_OUTSIDE_CHECK 0361: close garage $IE_GARAGE_PORT 01B4: set player $PLAYER_CHAR frozen state 0? (frozen) 0247: request model 0@ 038B: load requested models
:IE_CAR_SPAWN_PORT 0001: wait 0? ms 00D6: if 0? 0248: model 0@ available 004D: jump if false ££IE_CAR_SPAWN_PORT 00A5: 1@ = create car 0@ at 1161.19! -676.138! 12.14! 0175: set_car 1@ z_angle_to 90! 0249: release model 0@ 0360: open garage $IE_GARAGE_PORT 01B4: set player $PLAYER_CHAR frozen state 1? (unfrozen) 01C3: remove references to car 1@
:IE_CAR_PICK_IT_UP 0001: wait 100? ms 00D6: if 0? 8056: NOT player $PLAYER_CHAR 0? ()in_rectangle 1130! -700! 1173! -667.75! 004D: jump if false ££IE_CAR_PICK_IT_UP 0002: jump ££IE_EXPORT_LOOP
:IE_EXPORT_DESTROY 0215: destroy_pickup 0@ 0215: destroy_pickup 1@ 0215: destroy_pickup 2@ 0215: destroy_pickup 3@ 0215: destroy_pickup 4@ 0215: destroy_pickup 5@ 0215: destroy_pickup 6@ 0215: destroy_pickup 7@ 0215: destroy_pickup 8@ 0215: destroy_pickup 9@ 0215: destroy_pickup 10@ 0215: destroy_pickup 11@ 0215: destroy_pickup 12@ 0215: destroy_pickup 13@ 0215: destroy_pickup 14@ 0215: destroy_pickup 15@ 0051: return | specific advice: You didn't define all global vars in the opening of the thread. Not doing so CAN crash the engine. I pushed back giving the player's car a name until in fact it was needed for the garage to start thinking about it. Rather than have a series of 16 ifs checking the ID of the car prior to putting it in and then again to figure out which map mod to incite, once it has determined the ID, it gosubs to the accept car routine so that upon routine, it can just incite the map mod. The ONLY reason this kind of sucks is in the event of somebody blowing up once inside the garage. Henece the player defined check after each such return. This wasn't needed in your code, but the way I made it will behave like GTA3's garage. When possible, I reset the garage's accept car value to one not controllable by the player to help avoid the garage opening even when it shouldn't. I didn't fully understand the need for the timer variable. It could've probably been done cleaner with 16@ or 17@ as they themselves are internal timers. Either way, that routine had nothing to do with GTA3 authentic execution, so I eliminated it anyways. Cash awards were included in the amount of GTA3$ /10 as is the system for LC due to engine limitations. If Hammer can address those though, we can revert cash to be GTA3 authentic as well. Also, the GXT entry for a single turn in does NOT display for the final car, so I made the GXT display come after the determination as to whether it was the 16th car or not. Also, when getting the "no deal" or "model not needed" messages, I threw it into a small routine to check for you to leave. Your technique would've continuously put that text on screen for as long as they sat there. Not sure how important it would've been, but your code didn't remove reference to the 16th car. Because once you reach the export section, the need for the local var flags is no more, I recycled them to be the pickup names. This frees up 16 global vars all at once (very useful). While the total of this code is untested, I HAVE verified that local vars can be used for asset pickups. I wanted to commend you on the choice of asset pickups as they include a free GXT pop-up courtesy of the engine. Nice workaround for the lack of hard-coded pickup names  Also, total amount of pickups in the game IS limited, though that limit MAY only apply to ones assigned global vars for names. Even sitll, I changed the routine to become timed tighter as well as only produce the pickups when you're nearby. This MAY free up engine resources. If nothing else, your reproducing of the pickup was innacurate (allowable since it's a triggered pickup) and not GTA3 authentic at all as once you pick up one, they are all destroyed. So I redid the entire icon scheme to be made when you enter the area and killed when you pick one up. Since between those times, the local vars are not used, I recycled them again in the car creation routine, freeing up 2 more global vars. Hopefully you can see how such trims as well as the use of well place subroutines, inverted conditionals, and trap loops can make the mod better/cleaner. The only problem I know of the way the code is written is: Once the door opens to accept a car, if ANYTHING happens between then and the actual acceptance of the car (such as dieing, driving away with the car anyways), the garage will be left in an accept that vehicle mode until told to accept a different vehicle. This won't matter in terms of execution, but is nonetheless the one flaw in the code. It would take a total reworking of the code to fix. Not worth it. general coding advice: (this is meant to help you as a coder, as the above was) You need to use a player defined check before addressing the player in a block of code. Usually doesn't matter, but IS more "professional". You don't need a space before strings such as $var, but you do in front of positive numbers. When you're checking an integer that you're incrementing, rather than checking to see if it equals the total, you should use greater than to see if it equals that or greater than. That way if there's an error in the code, it will still get diverted instead of totally passing by the target amount. There might be more, but I don't remember right now. Oh, the IEGarage would accept cars on SOME missions. Instead of getting into complicated checks, we should probably throw in a $ONMISSION = 1? check in the beginning of the import loop just to be safe. I do believe that if your wanted level was too high, it would tell you to come back or something. I'll look into it. That's easier than the job thing in terms of consistency.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
TwoZero  |
|
Ghetto Star

Group: The Connection
Joined: Apr 15, 2003



|
| QUOTE (Demarest @ Jun 4 2004, 20:48) | | Okay, onto TwoZero's Portland IE_Garage. I revamped it. While it is 560 lines compared to his 562, he was missing quite a few key lines. Either way, this tweaked version weighs in at 18 less global vars and behaves MUCH more like the GTA3 garage. @2-0: I'm not hijacking your work, just tweaking it. You can test it and make any revisions you'd like. Just know that with any code, I will be approving it. I'll post the code, then my comments specific to the code before/after, and then my critique of your general coding technique |
I don't mind it at all, I haven't made much of my coding for public and I can learn something from the proffesional  . I hope your advice will improve my coding. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | specific advice: You didn't define all global vars in the opening of the thread. Not doing so CAN crash the engine. |
I do know that but sometimes when I edit a code a lot I just forget to define them at the beginning or I edit them out and later put it back in and forget to define it again. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | I pushed back giving the player's car a name until in fact it was needed for the garage to start thinking about it. Rather than have a series of 16 ifs checking the ID of the car prior to putting it in and then again to figure out which map mod to incite, once it has determined the ID, it gosubs to the accept car routine so that upon routine, it can just incite the map mod. |
I did figure for a second how I could to the car storing later but I thought 'that can be done later' and I did't really thought about it anymore. I never used Gosub and I have absolutly no expirence with it so I had no idea what kind of result it could have. Now I know that it can be quite usefull and will look into it how it works etc. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | The ONLY reason this kind of sucks is in the event of somebody blowing up once inside the garage. Henece the player defined check after each such return. This wasn't needed in your code, but the way I made it will behave like GTA3's garage. When possible, I reset the garage's accept car value to one not controllable by the player to help avoid the garage opening even when it shouldn't. |
That really a nice solution you thought out there. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | I didn't fully understand the need for the timer variable. It could've probably been done cleaner with 16@ or 17@ as they themselves are internal timers. Either way, that routine had nothing to do with GTA3 authentic execution, so I eliminated it anyways. |
I will explain why I did that and then you know that there's a bug in your code. The code checks if you are in front of the garage. It will execpt your car if it's on the list and not brought in before. So the garage is set to accept your car and a check starts running if you are inside the garage. Here I started my timer, because What if you drive of and decide not to bring in the car? then that rectangle loop will run forever and ever. If you return later with a other car then it won't be accepted because it's still running the rectangle check. As far as I understand your code it has that bug. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | Cash awards were included in the amount of GTA3$ /10 as is the system for LC due to engine limitations. If Hammer can address those though, we can revert cash to be GTA3 authentic as well. Also, the GXT entry for a single turn in does NOT display for the final car, so I made the GXT display come after the determination as to whether it was the 16th car or not. Also, when getting the "no deal" or "model not needed" messages, I threw it into a small routine to check for you to leave. Your technique would've continuously put that text on screen for as long as they sat there. |
I must say that the last time I played GTA3 was more then a year ago and I don't really remember how everything went. I am planning on playing it again but I have been really busy. So I don't really know how it went in GTA3. I was happy with the GXT in my part the loop just pauses for a few seconds so the loop won't start right after the text is printed on the screen, most people leave within a few seconds. But your code is good to I think I use that one. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | Not sure how important it would've been, but your code didn't remove reference to the 16th car. Because once you reach the export section, the need for the local var flags is no more, I recycled them to be the pickup names. This frees up 16 global vars all at once (very useful). |
As I said before I never used local vars in a code before so it was all new to me. I'm glad that you showed me some ways of using and reusing it. Exctually the last time I coded something like this it was almost 8 months ago and back then the Local vars weren't that populair but I can see the many advatages of them now. | QUOTE (Demarest @ Jun 4 2004, 20:48) | I wanted to commend you on the choice of asset pickups as they include a free GXT pop-up courtesy of the engine. Nice workaround for the lack of hard-coded pickup names |
Thank you. I figured it out while I couldn't sleep and I was thinking about how I could do that without making new gxt entries and stuff and then I fall asleep and the next moring I knew how to do it so thank the Sandman for not showing up. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | Also, total amount of pickups in the game IS limited, though that limit MAY only apply to ones assigned global vars for names. Even sitll, I changed the routine to become timed tighter as well as only produce the pickups when you're nearby. This MAY free up engine resources. |
As you might have noticed by now I'm not very good in saving resources  but I will improve! | QUOTE (Demarest @ Jun 4 2004, 20:48) | | If nothing else, your reproducing of the pickup was innacurate (allowable since it's a triggered pickup) and not GTA3 authentic at all as once you pick up one, they are all destroyed. So I redid the entire icon scheme to be made when you enter the area and killed when you pick one up. |
I didn't really know how that went in GTA3 and I got no complains about it after the beta release I thought I did it ok. I guess not. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | Since between those times, the local vars are not used, I recycled them again in the car creation routine, freeing up 2 more global vars. Hopefully you can see how such trims as well as the use of well place subroutines, inverted conditionals, and trap loops can make the mod better/cleaner. |
I see it very clear now thank you  . | QUOTE (Demarest @ Jun 4 2004, 20:48) | | The only problem I know of the way the code is written is: Once the door opens to accept a car, if ANYTHING happens between then and the actual acceptance of the car (such as dieing, driving away with the car anyways), the garage will be left in an accept that vehicle mode until told to accept a different vehicle. This won't matter in terms of execution, but is nonetheless the one flaw in the code. It would take a total reworking of the code to fix. Not worth it. |
As I commented on your question about the timer, I tried to prevent these things from happening. With the timer check I can also inculde a Death check and more. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | general coding advice: (this is meant to help you as a coder, as the above was) You need to use a player defined check before addressing the player in a block of code. Usually doesn't matter, but IS more "professional". You don't need a space before strings such as $var, but you do in front of positive numbers. When you're checking an integer that you're incrementing, rather than checking to see if it equals the total, you should use greater than to see if it equals that or greater than. That way if there's an error in the code, it will still get diverted instead of totally passing by the target amount. There might be more, but I don't remember right now. |
I really apriciate it that you take your time to explain everything and learn people what they do wrong. I really learned from all this and will pay much more attention to defining, checking, code saveing, crash prevention etc. | QUOTE (Demarest @ Jun 4 2004, 20:48) | | Oh, the IEGarage would accept cars on SOME missions. Instead of getting into complicated checks, we should probably throw in a $ONMISSION = 1? check in the beginning of the import loop just to be safe. I do believe that if your wanted level was too high, it would tell you to come back or something. I'll look into it. That's easier than the job thing in terms of consistency. |
I thought about that to and I think you shouldn't be able to use it in any way during missions. It would be very unfair if you have a escape mission and you could just get a dodo out of the garge. But ofcourse make it like GTA3  . at leat I toke over your posting style  . btw. could you split it up in paragraphs the next time? This is kind of long to read at once. This post has been edited by TwoZero on Friday, Jun 4 2004, 20:02
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
Demarest  |
Posted: Saturday, Jun 5 2004, 01:42
|
what could be

Group: BUSTED!
Joined: Jul 12, 2003

|
| QUOTE (Samutz @ Jun 4 2004, 14:11) | Needs to be replaced with:
| CODE | | 0010: 2208?? *= 100& \\ integer values |
|
Or | CODE | | 0010: 2208?? *= 100? \\ integer values |
 | QUOTE (CraigKostelecky @ Jun 4 2004, 14:39) | | I forgot about that money conversion as well. I'm giving out $200,000 per car with my crane. I'll update the code shortly and repost. (There may also be one or two gxt entries to update, but I gotta check on that) |
Actually, since your code was based on 2-0's, do you mind posting the source so I can peek at it? Maybe it can be tweaked in a similar manner. | QUOTE (CraigKostelecky @ Jun 4 2004, 16:07) | | I've found a problem with Demarest's I/E code. When I drive up with a car that's on the list, the door opens, but the text says "Delivered like a pro..." and it crosses off the vehicle (I haven't even entered the garage yet) and then it immediately says, "We've got more of these..." So while it accepts the car, the player never has to give it up. |
Here's updated code. I've added the flag for car being accepted as I should have earlier. Plus I changed the vehicle position check in the IE_IMPORT_DOOR subroutine to check within total rectangle to stay in the subroutine and then NOT within the garage door open rectangle to not trigger the delivery yet. Before, it kept pulling out of the subroutine way too early when it shouldn't have. Let me know if this version works. | CODE | :LCIEGARAGEPORTLAND 03A4: name thread "IMPORT1" 0004: $IE_PORT_TOTAL = 0? \\ integer values 0004: $IE_IMPORT_CAR = 0? \\ integer values 0004: $IE_IMPORT_CAR_ACCEPTED = 0? \\ integer values 0004: $IE_IMPORT_CAR_1 = 0? \\ integer values 0004: $IE_IMPORT_CAR_2 = 0? \\ integer values 0004: $IE_IMPORT_CAR_3 = 0? \\ integer values 0004: $IE_IMPORT_CAR_4 = 0? \\ integer values 0004: $IE_IMPORT_CAR_5 = 0? \\ integer values 0004: $IE_IMPORT_CAR_6 = 0? \\ integer values 0004: $IE_IMPORT_CAR_7 = 0? \\ integer values 0004: $IE_IMPORT_CAR_8 = 0? \\ integer values 0004: $IE_IMPORT_CAR_9 = 0? \\ integer values 0004: $IE_IMPORT_CAR_10 = 0? \\ integer values 0004: $IE_IMPORT_CAR_11 = 0? \\ integer values 0004: $IE_IMPORT_CAR_12 = 0? \\ integer values 0004: $IE_IMPORT_CAR_13 = 0? \\ integer values 0004: $IE_IMPORT_CAR_14 = 0? \\ integer values 0004: $IE_IMPORT_CAR_15 = 0? \\ integer values 0004: $IE_IMPORT_CAR_16 = 0? \\ integer values 021B: set garage $IE_GARAGE_PORT to accept car 181&
:IE_IMPORT_START 0001: wait 500& ms 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_START 00D6: if 0? 0038: $ONMISSION == 0? \\ integer values 004D: jump_if_false ££IE_IMPORT_START 00D6: if 1? 0056: player $PLAYER_CHAR 0? ()in_rectangle 1145.768! -686.3843! 1139.719! -675.7012! 00E0: player $PLAYER_CHAR driving 004D: jump if false ££IE_IMPORT_START 03C1: $IE_IMPORT_CAR = player $PLAYER_CHAR car
:IE_IMPORT_CHECK_1 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 143& 004D: jump if false ££IE_IMPORT_CHECK_2 00D6: if 0? 0039: 0@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 0@ = 1? 029B: $IE_PORT_CAR_1 = init object -32? (LINE) at 1146! -675.4375! 12.125! 0453: object $IE_PORT_CAR_1 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_2 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 170& 004D: jump if false ££IE_IMPORT_CHECK_3 00D6: if 0? 0039: 1@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 1@ = 1? 029B: $IE_PORT_CAR_2 = init object -32? (LINE) at 1146! -675.4375! 12.3125! 0453: object $IE_PORT_CAR_2 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_3 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 161& 004D: jump if false ££IE_IMPORT_CHECK_4 00D6: if 0? 0039: 2@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 2@ = 1? 029B: $IE_PORT_CAR_3 = init object -32? (LINE) at 1146! -675.4375! 12.5! 0453: object $IE_PORT_CAR_3 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_4 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 194& 004D: jump if false ££IE_IMPORT_CHECK_5 00D6: if 0? 0039: 3@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 3@ = 1? 029B: $IE_PORT_CAR_4 = init object -32? (LINE) at 1146! -675.4375! 12.75! 0453: object $IE_PORT_CAR_4 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_5 0001: wait 0? ms 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 152& 004D: jump if false ££IE_IMPORT_CHECK_6 00D6: if 0? 0039: 4@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 4@ = 1? 029B: $IE_PORT_CAR_5 = init object -32? (LINE) at 1146! -675.4375! 12.9375! 0453: object $IE_PORT_CAR_5 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_6 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 186& 004D: jump if false ££IE_IMPORT_CHECK_7 00D6: if 0? 0039: 5@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 5@ = 1? 029B: $IE_PORT_CAR_6 = init object -32? (LINE) at 1146! -675.4375! 13.125! 0453: object $IE_PORT_CAR_6 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_7 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 144& 004D: jump if false ££IE_IMPORT_CHECK_8 00D6: if 0? 0039: 6@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 6@ = 1? 029B: $IE_PORT_CAR_7 = init object -32? (LINE) at 1146! -675.4375! 13.375! 0453: object $IE_PORT_CAR_7 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_8 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 226& 004D: jump if false ££IE_IMPORT_CHECK_9 00D6: if 0? 0039: 7@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 7@ = 1? 029B: $IE_PORT_CAR_8 = init object -32? (LINE) at 1146! -675.4375! 13.5625! 0453: object $IE_PORT_CAR_8 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_9 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 153& 004D: jump if false ££IE_IMPORT_CHECK_10 00D6: if 0? 0039: 8@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 8@ = 1? 029B: $IE_PORT_CAR_9 = init object -32? (LINE) at 1146! -674.5625! 12.125! 0453: object $IE_PORT_CAR_9 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_10 0001: wait 0? ms 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 200& 004D: jump if false ££IE_IMPORT_CHECK_11 00D6: if 0? 0039: 9@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 9@ = 1? 029B: $IE_PORT_CAR_10 = init object -32? (LINE) at 1146! -674.5625! 12.3125! 0453: object $IE_PORT_CAR_10 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_11 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 138& 004D: jump if false ££IE_IMPORT_CHECK_12 00D6: if 0? 0039: 10@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 10@ = 1? 029B: $IE_PORT_CAR_11 = init object -32? (LINE) at 1146! -674.5625! 12.5! 0453: object $IE_PORT_CAR_11 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_12 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 133& 004D: jump if false ££IE_IMPORT_CHECK_13 00D6: if 0? 0039: 11@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 11@ = 1? 029B: $IE_PORT_CAR_12 = init object -32? (LINE) at 1146! -674.5625! 12.75! 0453: object $IE_PORT_CAR_12 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_13 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 185& 004D: jump if false ££IE_IMPORT_CHECK_14 00D6: if 0? 0039: 12@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 12@ = 1? 029B: $IE_PORT_CAR_13 = init object -32? (LINE) at 1146! -674.5625! 12.9375! 0453: object $IE_PORT_CAR_13 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_14 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 167& 004D: jump if false ££IE_IMPORT_CHECK_15 00D6: if 0? 0039: 13@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 13@ = 1? 029B: $IE_PORT_CAR_14 = init object -32? (LINE) at 1146! -674.5625! 13.125! 0453: object $IE_PORT_CAR_14 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_15 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 148& 004D: jump if false ££IE_IMPORT_CHECK_16 00D6: if 0? 0039: 14@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 14@ = 1? 029B: $IE_PORT_CAR_15 = init object -32? (LINE) at 1146! -674.5625! 13.375! 0453: object $IE_PORT_CAR_15 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_CHECK_16 00D6: if 0? 00DE: player $PLAYER_CHAR driving vehicle type 158& 004D: jump if false ££IE_NOT_NEEDED 00D6: if 0? 0039: 15@ == 0? \\ integer values 004D: jump if false ££IE_IMPORT_ENOUGH 0050: gosub ££IE_IMPORT_DOOR 00D6: if 0? 0038: $IE_IMPORT_CAR_ACCEPTED == 1? \\ integer values 004D: jump if false ££IE_IMPORT_START 0004: 15@ = 1? 029B: $IE_PORT_CAR_15 = init object -32? (LINE) at 1146! -674.5625! 13.5625! 0453: object $IE_PORT_CAR_15 set rotation 0! 0! 270! 0002: jump ££IE_IMPORT_END
:IE_IMPORT_DOOR 0004: $IE_IMPORT_CAR_ACCEPTED = 0? \\ integer values 021B: set garage $IE_GARAGE_PORT to accept car $IE_IMPORT_CAR
:IE_IMPORT_GARAGE 0001: wait 100? ms 00D6: if 0? 0256: player $PLAYER_CHAR defined 004D: jump if false ££IE_IMPORT_GARAGERETURN 00D6: if 0? 00B0: $IE_IMPORT_CAR 0? ()in rectangle 1139.719! -667.75! 1173! -685.68! 004D: jump if false ££IE_IMPORT_GARAGERETURN 00D6: if 0? 80B0: NOT $IE_IMPORT_CAR 0? ()in rectangle 1147! -667.75! 1139.719! -685.68! 004D: jump if false ££IE_IMPORT_GARAGE 00D6: if 0? 8056: NOT player $PLAYER_CHAR 0? ()in_rectangle 1146.1! -667.75! 1173! -685.68! 004D: jump if false ££IE_IMPORT_GARAGE 01B4: set player $PLAYER_CHAR frozen state 0? (frozen) 0361: close_garage $IE_GARAGE_PORT 0008: $IE_PORT_TOTAL += 1? \\ integer values 030C: set mission points += 1? 0109: player $PLAYER_CHAR money += 100? 01C3: remove references to car $IE_IMPORT_CAR 0004: $IE_IMPORT_CAR_ACCEPTED = 1? \\ integer values
:IE_IMPORT_GARAGERETURN 0051: return
:IE_IMPORT_ENOUGH 00BC: text highpriority "IMPORT5" 4000& ms 1? \\We got more of those then we can shift. Sorry man, no deal. 0002: jump ££IE_IMPORT_GET_AWAY
:IE_NOT_NEEDED 00BC: text highpriority "IMPORT2" 2000& ms 1? \\We are not interested in that model 0002: jump ££IE_IMPORT_GET_AWAY
:IE_IMPORT_GET_AWAY 0001: wait 500& ms 00D6: if 0? 0056: player $PLAYER_CHAR 0? ()in_rectangle 1147! -687! 1139! -675! 004D: jump if false ££IE_IMPORT_START 0002: jump ££IE_IMPORT_GET_AWAY
:IE_IMPORT_END 0001: wait 0? ms 00D6: if 0? 001A: 16? > $IE_PORT_TOTAL \\ integer values 004D: jump if false ££IE_IMPORT_ENDFINAL 00BC: text highpriority "IMPORT3" 3000& ms 1? \\Delivered like a pro. Complete the list and there'll be a bonus for you. 021B: set garage $IE_GARAGE_PORT to accept car 181& 01B4: set player $PLAYER_CHAR frozen state 1? (unfrozen) 0002: jump ££IE_IMPORT_START
:IE_IMPORT_ENDFINAL 00BC: text highpriority "IMPORT4" 5000& ms 1? \\All the cars. NICE! Here's a little something. 0109: player $PLAYER_CHAR money += 20000& 02FA: garage $IE_GARAGE_PORT change to type 23? 03DA: set garage $IE_GARAGE_PORT camera follows player 0360: open garage $IE_GARAGE_PORT
:IE_EXPORT_LOOP 0001: wait 500& ms 00D6: if 0? 0056: player $PLAYER_CHAR 0? ()in_rectangle 1130! -700! 1173! -667.75! 004D: jump if false ££IE_EXPORT_LOOP 0518: 0@ = create available asset pickup "PONY" at 1149! -669! 12.14! price 0? 0518: 1@ = create available asset pickup "RUMPO" at 1153.2! -669! 12.14! price 0? 0518: 2@ = create available asset pickup "BUS" at 1157.4! -669! 12.14! price 0? 0518: 3@ = create available asset pickup "RCBARON" at 1161.6! -669! 12.14! price 0? 0518: 4@ = create available asset pickup "BOBCAT" at 1165.8! -669! 12.14! price 0? 0518: 5@ = create available asset pickup "YANKEE" at 1170! -669! 12.14! price 0? 0518: 6@ = create available asset pickup "MULE" at 1170! -672! 12.14! price 0? 0518: 7@ = create available asset pickup "BLISTAC" at 1170! -675! 12.14! price 0? 0518: 8@ = create available asset pickup "WHOOPEE" at 1170! -678! 12.14! price 0? 0518: 9@ = create available asset pickup "PATRIOT" at 1170! -681! 12.14! price 0? 0518: 10@ = create available asset pickup "TRASHM" at 1170! -684! 12.14! price 0? 0518: 11@ = create available asset pickup "LINERUN" at 1165.8! -684! 12.14! price 0? 0518: 12@ = create available asset pickup "FLATBED" at 1161.6! -684! 12.14! price 0? 0518: 13@ = create available asset pickup "COACH" at 1157.4! -684! 12.14! price 0? 0518: 14@ = create available asset pickup "MOONBM" at 1153.2! -684! 12.14! price 0? 0518: 15@ = create available asset pickup "SECURI" at 1149! -684! 12.14! price 0?
:IE_EXPORT_ACTIVATED 0001: wait 250& ms 00D6: if 0? 8214: NOT pickup 0@ picked up 004D: jump if false ££IE_PICKUP_PORT_1 00D6: if 0? 8214: NOT pickup 1@ picked up 004D: jump if false ££IE_PICKUP_PORT_2 00D6: if 0? 8214: NOT pickup 2@ picked up 004D: jump if false ££IE_PICKUP_PORT_3 00D6: if 0? 8214: NOT pickup 3@ picked up 004D: jump if false ££IE_PICKUP_PORT_4 00D6: if 0? 8214: NOT pickup 4@ picked up 004D: jump if false ££IE_PICKUP_PORT_5 00D6: if 0? 8214: NOT pickup 5@ picked up 004D: jump if false ££IE_PICKUP_PORT_6 0001: wait 0? ms 00D6: if 0? 8214: NOT pickup 6@ picked up 004D: jump if false ££IE_PICKUP_PORT_7 00D6: if 0? 8214: NOT pickup 7@ picked up 004D: jump if false ££IE_PICKUP_PORT_8 00D6: if 0? 8214: NOT pickup 8@ picked up 004D: jump if false ££IE_PICKUP_PORT_9 00D6: if 0? 8214: NOT pickup 9@ picked up 004D: jump if false ££IE_PICKUP_PORT_10 00D6: if 0? 8214: NOT pickup 10@ picked up 004D: jump if false ££IE_PICKUP_PORT_11 00D6: if 0? 8214: NOT pickup 11@ picked up 004D: jump if false ££IE_PICKUP_PORT_12 0001: wait 0? ms 00D6: if 0? 8214: NOT pickup 12@ picked up 004D: jump if false ££IE_PICKUP_PORT_13 00D6: if 0? 8214: NOT pickup 13@ picked up 004D: jump if false ££IE_PICKUP_PORT_14 00D6: if 0? 8214: NOT pickup 14@ picked up 004D: jump if false ££IE_PICKUP_PORT_15 00D6: if 0? 8214: NOT pickup 15@ picked up 004D: jump if false ££IE_PICKUP_PORT_16 00D6: if 0? 8056: NOT player $PLAYER_CHAR 0? ()in_rectangle 1130! -700! 1173! -667.75! 004D: jump if false ££IE_EXPORT_ACTIVATED 0050: gosub ££IE_EXPORT_DESTROY 0002: jump ££IE_EXPORT_LOOP
:IE_PICKUP_PORT_1 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 143& \\ integer values \\Pony 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_2 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 170& \\ integer values \\Rumpo 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_3 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 161& \\ integer values \\Bus 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_4 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 194& \\ integer values \\Dodo 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_5 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 152& \\ integer values \\Bobcat 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_6 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 186& \\ integer values \\Yankee 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_7 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 144& \\ integer values \\Mule 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_8 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 226& \\ integer values \\Blista Compact (Blista) 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_9 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 153& \\ integer values \\Mr. Whoopee 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_10 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 200& \\ integer values \\Patriot 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_11 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 138& \\ integer values \\Trashmaster 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_12 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 133& \\ integer values \\Linerunner 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_13 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 185& \\ integer values \\Flatbed 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_14 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 167& \\ integer values \\Coach 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_15 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 148& \\ integer values \\Moonbeam 0002: jump ££IE_CAR_REQ_PORT
:IE_PICKUP_PORT_16 0050: gosub ££IE_EXPORT_DESTROY 0004: 0@ = 158& \\ integer values \\Securicar
:IE_CAR_REQ_PORT 00BC: text highpriority "IMPORT1" 5000& ms 2? \\Go outside and wait for your vehicle.
:IE_OUTSIDE_CHECK 0001: wait 100? ms 00D6: if 0? 8056: NOT player $PLAYER_CHAR 0? ()in rectangle 1145! -667.75! 1173! -685.68! 004D: jump if false ££IE_OUTSIDE_CHECK 0361: close garage $IE_GARAGE_PORT 01B4: set player $PLAYER_CHAR frozen state 0? (frozen) 0247: request model 0@ 038B: load requested models
:IE_CAR_SPAWN_PORT 0001: wait 0? ms 00D6: if 0? 0248: model 0@ available 004D: jump if false ££IE_CAR_SPAWN_PORT 00A5: 1@ = create car 0@ at 1161.19! -676.138! 12.14! 0175: set_car 1@ z_angle_to 90! 0249: release model 0@ 0360: open garage $IE_GARAGE_PORT 01B4: set player $PLAYER_CHAR frozen state 1? (unfrozen) 01C3: remove references to car 1@
:IE_CAR_PICK_IT_UP 0001: wait 100? ms 00D6: if 0? 8056: NOT player $PLAYER_CHAR 0? ()in_rectangle 1130! -700! 1173! -667.75! 004D: jump if false ££IE_CAR_PICK_IT_UP 0002: jump ££IE_EXPORT_LOOP
:IE_EXPORT_DESTROY 0215: destroy_pickup 0@ 0215: destroy_pickup 1@ 0215: destroy_pickup 2@ 0215: destroy_pickup 3@ 0215: destroy_pickup 4@ 0215: destroy_pickup 5@ 0215: destroy_pickup 6@ 0215: destroy_pickup 7@ 0215: destroy_pickup 8@ 0215: destroy_pickup 9@ 0215: destroy_pickup 10@ 0215: destroy_pickup 11@ 0215: destroy_pickup 12@ 0215: destroy_pickup 13@ 0215: destroy_pickup 14@ 0215: destroy_pickup 15@ 0051: return |
| QUOTE (TwoZero @ Jun 4 2004, 14:45) | | I never used Gosub and I have absolutly no expirence with it so I had no idea what kind of result it could have. Now I know that it can be quite usefull and will look into it how it works etc. |
Basically, the thread pointer jumps like in a normal jump, but remembers where it jumped from. That way you can give it a generic command like RETURN instead of having to specify an address. It's most common use is in code that repeats. In this code, it allows us to do the accept car routine once, but call on it 16 times. | QUOTE (TwoZero @ Jun 4 2004, 14:45) | | I will explain why I did that and then you know that there's a bug in your code. The code checks if you are in front of the garage. It will execpt your car if it's on the list and not brought in before. So the garage is set to accept your car and a check starts running if you are inside the garage. Here I started my timer, because What if you drive of and decide not to bring in the car? then that rectangle loop will run forever and ever. If you return later with a other car then it won't be accepted because it's still running the rectangle check. As far as I understand your code it has that bug. |
Actually it doesn't. The bug mine had was because I joined a pair of location sniffers instead of checking is succession. The destination codewise was different for the two, so lumping them together is where I went wrong. As you can see by the fix, I've addressed and solved (I belive) that issue. Your code used an arbitrary time and could even expire. That's not good code. The way the code sits now, just about any set of circumstances (including sitting there for a long time) is covered. Even still, you should be doing your timed operations with 16@ and 17@ where possible. | QUOTE (TwoZero @ Jun 4 2004, 14:45) | | I must say that the last time I played GTA3 was more then a year ago and I don't really remember how everything went. I am planning on playing it again but I have been really busy. So I don't really know how it went in GTA3. |
That's okay. Having me tweak the code will help ensure it's accurate. It's not your fault either because you're taking something that was hard-coded in GTA3 and code-simulating it; not an easy task  | QUOTE (TwoZero @ Jun 4 2004, 14:45) | | I was happy with the GXT in my part the loop just pauses for a few seconds so the loop won't start right after the text is printed on the screen, most people leave within a few seconds. But your code is good to I think I use that one. |
That's the same problem as above. You trusted extensive time passes as being okay in your code (bad habit). My code addresses a much larger spectrum of circustances. And since GTA3 displayed the message once until you returned, my code enforces that. | QUOTE (TwoZero @ Jun 4 2004, 14:45) | As you might have noticed by now I'm not very good in saving resources but I will improve! |
That's cool. Many people aren't and I'm not going to sit here and pretend I know them all either. Some people ask what exactly is "clean" code and the use of global vars, freeing up resources etc is a good example. You'll also notice that my version isn't timed as tightly as yours. This is due to GTA3's code mostly. But you'll notice that when you go from being away from the garage to being near it, the timing gets much tighter (in the export loop). Another example of clean code that I actually found out while writing TTVC. | QUOTE (TwoZero @ Jun 4 2004, 14:45) | | I didn't really know how that went in GTA3 and I got no complains about it after the beta release I thought I did it ok. I guess not. |
Again, the fact that it is a triggered pickup makes it "OKAYer". But the way you wrote it, for as long as they would hold the button, it would pick it up, create it, repeata. Not needed. And all that is aside from the fact that in GTA3, picking up one meant they all disappeared. It's fixed now  | QUOTE (TwoZero @ Jun 4 2004, 14:45) | | As I commented on your question about the timer, I tried to prevent these things from happening. With the timer check I can also inculde a Death check and more. |
Well the correct way of doing this is with player defined checks. | QUOTE (TwoZero @ Jun 4 2004, 14:45) | | I really apriciate it that you take your time to explain everything and learn people what they do wrong. I really learned from all this and will pay much more attention to defining, checking, code saveing, crash prevention etc. |
Well part of the reason why I've spent this much time for you is because I can tell you're capable of learning and willing to try. Some people come here and just won't listen, so I don't waste my time on them. To me, the coding scene was rather dry for a while there. Nowadays, more and more quality coders are coming along and I want to help them just as they help me too. | QUOTE (TwoZero @ Jun 4 2004, 14:45) | I thought about that to and I think you shouldn't be able to use it in any way during missions. It would be very unfair if you have a escape mission and you could just get a dodo out of the garge. But ofcourse make it like GTA3 . |
You misunderstand. The garage in GTA3 allowed you to pick up anything whenever. Depositing cars however, was much more strict. So yeah, I've went ahead and added an $ONMISSION check.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(21) « First ... 2 3 [4] 5 6 ... Last »
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|