IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules Attention:

Welcome to the GTA: Liberty City forum. This forum is led by SteaVor, Craig Kostelecky, Y_Less, and ModelingMan.
Please take the time to read the pinned GTA:LC Forum Rules & Directory before progressing any further into the forum.

The following topics are of most importance here, and are outlined in the forum directory:

Download GTA:LC · Checklist For GTA: Liberty City Final · Help & Questions Topic · Bugs, Glitches, and Incompletes · Meet The Team · Screenshots and videos

IRC Modding Chatroom (Don't have an IRC client? Click here.)



Pages: (16) « First ... 2 3 [4] 5 6 ... Last »  ( Go to first unread post ) Reply to this topicStart new topicStart Poll

 The train

 Back on Track(s)
 
PatrickW  
Posted: Tuesday, Sep 7 2004, 01:45
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




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
Users WebsitePM
  Top
 

 
Mark Pagliaro  
Posted: Tuesday, Sep 7 2004, 01:46
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



CODE

65  
416.2187 -553.2026 21.82176
415.5847 -741.1385 21.89234
420.8782 -795.08 22.13152
429.2188 -815.1333 22.15107
446.2679 -830.277 22.15111
467.5782 -836.8212 22.15111
517.6364 -837.47 27.32676
568.1943 -836.896 27.36447
581.3864 -833.425 27.36447
596.0228 -823.6623 27.33373
628.9299 -810.9904 27.36366
734.545 -810.5811 27.32164
797.1252 -809.6523 22.52132
813.3201 -807.0002 22.48717
834.2772 -795.2485 22.4468
898.1433 -730.9495 32.15638
930.1626 -698.7611 32.22551
962.7302 -666.0214 37.15561
971.9346 -654.4961 37.15561
977.7242 -632.2131 37.11866
977.392 -583.0168 42.04507
973.092 -563.0436 42.04507
962.4062 -547.613 42.00491
926.6387 -512.6955 42.04511
914.1027 -505.7343 42.0451
894.5739 -501.4455 41.95625
845.8719 -504.7078 37.12379
710.672 -503.63 21.93607
692.3838 -501.3937 21.834
671.0538 -491.2132 22.73401
656.3389 -474.9282 22.73394
650.4868 -463.1721 22.73394
646.2898 -447.5038 22.73394
645.9192 -303.621 21.79204
649.3021 -283.6812 21.834
659.3148 -264.3916 21.83401
685.1359 -237.5227 21.83401
693.106 -222.4549 21.83401
696.1497 -206.8604 21.79412
696.2778 -63.56801 21.83397
691.6658 -47.71423 21.83397
682.7407 -35.05809 21.79876
645.1888 3.230172 21.83401
632.4288 10.15493 21.83401
614.535 13.86464 21.79389
561.2931 13.69793 21.83395
547.8063 9.936776 21.83394
531.5917 -0.5916029 21.79162
431.1433 -101.8976 21.83401
423.0249 -116.8369 21.83401
420.3438 -134.0707 21.78991
420.5842 -228.9073 21.83394
424.9895 -244.9371 21.83394
432.0944 -256.4514 21.81064
456 -280.1959 21.78856
468.5944 -297.3653 21.83397
474.6543 -317.8608 21.83397
475.0185 -330.077 21.78796
475.1172 -461.9088 21.79034
470.8808 -479.2171 21.83394
461.8447 -491.5722 21.83281
426.8591 -527.5566 21.83401
420.4785 -538.4651 21.83401
416.2187 -553.2026 21.82176
415.5847 -741.1385 21.89234


Is the one I am using it is self edited with excel so there may be some errors. Right now I'm trying to get the col to work properly I also am trying to tweak the ide settings but I need to find the known definitions thread godk posted. My train is bumpy so I think I need to raise it slighty more.

Both the generic.ide (in gta3maps folder) and Objects.dat (in data folder) will need to be edited but I am trying to tweak them both. For some reason I can break the train which is no good.

I found the thread I needed as it was pinned but I found it using the search function.

This post has been edited by MarkPagliaro on Tuesday, Sep 7 2004, 01:52
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
PatrickW  
Posted: Tuesday, Sep 7 2004, 01:54
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




Thanx for that file,

You might find godk's tutorial In the tutarials's forum pinned archive topic.

<edit: you found it yourself in a paralel edit smile.gif smile.gif >
Users WebsitePM
  Top
 

 
Mark Pagliaro  
Posted: Tuesday, Sep 7 2004, 21:05
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



PatrickW:
Run Down That Guy has made a semi working col file for the train but I'd like to leave it up to him to release. About the door issue is it possible that the doors do not want to open because they were initially told to stick to the train? So when you go near the doors they try to open but glitch because they are also told to stick to the train.

Out of curiosity where did you get the first spath0.dat file? Hand made or converted from gta3 - 350x?

The path file needs some tweaking aswell. I am basically trying to tweak all that I can right now but no values has satisfied me yet.


This post has been edited by MarkPagliaro on Tuesday, Sep 7 2004, 21:22
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
PatrickW  
Posted: Wednesday, Sep 8 2004, 09:06
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




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....
Users WebsitePM
  Top
 

 
Opius  
Posted: Wednesday, Sep 8 2004, 09:21
Quote Post


General
Group Icon
Group: Members
Joined: Jun 27, 2002

au.gif

Member Award




Actually, I think only the train car should be attached to the wanderer, since that means the doors could move indepenatly.

Refer to above code for an idea on how to rig the doors to follow the train anyway.
Users WebsitePM
  Top
 

 
Mark Pagliaro  
Posted: Wednesday, Sep 8 2004, 10:33
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



When using the flight3.dat file as the spath0.dat the 2 train cars merge into 1 slightly after the triads train stop and the train remains stopped. It seems to be a smoother path (most likely because it has more lines) However its x or y axis is off a tiny bit.

Is this the same reason it didn't work for you?

This post has been edited by MarkPagliaro on Wednesday, Sep 8 2004, 10:36
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
Knux  
Posted: Wednesday, Sep 8 2004, 16:17
Quote Post


ex-GTA:LC co-leader
Group Icon
Group: Members
Joined: Sep 9, 2003

cd.gif

XXXXX



if you really want to see a video I just did a fast one. it shows that you can't get in until you press enter, the animation, and the camera and the name( just like being in a car) and the women talking (when you have stars) say that you are in a white train or smth , not 100% sure since I don't use it a lot...

btw, the train doesn't normally leave as soon as your in, I just entered it at the last second tounge.gif.

Xvid 4 compressed - no sound

http://alpha.emulation64.com/GTALC/GTA3_train.avi

Users WebsitePMMSN
  Top
 

 
Mark Pagliaro  
Posted: Wednesday, Sep 8 2004, 21:59
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



Is it possible to move 1 object in a certain dff file and not the others? If so I could put the doors in the train dff file and just increase the object count on the train. The thing is I don't think this is possible because as I gather:
1. only 1 col per dff
2. how would the engine know what object in the dff it is refering too.

It seems odd that the original path -350x will not work becaause it would make the ride look smoother. I even tried reducing the lines to the original length of spath0.dat (79 lines) but that failed to. I just would like to get the corners looking better.
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
PatrickW  
Posted: Wednesday, Sep 8 2004, 22:35
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




@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.


Users WebsitePM
  Top
 

 
Mark Pagliaro  
Posted: Wednesday, Sep 8 2004, 23:22
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



Ah I didn't notice that it will allow me to work with the path now that I know. Is it ever weird see the train in the vice engine. Maybe myraid will adapt the rail transport after seeing how this is being converted.
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
PatrickW  
Posted: Wednesday, Sep 8 2004, 23:32
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




My part of the work to get this train on the tracks is free for everybody to use smile.gif

One more point to watch when editing the spath0.dat file; currently in the scm file the position of the last station ( above water) is set at 40.0 meters from the beginning of the path. If you want it elsewhere, just send me the path file and i'll figure out the correct position and adapt the main.scm file to it.
Users WebsitePM
  Top
 

 
Mark Pagliaro  
Posted: Wednesday, Sep 8 2004, 23:40
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



That explains the late stop there. I'll send it as soon as I think it is complete. I don't know though I think maybe I should start looking to decode the train thread myself so I can change stuff like the location of station, distance between wanderers etc instead of bugging you all the time. I guess it would be a good start to learning the scm anyways. I have really enjoyed this thread I guess it is cause I like working with others who are superior then myself. It reminds me of back when LC started and Killer.ip and I were working together. There is still stuff I'd like to add like the lights and stuff.
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
PatrickW  
Posted: Wednesday, Sep 8 2004, 23:51
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




If you take this as an encouragement to learn scm coding,
I can only comment that this thread has served yet another noble purpose smile.gif

Have a look at the pinned tutorial topic in the missioncoding forum.
And don't be affraid to ask any question....


Have fun smile.gif
Users WebsitePM
  Top
 

 
Mark Pagliaro  
Posted: Thursday, Sep 9 2004, 02:27
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



Well I found reference to the spath0.dat file in the gta-vc.exe the interesting thing though is the 0 is defined like %d so it may be possible to make a spath1.dat file and have the subway follow it.

Even more interesting is seeing the message for need more space for moving objects followed by alot of empty space in the exe file. If we could muniplate these to add more spath.dat files we could get the staunton - shoreside lift bridge operational and the subway- train operational on seperate paths.

removed for time being:
I did get the train to follow in the subway for fun though using my subway path instead or the portland l-tracks path. For some reason GTAIII co-ords get messed up when convert -350X the train is slightly off center of the tracks I do not see the z axis being interfeared with in the equation however the Y axis may be effected. This is why I removed my pre-mature paths because I thought only the x would be effected. Logically that would be the case but in practise it is not.

This post has been edited by MarkPagliaro on Thursday, Sep 9 2004, 13:46
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
PatrickW  
Posted: Thursday, Sep 9 2004, 20:42
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




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 ====================

Users WebsitePM
  Top
 

 
poohead  
Posted: Thursday, Sep 9 2004, 23:02
Quote Post


the gran poo-bah
Group Icon
Group: Members
Joined: Jun 23, 2003

cd.gif

XXXXX



hey would it b to much trouble to ask if u can move all the latest files to the 1st page plz? great job by the way rah.gif
PM
  Top
 

 
vnum218  
Posted: Thursday, Sep 9 2004, 23:06
Quote Post


Square Civilian
Group Icon
Group: Members
Joined: Aug 23, 2004

XXXXX



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
PM
  Top
 

 
Mark Pagliaro  
Posted: Friday, Sep 10 2004, 02:31
Quote Post


Minutes To Midnight
Group Icon
Group: Members
Joined: Dec 14, 2003

it.gif

XXXXX



Well I guess I am a little behind Opius: Good job on noting we could have more spath#.dat files. I did look through the exe too. Here have a cookie.gif

Would you need the spath1.dat file for the subway then?
I want to get back to working on the model now that the path seems to be perfectly ported.
And here is your cookie.gif for the work done thus far.

This post has been edited by MarkPagliaro on Friday, Sep 10 2004, 19:29
PMMSNAOLYahooXbox LivePlayStation Network
  Top
 

 
PatrickW  
Posted: Saturday, Sep 11 2004, 10:11
Quote Post


GTA Juggernaut
Group Icon
Group: Moderators
Joined: Jan 7, 2004

nl.gif

Member Award




I've got a copy of your spath1.dat for the subway. I picked it up before you removed it from your message smile.gif.

here's a cookie.gif for your work on the path-conversion and one cookie.gif for your work on the model sofar.

I'm trying to to get the sub-way running also, and implement switching them both on and off, depending of where the player is at the moment.

I Hope I get it working on sunday, because monday I'll be on a 5 day vacation without web-access. I'll take my laptop though, so I maybe get some work done.



Users WebsitePM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Pages: (16) « First ... 2 3 [4] 5 6 ... Last »

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG