Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
hlennarz

[HELP!] "Trains on both Tracks" mod

Recommended Posts

hlennarz
Hey there, gtaforums community.


One of my favorite mods is the "New Algorythm for Railway Traffic" mod by Den_spb


It basically lets trains spawn on both sides of the tracks in 1 direction each.

Unfortunately, this mod adds custom objects (traffic lights) wich correspond to the trains positions but are notoriously glitchy.

Sometimes they wont load, sometimes they load wrong objects, sometimes they randomly dissapear and so on.

But no matter what goes wrong: the game crashes when a train approaches these objects in any case.


these objects are:

bltlm.dff

colltl.col

grtlm.dff

rdtlm.dff

tltxsm.txd

yltlm.dff


stored in a custom map file

tllgs.ide


and no, simply deleting those and their reference in gta.dat doesn't work.


Now, Den_spb hasn't been active for 3 years so I doubt there will ever be a revision/reduction of this mod. So I wanted to personally try fix it for my own game, NOT release his altered work or take any credit for it.

Unfortunately, I have no scripting experience.



EDIT:

Luckily i've found an older version of this mod without the additional objects, but unfortunately it will crash during missions. This was fixed in the later version, but I think it would be easier to start working from here on.



This is the cleo script :

 



// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013

{$CLEO .cs}


//-------------MAIN---------------

wait 0







wait 1000


:NONAME_51

wait 0

if


jf @NONAME_80

jump @NONAME_115


:NONAME_80


0209: [email protected] = random_int_in_ranges 15 46

wait 0




:NONAME_115

wait 0

if


jf @NONAME_144

jump @NONAME_179


:NONAME_144


0209: [email protected] = random_int_in_ranges 15 46

wait 0




:NONAME_179

wait 0

if and



jf @NONAME_216



:NONAME_216

wait 0

if and



jf @NONAME_253



:NONAME_253

wait 0

if


jf @NONAME_5499


if and




jf @NONAME_334

jump @NONAME_5499


:NONAME_334


if

not [email protected] >= 0.0

jf @NONAME_369

jump @NONAME_418


:NONAME_369

if


jf @NONAME_404


jump @NONAME_411


:NONAME_404



:NONAME_411

jump @NONAME_464


:NONAME_418

wait 0

if


jf @NONAME_457


jump @NONAME_464


:NONAME_457



:NONAME_464

wait 0

if


jf @NONAME_493

jump @NONAME_568


:NONAME_493

if


jf @NONAME_518

jump @NONAME_2047


:NONAME_518

if


jf @NONAME_543

jump @NONAME_3120


:NONAME_543

if


jf @NONAME_568

jump @NONAME_3903


:NONAME_568

wait 0




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519

if


jf @NONAME_2047

jump @NONAME_5499


:NONAME_2047

wait 0




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519


[email protected] = -1186.05


if


jf @NONAME_4519


[email protected] = -1484.06


if


jf @NONAME_4519


[email protected] = -1760.34


if


jf @NONAME_4519


[email protected] = -1953.75


if


jf @NONAME_4519


[email protected] = -1953.73


if


jf @NONAME_4519


[email protected] = -1948.14


if


jf @NONAME_4519


[email protected] = -1779.76


if


jf @NONAME_4519


[email protected] = -1556.24


if


jf @NONAME_4519


[email protected] = -1366.51


if


jf @NONAME_4519


[email protected] = -1333.63


if


jf @NONAME_4519

if


jf @NONAME_3120

jump @NONAME_5499


:NONAME_3120

wait 0


[email protected] = -1187.75


if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519


[email protected] = -1253.47


if


jf @NONAME_4519


[email protected] = -1133.88


if


jf @NONAME_4519


[email protected] = -1404.64


if


jf @NONAME_4519

[email protected] = -1113.11



if


jf @NONAME_4519

[email protected] = -1392.21

[email protected] = -1509.24


if


jf @NONAME_4519

[email protected] = -1676.36

[email protected] = -1465.42


if


jf @NONAME_4519

[email protected] = -1876.64



if


jf @NONAME_4519

[email protected] = -1976.75



if


jf @NONAME_4519

[email protected] = -1978.81



if


jf @NONAME_4519

if


jf @NONAME_3903

jump @NONAME_5499


:NONAME_3903

wait 0

[email protected] = -1980.12



if


jf @NONAME_4519

[email protected] = -1960.09



if


jf @NONAME_4519

[email protected] = -1944.42



if


jf @NONAME_4519

[email protected] = -1942.72



if


jf @NONAME_4519

[email protected] = -1756.16



if


jf @NONAME_4519

[email protected] = -1523.12



if


jf @NONAME_4519

[email protected] = -1290.21



if


jf @NONAME_4519

[email protected] = -1082.96



if


jf @NONAME_4519




if


jf @NONAME_4519




if


jf @NONAME_4519

if


jf @NONAME_4512

jump @NONAME_5499


:NONAME_4512

jump @NONAME_568


:NONAME_4519

wait 0



:NONAME_4530

wait 0

0209: [email protected] = random_int_in_ranges 0 16

if and



not [email protected] == 14

jf @NONAME_4530

wait 0







:NONAME_4621

not &0([email protected],1i) == 0

jf @NONAME_4676

wait 0

Model.Load(&0([email protected],1i))



jump @NONAME_4621


:NONAME_4676

038B: load_requested_models








:NONAME_4728

wait 0

if

not &0([email protected],1i) == 0

jf @NONAME_4792


:NONAME_4754

wait 0

if

Model.Available(&0([email protected],1i))

jf @NONAME_4754


jump @NONAME_4728


:NONAME_4792

wait 0






if or

&0([email protected],1i) == 0




jf @NONAME_4885

jump @NONAME_5039


:NONAME_4885

008B: [email protected] = &0([email protected],1i) // (int)


008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

&0([email protected],1i) = 0


:NONAME_5039

wait 0

if and

[email protected] == 2192.47

[email protected] == -357.99

jf @NONAME_5102

06D8: [email protected] = create_train_at [email protected] [email protected] 60.0 type [email protected] direction 1

jump @NONAME_5186


:NONAME_5102

wait 0

if and

[email protected] == 2122.11

[email protected] == -647.61

jf @NONAME_5165

06D8: [email protected] = create_train_at [email protected] [email protected] 70.0 type [email protected] direction 1

jump @NONAME_5186


:NONAME_5165

06D8: [email protected] = create_train_at [email protected] [email protected] 0.0 type [email protected] direction 1


:NONAME_5186

wait 0



06DC: set_train [email protected] acc 16.67

06DD: set_train [email protected] speed 16.67

[email protected] = Marker.CreateAboveCar([email protected])

Marker.SetColor([email protected], 0)

018B: set_marker [email protected] radar_mode 2






if and

not &0([email protected],1i) == 0


not [email protected] == 13

not [email protected] == 15

jf @NONAME_5422


&0([email protected],1i) = 0


008A: &0([email protected],1i) = [email protected] // (int)


008A: &0([email protected],1i) = [email protected] // (int)


008A: &0([email protected],1i) = [email protected] // (int)


008A: &0([email protected],1i) = [email protected] // (int)


:NONAME_5422






:NONAME_5454

not &0([email protected],1i) == 0

jf @NONAME_5499

wait 0

Model.Destroy(&0([email protected],1i))


jump @NONAME_5454


:NONAME_5499

wait 0

if


jf @NONAME_10670


if and



jf @NONAME_5573

jump @NONAME_10670


:NONAME_5573


if

not [email protected] >= 0.0

jf @NONAME_5608

jump @NONAME_5657


:NONAME_5608

if


jf @NONAME_5643


jump @NONAME_5650


:NONAME_5643



:NONAME_5650

jump @NONAME_5703


:NONAME_5657

wait 0

if


jf @NONAME_5696


jump @NONAME_5703


:NONAME_5696



:NONAME_5703

wait 0

if


jf @NONAME_5732

jump @NONAME_8214


:NONAME_5732

if


jf @NONAME_5757

jump @NONAME_7199


:NONAME_5757

if


jf @NONAME_5782

jump @NONAME_6358


:NONAME_5782

if


jf @NONAME_5807

jump @NONAME_5807


:NONAME_5807

wait 0




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816

[email protected] = -1030.44



if


jf @NONAME_9816

[email protected] = -1240.99



if


jf @NONAME_9816

[email protected] = -1342.19



if


jf @NONAME_9816

if


jf @NONAME_6358

jump @NONAME_10670


:NONAME_6358

wait 0

[email protected] = -1498.99



if


jf @NONAME_9816

[email protected] = -1601.06



if


jf @NONAME_9816

[email protected] = -1837.42



if


jf @NONAME_9816

[email protected] = -1948.42



if


jf @NONAME_9816

[email protected] = -1950.42



if


jf @NONAME_9816

[email protected] = -1982.39



if


jf @NONAME_9816

[email protected] = -1982.55



if


jf @NONAME_9816

[email protected] = -1971.89

[email protected] = -1059.67


if


jf @NONAME_9816

[email protected] = -1846.91

[email protected] = -1309.37


if


jf @NONAME_9816

[email protected] = -1629.08

[email protected] = -1486.73


if


jf @NONAME_9816

[email protected] = -1347.52

[email protected] = -1513.87


if


jf @NONAME_9816

[email protected] = -1053.53

[email protected] = -1508.42


if


jf @NONAME_9816


[email protected] = -1370.31


if


jf @NONAME_9816


[email protected] = -1128.25


if


jf @NONAME_9816

if


jf @NONAME_7199

jump @NONAME_10670


:NONAME_7199

wait 0


[email protected] = -1164.91


if


jf @NONAME_9816


[email protected] = -1223.16


if


jf @NONAME_9816


[email protected] = -1027.47


if


jf @NONAME_9816


[email protected] = -1026.41


if


jf @NONAME_9816


[email protected] = -1107.08


if


jf @NONAME_9816


[email protected] = -1266.07


if


jf @NONAME_9816


[email protected] = -1464.63


if


jf @NONAME_9816




if


jf @NONAME_9816


[email protected] = -1894.03


if


jf @NONAME_9816


[email protected] = -1957.68


if


jf @NONAME_9816


[email protected] = -1957.93


if


jf @NONAME_9816


[email protected] = -1957.85


if


jf @NONAME_9816


[email protected] = -1686.16


if


jf @NONAME_9816


[email protected] = -1407.02


if


jf @NONAME_9816


[email protected] = -1110.09


if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816

if


jf @NONAME_8214

jump @NONAME_10670


:NONAME_8214

wait 0




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816




if


jf @NONAME_9816

if


jf @NONAME_9809

jump @NONAME_10670


:NONAME_9809

jump @NONAME_5807


:NONAME_9816

wait 0



:NONAME_9827

wait 0

0209: [email protected] = random_int_in_ranges 0 16

if and



not [email protected] == 14

jf @NONAME_9827

wait 0







:NONAME_9918

not &0([email protected],1i) == 0

jf @NONAME_9973

wait 0

Model.Load(&0([email protected],1i))



jump @NONAME_9918


:NONAME_9973

038B: load_requested_models








:NONAME_10025

wait 0

if

not &0([email protected],1i) == 0

jf @NONAME_10089


:NONAME_10051

wait 0

if

Model.Available(&0([email protected],1i))

jf @NONAME_10051


jump @NONAME_10025


:NONAME_10089

wait 0






if or

&0([email protected],1i) == 0




jf @NONAME_10182

jump @NONAME_10336


:NONAME_10182

008B: [email protected] = &0([email protected],1i) // (int)


008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

008A: &0([email protected],1i) = [email protected] // (int)


008B: [email protected] = &0([email protected],1i) // (int)

&0([email protected],1i) = 0


:NONAME_10336

wait 0

06D8: [email protected] = create_train_at [email protected] [email protected] 0.0 type [email protected] direction 1



06DC: set_train [email protected] acc 16.67

06DD: set_train [email protected] speed 16.67

[email protected] = Marker.CreateAboveCar([email protected])

Marker.SetColor([email protected], 1)

018B: set_marker [email protected] radar_mode 2






if and

not &0([email protected],1i) == 0


not [email protected] == 13

not [email protected] == 15

jf @NONAME_10593


&0([email protected],1i) = 0


008A: &0([email protected],1i) = [email protected] // (int)


008A: &0([email protected],1i) = [email protected] // (int)


008A: &0([email protected],1i) = [email protected] // (int)


008A: &0([email protected],1i) = [email protected] // (int)


:NONAME_10593






:NONAME_10625

not &0([email protected],1i) == 0

jf @NONAME_10670

wait 0

Model.Destroy(&0([email protected],1i))


jump @NONAME_10625


:NONAME_10670

wait 0

if and



jf @NONAME_11116


0509: [email protected] = distance_between_XY 1474.903 2634.637 and_XY [email protected] [email protected]

if and



not [email protected] >= 1474.903

jf @NONAME_10795

06DD: set_train [email protected] speed 0.0


jump @NONAME_11116


:NONAME_10795

0509: [email protected] = distance_between_XY 2866.867 1246.492 and_XY [email protected] [email protected]

if and



[email protected] > 1246.492

jf @NONAME_10877

06DD: set_train [email protected] speed 0.0


jump @NONAME_11116


:NONAME_10877

0509: [email protected] = distance_between_XY 1696.873 -1955.769 and_XY [email protected] [email protected]

if and



[email protected] > 1696.873

jf @NONAME_10959

06DD: set_train [email protected] speed 0.0


jump @NONAME_11116


:NONAME_10959

0509: [email protected] = distance_between_XY 784.326 -1341.736 and_XY [email protected] [email protected]

if and



[email protected] > 784.326

jf @NONAME_11041

06DD: set_train [email protected] speed 0.0


jump @NONAME_11116


:NONAME_11041

0509: [email protected] = distance_between_XY -1943.779 183.2991 and_XY [email protected] [email protected]

if and



not [email protected] >= 183.2991

jf @NONAME_11116

06DD: set_train [email protected] speed 0.0



:NONAME_11116

wait 0

if and



jf @NONAME_11562


0509: [email protected] = distance_between_XY 1392.746 2634.255 and_XY [email protected] [email protected]

if and



[email protected] > 1392.746

jf @NONAME_11241

06DD: set_train [email protected] speed 0.0


jump @NONAME_11562


:NONAME_11241

0509: [email protected] = distance_between_XY 2867.267 1330.162 and_XY [email protected] [email protected]

if and



not [email protected] >= 1330.162

jf @NONAME_11323

06DD: set_train [email protected] speed 0.0


jump @NONAME_11562


:NONAME_11323

0509: [email protected] = distance_between_XY 1778.116 -1955.706 and_XY [email protected] [email protected]

if and



not [email protected] >= 1778.116

jf @NONAME_11405

06DD: set_train [email protected] speed 0.0


jump @NONAME_11562


:NONAME_11405

0509: [email protected] = distance_between_XY 841.0762 -1393.855 and_XY [email protected] [email protected]

if and



not [email protected] >= 841.0762

jf @NONAME_11487

06DD: set_train [email protected] speed 0.0


jump @NONAME_11562


:NONAME_11487

0509: [email protected] = distance_between_XY -1946.499 81.0843 and_XY [email protected] [email protected]

if and



[email protected] > 81.0843

jf @NONAME_11562

06DD: set_train [email protected] speed 0.0



:NONAME_11562

wait 0

if


jf @NONAME_11642

if and


01C1: car [email protected] stopped

jf @NONAME_11642


0209: [email protected] = random_int_in_ranges 15 21

wait 0




:NONAME_11642

wait 0

if


jf @NONAME_11722

if and


01C1: car [email protected] stopped

jf @NONAME_11722


0209: [email protected] = random_int_in_ranges 15 21

wait 0




:NONAME_11722

wait 0

if


jf @NONAME_11787

if and



jf @NONAME_11787


06DD: set_train [email protected] speed 16.67


:NONAME_11787

wait 0

if


jf @NONAME_11852

if and



jf @NONAME_11852


06DD: set_train [email protected] speed 16.67


:NONAME_11852

wait 0

if


jf @NONAME_11969




if


jf @NONAME_11969

Marker.Disable([email protected])

07BD: destroy_train [email protected]

07BE: remove_references_to_train [email protected]




:NONAME_11969

wait 0

if


jf @NONAME_12086




if


jf @NONAME_12086

Marker.Disable([email protected])

07BD: destroy_train [email protected]

07BE: remove_references_to_train [email protected]




:NONAME_12086

wait 0

if


jf @NONAME_12163

if and

not Actor.InCar($PLAYER_ACTOR, [email protected])

0203: actor $PLAYER_ACTOR near_car [email protected] radius 8.0 8.0 flag 0 on_foot

00E1: player 0 pressed_key 15

jf @NONAME_12163

05CB: AS_actor $PLAYER_ACTOR enter_car [email protected] as_driver 1 ms


:NONAME_12163

wait 0

if


jf @NONAME_12240

if and

not Actor.InCar($PLAYER_ACTOR, [email protected])

0203: actor $PLAYER_ACTOR near_car [email protected] radius 8.0 8.0 flag 0 on_foot

00E1: player 0 pressed_key 15

jf @NONAME_12240

05CB: AS_actor $PLAYER_ACTOR enter_car [email protected] as_driver 1 ms


:NONAME_12240

wait 0

if and



jf @NONAME_12310

if and

Actor.InCar($PLAYER_ACTOR, [email protected])

09AE: actor $PLAYER_ACTOR driving_train

jf @NONAME_12310


06DD: set_train [email protected] speed 0.0


:NONAME_12310

wait 0

if and



jf @NONAME_51

if and

Actor.InCar($PLAYER_ACTOR, [email protected])

09AE: actor $PLAYER_ACTOR driving_train

jf @NONAME_12380


06DD: set_train [email protected] speed 0.0


:NONAME_12380

jump @NONAME_51



 



Can anyone help me out making the code "disabled during missions" ?


Another idea was to reverse each trains direction so they are the same like during the story missions (snail trail, wrong side of the tracks...) but that would just be a "bonus". First of i'd like to get this working in the first place.

Edited by hlennarz

Share this post


Link to post
Share on other sites
hlennarz

bump

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.