|
 |
|
|
|
|
|
Attention:
The train Back on Track(s)
 |
|
 |
| |
PatrickW  |
|
GTA Juggernaut

Group: Moderators
Joined: Jan 7, 2004



|
For the latest version of my scm you also have to define train_dl and train_dr in the generic.ide. I'm not sure what the best values are, so I let mark answer this one.
BTW you'll have to add empty col-files for the door models also to the generic.col. I just copied one of the existing empty col-files ( e.g. "line" in lcgeneric.col )
BTW.
The train vanishes when it is only a little distance away, while the doors can be seen from a distance. The setting I use in generic.ide are equal for all: 5843, train, train, 1, 240, 128 5844, train_dl, train_dl, 1, 240, 128 5845, train_dr, train_dr, 1, 240, 128
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
PatrickW  |
Posted: Wednesday, Sep 8 2004, 09:06
|
GTA Juggernaut

Group: Moderators
Joined: Jan 7, 2004



|
Working col-file would be cool, I'm very curious for RDTG's work.
I have the same feeling as you about the doors, because I told the doors to follow the "wanderer", which also moves the trains. The doors just stick to that position. None of the available object movement opcodes ( throw_object, move_object) can get it away from threre. What we need is a opcode that decouples an object from the "wanderer" object, but R* doesn't use it, so I doubt there is one.... I'll look further.....
The col file I supplied, was handmade, by just walking around the tracks and storing player positions. You can also use flight3.dat, that's the path th eheli used in the earlier releases. I made my own because I couldn't get it working in the beginning, and I though it might be because the file had much more pathpoints than the original. When switching spath0.dat the station positions in the scm file have to be corrected.
I'll be working on the scm file, but it's a bit hectic IRL this week, so don't expect to much progress....
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
PatrickW  |
Posted: Wednesday, Sep 8 2004, 22:35
|
GTA Juggernaut

Group: Moderators
Joined: Jan 7, 2004



|
@opius: I did read your code, and coming from one of my hero's, offcourse I tested it. But placement of the doors like that seems to be to slow, it looks rather restless. Also there's a problem where the train is going up or down a slope. The doors stay horizontal, while the train is at an angle, and I don't think we have an opcode for sniffing that angle yet. Any advice is very welcome here..
@mark: The reason that other paths don't work without adaptation is that my code needs a certain amount of overlap between the beginning of the path and the end. The overlapping piece must be at least include the stretch of rails where the trains stop at the station that is above the water. I need that overlap section, to reposition the train to the beginnning of the path, while it stands there.
I assume the converted path doesn't have an overlap, that both trains will just run to the end of the path, without reaching the last station.
I'm not sure what you wanted to achieve by putting the doors into the same dff file, but as you said, how would we identify each of objects. As far as I know, all dff files that contain multiple objects are handled hardcoded.
To get the path smoother in the corners, we could just repeat the process that I initially created the path with. Just this time, we'll have need more player positions in the bends. I used barton's code-creator to record all the positions, and output them in the appropriate format.
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
PatrickW  |
Posted: Thursday, Sep 9 2004, 20:42
|
GTA Juggernaut

Group: Moderators
Joined: Jan 7, 2004



|
Mark, The fact that we can have multiple spath..dat files has already be reported recently by opius ( either in this topic or in the "new opcodes"topic in the misson coding forum. And yes, that is an easy way to get both the subway and the train running, I've already had train and subway run simultanious here... I happen to get the path files you posted before you removed them again, and I think the problem you saw is not in the path file. When the train runs allong the track, it is constantly offset to the left. This leads me to the conclusion, that the path is not offset in any direction, but that the point of the train that follows the path ( origin ?? ) is wrong. I assume that the origin in the train model is currently in the middle between the wheels, and from observation, it seems that it must be under the left wheels for the train to run correctly. Good news: I've got the doors working I found an additional opcode that works on wanderers. It destroys the wanderer, thereby freeing the object to move freely again. What I do now, is when I arrive at a station, I destroy the wanderer, move the doors, re-create the wanderer, and attach the train and the doors again. This re-attaching caused some major problems at first, but I think I got it working stable and robust now. Here is a new pre-compiled scm file that has properly operating doors. To use it, you should have: • the train-model posted earlier, with proper col-files • the spath0.dat file below spath0.dat file: | CODE | 172 416.3980 -560.0460 21.7242 416.3990 -582.6190 21.7242 416.4540 -605.4340 21.9436 416.3990 -650.8010 21.7242 416.4270 -696.1780 21.8339 416.5570 -741.5730 21.7247 420.9060 -786.0910 22.2607 422.0560 -795.1690 22.0413 424.0170 -802.9830 22.0413 427.6190 -810.6750 22.2607 431.8150 -816.8370 22.0413 435.8530 -821.6230 22.0413 443.1060 -827.2190 22.2607 450.1250 -831.1580 22.0413 458.0470 -834.1870 22.2607 465.3520 -835.7270 22.0413 471.6040 -836.0300 22.2607 494.2080 -835.9800 24.6489 516.9460 -836.1310 27.2547 539.7210 -836.1310 27.2547 562.3200 -835.9800 27.2547 568.4690 -835.8990 27.3634 575.7830 -834.4340 27.3634 583.7380 -831.4740 27.3634 590.6810 -827.4040 27.2547 597.8140 -821.5840 27.4741 603.6360 -817.0080 27.4741 614.0180 -811.7690 27.4741 623.5680 -810.0400 27.4741 632.5340 -809.4050 27.2547 643.9760 -809.6420 27.4741 666.5700 -809.6420 27.4741 689.3600 -809.6630 27.4741 711.9500 -809.6420 27.4741 734.7500 -809.5670 27.2547 765.5400 -809.7180 24.9059 798.3000 -808.3350 22.3598 804.4500 -808.2540 22.4861 811.7400 -806.7160 22.3774 819.6800 -803.7600 22.3774 826.6600 -799.7590 22.3774 833.7400 -793.8850 22.3774 849.7700 -777.8780 24.8258 865.8000 -761.8190 27.2669 881.9300 -745.9340 29.7153 897.8900 -729.8320 32.3757 913.8700 -713.8560 32.3758 929.9400 -697.7030 32.1564 946.0000 -681.7530 34.8232 962.0300 -665.6970 37.2652 966.2800 -661.2530 37.1545 970.3500 -655.0080 37.0458 974.0200 -647.3520 37.0458 975.9800 -639.5390 37.0458 976.9100 -630.3580 37.2652 976.9300 -607.7310 39.7127 976.9300 -585.0460 42.1547 976.7800 -578.8970 42.0440 975.3100 -571.5830 42.0440 972.3500 -563.6280 42.0440 968.2800 -556.6840 41.9353 962.4600 -549.5270 42.1547 946.3700 -533.4420 42.1547 930.3700 -517.4380 42.1547 925.9200 -513.2050 42.0440 919.7500 -509.0030 41.9353 912.0200 -505.4660 41.9353 904.2400 -503.3570 41.9353 895.0200 -502.5780 42.1546 870.4900 -503.9880 39.7130 845.7800 -505.4080 37.2594 800.4400 -505.3870 32.3699 754.9600 -505.2100 26.9374 709.4800 -505.0880 21.7242 697.6000 -503.9590 21.7242 687.5200 -501.2270 21.7242 677.5000 -496.6450 21.7242 669.4500 -491.2790 21.7242 663.5600 -485.7810 21.7242 655.8400 -476.6750 21.7242 650.6300 -467.5910 21.7242 646.8530 -457.2260 21.9436 644.9500 -447.7260 21.9436 644.6800 -439.6850 21.9436 644.7560 -417.1190 21.7242 644.7010 -394.3040 21.9436 644.6050 -371.7450 21.7242 644.6250 -348.9300 21.7242 644.6800 -326.3430 21.9436 644.7010 -303.5550 21.9436 645.7370 -291.6500 21.7242 648.4760 -281.5420 21.7242 653.0700 -271.5050 21.7242 658.5700 -263.5260 21.7242 664.0100 -257.5920 21.9436 680.3300 -240.9240 21.9436 684.5700 -236.4850 21.8329 688.7100 -230.2770 21.8329 692.1700 -222.5330 21.7242 694.3400 -214.7850 21.8329 695.2000 -205.6040 21.9436 695.2000 -183.0110 21.9436 695.2000 -160.2300 21.9436 695.2800 -137.6640 21.7242 695.2200 -114.8490 21.9436 695.2800 -92.2901 21.7242 695.3000 -69.4754 21.7242 695.0700 -63.3338 21.8329 693.6000 -56.0194 21.8329 690.6400 -48.0645 21.8329 686.6900 -41.0354 21.7242 680.7500 -33.9882 21.9436 664.8500 -17.9728 21.7242 648.6740 -1.8795 21.9436 644.2660 2.4124 21.7242 638.0480 6.5547 21.7242 630.3180 10.0916 21.7242 622.5190 12.1267 21.8329 613.3390 12.9808 21.9436 590.7730 13.0565 21.7242 567.9580 13.0769 21.7242 561.8070 12.9199 21.7242 554.5020 11.3798 21.8329 546.5150 8.4877 21.7242 539.5180 4.4742 21.7242 532.4170 -1.4168 21.7242 516.4890 -17.4514 21.9436 500.3080 -33.4968 21.7242 484.4050 -49.5356 21.9436 468.2970 -65.6438 21.9436 452.3210 -81.6198 21.9436 436.1400 -97.6653 21.7242 432.0210 -102.2190 21.7242 427.8250 -108.3800 21.8329 424.2220 -116.0730 21.7242 422.2620 -123.8860 21.7242 421.2580 -133.0450 21.7242 421.4080 -155.6180 21.7242 421.4080 -178.4260 21.7242 421.4080 -200.9920 21.7242 421.3120 -223.8070 21.9436 421.3940 -229.9580 21.7242 423.0070 -237.2430 21.7242 425.8260 -245.2500 21.7242 429.9640 -252.1610 21.7242 435.7300 -259.3480 21.7242 457.2840 -279.8750 21.9436 464.8270 -289.1210 21.7242 470.0940 -298.1520 21.9436 473.9390 -308.4840 21.9436 475.8420 -317.9840 21.9436 476.1130 -326.0390 21.9436 476.0170 -348.8070 21.7242 476.0920 -371.4130 21.9436 476.0920 -394.1610 21.9436 476.0170 -416.7940 21.7242 476.0920 -439.5420 21.9436 476.0920 -462.1750 21.9436 475.2330 -469.5140 21.9436 471.5280 -480.5270 21.7242 466.0060 -488.4890 21.7242 460.1750 -495.3250 21.7242 451.8780 -503.2320 21.8339 431.3390 -524.7150 21.9436 427.0430 -529.1270 21.7242 423.0320 -535.4180 21.7242 419.4350 -543.0990 21.8329 417.4030 -550.8870 21.7242 416.3980 -560.0460 21.7242 416.3990 -582.6190 21.7242 416.4540 -605.4340 21.9436 416.3990 -650.8010 21.7242
|
This is the converted path by mark, rotated for a couple of path-point, to get the overlapping section in front of the station. Here is the MB1.3 source of the train sofar, with working doors. comments are very welcome as always. | CODE | ;=========== start OF TRAIN CODE ==================== :TRAIN_THREAD 03A4: name_thread "TRAIN"
;-------------------------- ; Create objects for train1 ;-------------------------- 049C: create_wanderer_on_path 0 5.0 $WANDERER1 029B: $TRAIN1 = init_object -194 () at 415.5847 -741.1385 23.04234 029B: $TRAIN1_DL = init_object -195 () at 415.5847 -741.1385 23.04234 029B: $TRAIN1_DR = init_object -196 () at 415.5847 -741.1385 23.04234 01C7: remove_object_from_mission_cleanup_list $TRAIN1 01C7: remove_object_from_mission_cleanup_list $TRAIN1_DL 01C7: remove_object_from_mission_cleanup_list $TRAIN1_DR 049D: assign_wanderer $WANDERER1 to_object $TRAIN1 049D: assign_wanderer $WANDERER1 to_object $TRAIN1_DL 049D: assign_wanderer $WANDERER1 to_object $TRAIN1_DR
;-------------------------- ; Create objects for train2 ;-------------------------- 049C: create_wanderer_on_path 0 5.0 $WANDERER2 029B: $TRAIN2 = init_object -194 () at 415.5847 -741.1385 23.04234 029B: $TRAIN2_DL = init_object -195 () at 415.5847 -741.1385 23.04234 029B: $TRAIN2_DR = init_object -196 () at 415.5847 -741.1385 23.04234 01C7: remove_object_from_mission_cleanup_list $TRAIN2 01C7: remove_object_from_mission_cleanup_list $TRAIN2_DL 01C7: remove_object_from_mission_cleanup_list $TRAIN2_DR 049D: assign_wanderer $WANDERER2 to_object $TRAIN2 049D: assign_wanderer $WANDERER2 to_object $TRAIN2_DL 049D: assign_wanderer $WANDERER2 to_object $TRAIN2_DR
;------------------------------ ; Determine coords of stations ;------------------------------ 049F: set_wanderer_position $WANDERER1 38.0 0001: wait 0 ms 01BB: store object $TRAIN1 position to $train_stat0_x $train_stat0_y $train_stat0_z
049F: set_wanderer_position $WANDERER1 1017.0 0001: wait 0 ms 01BB: store object $TRAIN1 position to $train_stat1_x $train_stat1_y $train_stat1_z
049F: set_wanderer_position $WANDERER1 1666.0 0001: wait 0 ms 01BB: store object $TRAIN1 position to $train_stat2_x $train_stat2_y $train_stat2_z
;------------------------------------ ; position wanderers and start moving ;------------------------------------ 049F: set_wanderer_position $WANDERER1 38.0 049F: set_wanderer_position $WANDERER2 18.0
049E: set_wanderer_speed $WANDERER1 15.0 049E: set_wanderer_speed $WANDERER2 15.0
0@ = 1
;------------------------------------ ; MAIN LOOP ;------------------------------------ :TRAIN_LOOP 0050: gosub ££TRAIN_GET_STATION_COORDS ;---------------------------------------------------------------- ; The train will slowdown when approaching the station, ; to stop just beyond the station coords 1@ 2@ 3@ ; Speed = (2.0 * distance), clipped to [1.0,20.0], ; until the station-coords are passed. ;---------------------------------------------------------------- 8@ = 9999.9 ; initial value used in prev_distance :TRAIN_RIDE 0001: wait 100 ms 01BB: store object $TRAIN1 position to 4@ 5@ 6@ 01BB: store object $TRAIN2 position to 10@ 11@ 12@ float 7@ = 8@ ; remember prev_distance 0509: 8@ = distance between point 1@ 2@ and point 4@ 5@ ; remaining distance to next station float 9@ = 8@ 9@ *= 2.0 if 0 20.0 > 9@ jf ££TRAIN_RIDE
if 0 1.0 > 9@ jf ££TRAIN_NEXT2 9@ = 1.0 :TRAIN_NEXT2
049E: set_wanderer_speed $WANDERER1 9@ 049E: set_wanderer_speed $WANDERER2 9@
if 0 float 8@ > 7@ ; if distance > prev_distance then halt. jf ££TRAIN_RIDE 049E: set_wanderer_speed $WANDERER1 0.0 049E: set_wanderer_speed $WANDERER2 0.0
;--------------------------------------------------------------- ; The train has stopped at the station, now destroy the ; wanderer-objects to enable seperate movement of the doors. ; Calculate the "open"-positions of the doors and open the doors. ;--------------------------------------------------------------- 0001: wait 0 ms 04A1: destroy_wanderer $WANDERER1 04A1: destroy_wanderer $WANDERER2
0400: create coordinate $TRAIN1_DRX $TRAIN1_DRY $TRAIN1_DRZ from object $TRAIN1 offset 0.0 -1.0 0.0 0400: create coordinate $TRAIN1_DLX $TRAIN1_DLY $TRAIN1_DLZ from object $TRAIN1 offset 0.0 1.0 0.0 0400: create coordinate $TRAIN2_DRX $TRAIN2_DRY $TRAIN2_DRZ from object $TRAIN2 offset 0.0 -1.0 0.0 0400: create coordinate $TRAIN2_DLX $TRAIN2_DLY $TRAIN2_DLZ from object $TRAIN2 offset 0.0 1.0 0.0 :TRAIN_OPENING 00D6: if 23 834E: NOT move_object $TRAIN1_DR to $TRAIN1_DRX $TRAIN1_DRY $TRAIN1_DRZ step_size 0.05 0.05 0.05 0 834E: NOT move_object $TRAIN1_DL to $TRAIN1_DLX $TRAIN1_DLY $TRAIN1_DLZ step_size 0.05 0.05 0.05 0 834E: NOT move_object $TRAIN2_DR to $TRAIN2_DRX $TRAIN2_DRY $TRAIN2_DRZ step_size 0.05 0.05 0.05 0 834E: NOT move_object $TRAIN2_DL to $TRAIN2_DLX $TRAIN2_DLY $TRAIN2_DLZ step_size 0.05 0.05 0.05 0 004D: jump_if_false ££TRAIN_OPEN 0001: wait 0 ms 0002: jump ££TRAIN_OPENING
;---------------------------------------------------------------- ; wait for 10 seconds at the station ;---------------------------------------------------------------- :TRAIN_OPEN 0001: wait 10000 ms
;---------------------------------------------------------------- ; Move the doors back to the closed position ( = train_position) ;---------------------------------------------------------------- :TRAIN_CLOSING 00D6: if 23 834E: NOT move_object $TRAIN1_DR to 4@ 5@ 6@ step_size 0.05 0.05 0.05 0 834E: NOT move_object $TRAIN1_DL to 4@ 5@ 6@ step_size 0.05 0.05 0.05 0 834E: NOT move_object $TRAIN2_DR to 10@ 11@ 12@ step_size 0.05 0.05 0.05 0 834E: NOT move_object $TRAIN2_DL to 10@ 11@ 12@ step_size 0.05 0.05 0.05 0 004D: jump_if_false ££TRAIN_CLOSED 0001: wait 0 ms 0002: jump ££TRAIN_CLOSING
;---------------------------------------------------------------- ; Create new wanderers and attach the train at the correct ; position for the current station, taking into account the ; overshoot during the braking (8@) ;---------------------------------------------------------------- :TRAIN_CLOSED 049C: create_wanderer_on_path 0 5.0 $WANDERER1 049C: create_wanderer_on_path 0 5.0 $WANDERER2 if 0 0@ == 0 jf ££TRAIN_TEST_ST1 8@ += 18.0 ;; Add station 0 position to the existing overshoot 0002: jump ££TRAIN_ST_POSITION
:TRAIN_TEST_ST1 if 0 0@ == 1 jf ££TRAIN_ST2 8@ += 997.0 ;; Add station 1 position to the existing overshoot 0002: jump ££TRAIN_ST_POSITION
:TRAIN_ST2 8@ += 1646.0 ;; Add station 2 position to the existing overshoot
:TRAIN_ST_POSITION 049F: set_wanderer_position $WANDERER2 8@ 8@ += 20.0 ;; add extra offset for the front carriage 049F: set_wanderer_position $WANDERER1 8@
049D: assign_wanderer $WANDERER1 to_object $TRAIN1 049D: assign_wanderer $WANDERER1 to_object $TRAIN1_DL 049D: assign_wanderer $WANDERER1 to_object $TRAIN1_DR 049E: set_wanderer_speed $WANDERER1 0.0
049D: assign_wanderer $WANDERER2 to_object $TRAIN2 049D: assign_wanderer $WANDERER2 to_object $TRAIN2_DL 049D: assign_wanderer $WANDERER2 to_object $TRAIN2_DR 049E: set_wanderer_speed $WANDERER2 0.0
;---------------------------------------------------------------- ; Accelerate away from this station ;---------------------------------------------------------------- 8@ = 1.0 :TRAIN_ACCEL 0001: wait 100 ms 049E: set_wanderer_speed $WANDERER1 8@ 049E: set_wanderer_speed $WANDERER2 8@ 8@ += 1.0 if 0 8@ > 20.0 jf ££TRAIN_ACCEL ;---------------------------------------------------------------- ; Select the next station and restart the procedure ;---------------------------------------------------------------- 0@ += 1 if 0 0@ == 3 jf ££TRAIN_LOOP 0@ = 0; jump ££TRAIN_LOOP
;===================================================== ; This routine selects the station coordinates, ; as determined during initialisation ;===================================================== :TRAIN_GET_STATION_COORDS if 0 0@ == 0 jf ££TRAIN_GSC_1 ; Coordinates for station 0 float 1@ = $train_stat0_x float 2@ = $train_stat0_y float 3@ = $train_stat0_Z 0051: return
:TRAIN_GSC_1 if 0 0@ == 1 jf ££TRAIN_GSC_2 ; Coordinates for station 1 float 1@ = $train_stat1_x float 2@ = $train_stat1_y float 3@ = $train_stat1_Z 0051: return
:TRAIN_GSC_2 ; Coordinates for station 2 float 1@ = $train_stat2_x float 2@ = $train_stat2_y float 3@ = $train_stat2_Z 0051: return
;=========== END OF TRAIN CODE ====================
|
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
vnum218  |
Posted: Thursday, Sep 9 2004, 23:06
|
Square Civilian

Group: Members
Joined: Aug 23, 2004

|
| QUOTE (PatrickW @ Sep 7 2004, 01:45) | For the latest version of my scm you also have to define train_dl and train_dr in the generic.ide. I'm not sure what the best values are, so I let mark answer this one.
BTW you'll have to add empty col-files for the door models also to the generic.col. I just copied one of the existing empty col-files ( e.g. "line" in lcgeneric.col )
BTW.
The train vanishes when it is only a little distance away, while the doors can be seen from a distance. The setting I use in generic.ide are equal for all: 5843, train, train, 1, 240, 128 5844, train_dl, train_dl, 1, 240, 128 5845, train_dr, train_dr, 1, 240, 128 |
It's great to hear that you've gotten the doors working! I have two quick questions about testing it out. 1) Do I put spath0.dat into the /data folder, or where? 2) You mention both generic.col, and lcgeneric.col, as well as generic.ide and lcgeneric.ide. Into which one do we copy the three above lines, and into which .col file do we copy the train and create the new objects? In fact, since these two problems alone may not be the problem, would you please consider writing a brief set of instructions, because the one's included in the readmes are not comprehensible to me. This post has been edited by vnum218 on Thursday, Sep 9 2004, 23:17
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Pages:
(16) « 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.
| |
 |
|
 |
|
|
|
|