:
Destination Time
:
Present Time
:
Last Time Departed
BTTFModMachine

Back To The Future: San Andreas Modifications by BTTFModMachine

Recommended Posts

In beta 3, it includes uokka's TC scripts and bttf.fxt. If you don't have beta 3, the time circuits don't show. You are using beta 2, then.

now you see the time circuit but crashed if i press a number

Share this post


Link to post
Share on other sites

I'm thinking of redoing the teleport script. I found a teleport to marker script by loquendomax9814 for BTTF SA:

:T_CIRC_6120


if and
3@ >= 0
not 3@ >= 1600
else_jump @T_CIRC_6327
0AB6: store_target_marker_coords_to 0@ 1@ 2@ // IF and SET
04E4: refresh_game_renderer_at 0@ 1@
Camera.SetAtPos(0@, 1@, 3@)
0811: 4@ = actor $PLAYER_ACTOR used_car
0A97: 5@ = car 4@ struct
5@ += 1224
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
if
5@ > 0
else_jump @T_CIRC_6273
07AC: detach_trailer 6@ from_cab 4@
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang
wait 0
0893: put_trailer 6@ on_cab 4@
jump @T_CIRC_6289

:T_CIRC_6273
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang

:T_CIRC_6289
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang
return
Actor.Angle($PLAYER_ACTOR) = 77.0
0@ = Actor.CurrentCar($PLAYER_ACTOR)
return

:T_CIRC_6327
if and
0AB6: store_target_marker_coords_to 0@ 1@ 3@ // IF and SET
04E4: refresh_game_renderer_at 0@ 1@
Camera.SetAtPos(0@, 1@, 3@)
0811: 4@ = actor $PLAYER_ACTOR used_car
0A97: 5@ = car 4@ struct
5@ += 1224
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
if
5@ > 0
else_jump @T_CIRC_6458
07AC: detach_trailer 6@ from_cab 4@
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang
wait 0
0893: put_trailer 6@ on_cab 4@
jump @T_CIRC_6474

:T_CIRC_6458
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang

:T_CIRC_6474
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang
return
if
3@ >= 1900
0AB6: store_target_marker_coords_to 0@ 1@ 3@ // IF and SET
04E4: refresh_game_renderer_at 0@ 1@
Camera.SetAtPos(0@, 1@, 3@)
0811: 4@ = actor $PLAYER_ACTOR used_car
0A97: 5@ = car 4@ struct
5@ += 1224
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
if
5@ > 0
else_jump @T_CIRC_6631
07AC: detach_trailer 6@ from_cab 4@
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang
wait 0
0893: put_trailer 6@ on_cab 4@
jump @T_CIRC_6647

:T_CIRC_6631
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang

:T_CIRC_6647
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang
return

I have never seen a teleport script formed like this. Can someone help me figure out how to set specific locations by year rather than a marker location?

Share this post


Link to post
Share on other sites

Hmm, this looks pretty familiar to a teleport script I wrote.

Not saying he did 'stole' my work though. I think I didn't share it. I wouldn't care anyway.

However, I can try adopting my teleport script to use fixed location for certain years.

IIRC, 'Year' is stored in a global CLEO variable..

  • Like 1

Share this post


Link to post
Share on other sites

Whow about that (not yet edited):

{$CLEO .cs}

//-------------MAIN---------------
0000: NOP

while true
    wait 0
    if and
    0AB0:   key_pressed 17  // 'Ctrl'
    0AB0:   key_pressed 84  // 't'
    jf continue
     
    if
    0AB6:   store_target_marker_coords_to 0@ 1@ 2@ // IF and SET
    jf continue
    02CE: 3@ = ground_z_at 0@ 1@ 2@
    
    0169: set_fade_color_RGB 0 0 0
    // -- "Teletrans (Junior_Djjr).cs"
    016A: fade 0 time 50
    wait 100
    04E4: refresh_game_renderer_at 0@ 1@
    03CB: set_rendering_origin_at 0@ 1@ 3@
    // --    

    IF
    actor.Driving($PLAYER_ACTOR)
    THEN
        0811: 4@ = actor $PLAYER_ACTOR car_nosave
        0A97: 5@ = car 4@ struct
        5@ += 0x4C8  // Trailer of car
        0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
        if
        5@ > 0
        then  //->  We have a trailer
            0AEB: 6@ = car_struct 5@ handle
            07AC: detach_trailer 6@ from_car 4@
            08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
            wait 0
            0893: put_trailer 6@ on_car 4@
        else
            08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
        end
    ELSE
        08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
        //00A1: put_actor $PLAYER_ACTOR at 0@ 1@ 3@            
    END
    
    016A: fade 1 time 50
     
    WHILE TRUE
        wait 0
        if
        //0AB0:   key_pressed 17  // 'Ctrl'
        0AB0:   key_pressed 84  // 't'
        then
        else
            wait 100
            break
        end
    END
end

{
:Teleport
// -- "Teletrans (Junior_Djjr).cs"
0172: 0@ = actor $PLAYER_ACTOR Z_angle
016A: fade 0 time 200
wait 250 ms
04E4: unknown_refresh_game_renderer_at 0@ 1@
03CB: set_rendering_origin_at 0@ 1@ 2@
00A1: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0
0173: set_actor $PLAYER_ACTOR Z_angle_to @
016A: fade 1 time 300
wait 0 ms
02EB: restore_camera_with_jumpcut
wait 500
return
}
  • Like 1

Share this post


Link to post
Share on other sites

This kinda works. It would be more elegant to include it in timetravel.s or something but you get the idea.

{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 

while true
    wait 0
    if 
        not Player.Defined($PLAYER_CHAR)
    then
        wait 250
        jump continue
    end
    
    IF AND
    Player.Controllable($PLAYER_CHAR)
    0AB0:   key_pressed 17  // 'Ctrl'
    0AB0:   key_pressed 84  // 't'
    THEN
        if
        0AB1: call_scm_func @GetTargetMarkerCoords 0 store_to 0@ 1@ 2@ 3@
        jf continue

        0169: set_fade_color_RGB 0 0 0
        // -- "Teletrans (Junior_Djjr).cs"
        016A: fade 0 time 50 
        wait 100
    ELSE
        // Check to see if time machine is traveling
        0AB4: 7@ = var 0 
        if 
            7@ == 1 
        jf continue

        // Wait until time change flag is triggered
        repeat
            wait 10
            0AB4: 7@ = var 9
        until 7@ == 1

        0AB4: 7@ = var 3  // Var 3: Destination MDY
        if 
        7@ > 0
        jf continue
        
        0085: 8@ = 7@ // (int)
        7@ /= 10000
        7@ *= 10000
        0062: 8@ -= 7@ // (int)
        
        if
        0AB1: call_scm_func @GetTargetByYear 1 8@ store_to 0@ 1@ 2@ 3@
        jf continue

        // Wait until done time travelling
        repeat
            wait 10
            0AB4: 7@ = var 0  // Var 0: Time Travel Flag
        until 7@ == 0
    END
    
    04E4: refresh_game_renderer_at 0@ 1@
    03CB: set_rendering_origin_at 0@ 1@ 3@
    // --    

    IF
    actor.Driving($PLAYER_ACTOR)
    THEN
        0811: 4@ = actor $PLAYER_ACTOR car_nosave
        
        06A2: get_car 4@ velocity_in_direction_XYZ 10@ 11@ 12@

        0A97: 5@ = car 4@ struct
        5@ += 0x4C8  // Trailer of car
        0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
        if
        5@ > 0
        then  //->  We have a trailer
            0AEB: 6@ = car_struct 5@ handle
            07AC: detach_trailer 6@ from_car 4@ 
            08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
            wait 0
            0893: put_trailer 6@ on_car 4@
        else
            08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
        end

        10@ /= 50.0
        11@ /= 50.0
        12@ /= 50.0
        
        07D5: set_car 4@ velocity_in_direction_XYZ 10@ 11@ 12@ rotation_velocitiesXY 0.0 0.0 unk 0.0

    ELSE
        08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
        //00A1: put_actor $PLAYER_ACTOR at 0@ 1@ 3@            
    END
    
    016A: fade 1 time 50 
     
    WHILE TRUE
        wait 0
        if
        //0AB0:   key_pressed 17  // 'Ctrl'
        0AB0:   key_pressed 84  // 't'
        then
        else
            wait 100
            break
        end
    END 
end


:GetTargetMarkerCoords
if 
0AB6:   store_target_marker_coords_to 0@ 1@ 2@ // IF and SET 
then
    02CE: 3@ = ground_z_at 0@ 1@ 2@
    0AB2: ret 4 0@ 1@ 2@ 3@
else
    059A:  return_false
end

:GetTargetByYear
if
0@ < 0
then
    0AD1: show_formatted_text_highpriority "WARNING!~n~The Space-Time-Continuum is about to collapse.." time 3500
    059A:  return_false
else
    IF
    0@ > 2015
    THEN
        0AD1: show_formatted_text_highpriority "Will the world have ended?~n~Destination Year:~n~%d" time 1000 0@
        // TEST - LV Stadium
        0@ = 1099.7675
        1@ = 1530.5302
        2@ = 52.5875
    ELSE
        if
        0@ == 2015
        then
            0AD1: show_formatted_text_highpriority "Lets go to the future!~n~Destination Year:~n~%d" time 1000 0@
            // TEST - LV Airport
            0@ = 1412.1206
            1@ = 1566.6691
            2@ = 18.1073
        else
            IF
            0@ == 1985
            THEN
                0AD1: show_formatted_text_highpriority "Uh, yeah.. The 80s!~n~Destination Year:~n~%d" time 1000 0@
            ELSE
                if
                0@ == 1955
                then
                    0AD1: show_formatted_text_highpriority "uokk'N'Roll, baby!~n~Destination Year:~n~%d" time 1000 0@
                else
                    IF
                    0@ == 1885
                    THEN
                        0AD1: show_formatted_text_highpriority "Beware the cows, boy!~n~Destination Year:~n~%d" time 1000 0@
                    ELSE
                        if
                        0@ < 1885
                        then
                            0AD1: show_formatted_text_highpriority "Don't get erased from existance by killing anyone!~n~Destination Year:~n~%d" time 1000 0@
                        else
                            0AD1: show_formatted_text_highpriority "~n~Destination Year:~n~%d" time 1000 0@
                        end
                    END
                end
            END
        end
    END
end
02CE: 3@ = ground_z_at 0@ 1@ 2@
0AB2: ret 4 0@ 1@ 2@ 3@


{
:Teleport
// -- "Teletrans (Junior_Djjr).cs"
0172: 0@ = actor $PLAYER_ACTOR Z_angle 
016A: fade 0 time 200 
wait 250 ms 
04E4: unknown_refresh_game_renderer_at 0@ 1@
03CB: set_rendering_origin_at 0@ 1@ 2@
00A1: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 
0173: set_actor $PLAYER_ACTOR Z_angle_to @ 
016A: fade 1 time 300 
wait 0 ms 
02EB: restore_camera_with_jumpcut 
wait 500 
return 
}

Share this post


Link to post
Share on other sites

I'd like to include this in timecircuits.cs, so that when teleporting is on, a delorean could travel to 88MPH and teleport. Could you add this feature into your script?

Share this post


Link to post
Share on other sites

Confused O.o

This is exactly what the above script does. Have you tryed it?

Or are you asking me to add teleporting to my 'BttF_TimeTravel.s' from my edits?

Edited by uokka

Share this post


Link to post
Share on other sites

Oh. I see. I'll try it out. So if I wanted to call this function up front, how would I activate it?

Edited by BTTFModMachine

Share this post


Link to post
Share on other sites

I have added coords only for 2015 and above 2015. So if you time travel there, it will teleport you to Las Venturas.

Share this post


Link to post
Share on other sites

I've encountered a bug in the script.

I modified it to teleport for all years less than 3000. However, when I time travel, first I travel to the year specified, and don't teleport. Then, I travel again in the same year, and then teleport.

Here's the modified code:

// This file was decompiled using SASCM.INI published by GTAG (

http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}
//-------------MAIN---------------
0000: NOP
0000: NOP
while true
wait 0
if
not Player.Defined($PLAYER_CHAR)
then
wait 250
jump continue
end
IF AND
Player.Controllable($PLAYER_CHAR)
0AB0: key_pressed 17 // 'Ctrl'
0AB0: key_pressed 84 // 't'
THEN
if
0AB1: call_scm_func @GetTargetMarkerCoords 0 store_to 0@ 1@ 2@ 3@
jf continue
0169: set_fade_color_RGB 0 0 0
// -- "Teletrans (Junior_Djjr).cs"
016A: fade 0 time 50
wait 100
ELSE
// Check to see if time machine is traveling
0AB4: 7@ = var 0
if
7@ == 1
jf continue
// Wait until time change flag is triggered
repeat
wait 10
0AB4: 7@ = var 9
until 7@ == 1
0AB4: 7@ = var 3 // Var 3: Destination MDY
if
7@ > 0
jf continue
0085: 8@ = 7@ // (int)
7@ /= 10000
7@ *= 10000
0062: 8@ -= 7@ // (int)
if
0AB1: call_scm_func @GetTargetByYear 1 8@ store_to 0@ 1@ 2@ 3@
jf continue
// Wait until done time travelling
repeat
wait 10
0AB4: 7@ = var 0 // Var 0: Time Travel Flag
until 7@ == 0
END
04E4: refresh_game_renderer_at 0@ 1@
03CB: set_rendering_origin_at 0@ 1@ 3@
// --
IF
actor.Driving($PLAYER_ACTOR)
THEN
0811: 4@ = actor $PLAYER_ACTOR car_nosave
06A2: get_car 4@ velocity_in_direction_XYZ 10@ 11@ 12@
0A97: 5@ = car 4@ struct
5@ += 0x4C8 // Trailer of car
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
if
5@ > 0
then //-> We have a trailer
0AEB: 6@ = car_struct 5@ handle
07AC: detach_trailer 6@ from_car 4@
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
wait 0
0893: put_trailer 6@ on_car 4@
else
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
end
10@ /= 50.0
11@ /= 50.0
12@ /= 50.0
07D5: set_car 4@ velocity_in_direction_XYZ 10@ 11@ 12@ rotation_velocitiesXY 0.0 0.0 unk 0.0
ELSE
08C7: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0 dont_warp_gang // versionB
//00A1: put_actor $PLAYER_ACTOR at 0@ 1@ 3@
END
016A: fade 1 time 50
WHILE TRUE
wait 0
if
//0AB0: key_pressed 17 // 'Ctrl'
0AB0: key_pressed 84 // 't'
then
else
wait 100
break
end
END
end
:GetTargetMarkerCoords
if
0AB6: store_target_marker_coords_to 0@ 1@ 2@ // IF and SET
then
02CE: 3@ = ground_z_at 0@ 1@ 2@
0AB2: ret 4 0@ 1@ 2@ 3@
else
059A: return_false
end
:GetTargetByYear
if
0@ < 0
then
059A: return_false
else
if and
0@ >= 0
not 0@ >= 1000
then
0@ = -1820.555
1@ = -2089.922
2@ = 55.5889
else
if and
0@ >= 1000
not 0@ >= 1600
then
0@ = 2756.435
1@ = -621.6856
2@ = 58.272
else
if and
0@ >= 1600
not 0@ >= 1900
then
0@ = -1110.704
1@ = 2429.655
2@ = 81.19
else
if and
0@ >= 1900
not 0@ >= 1920
then
0@ = -2153.866
1@ = -2314.685
2@ = 30.4687
else
if and
0@ >= 1920
not 0@ >= 1950
then
0@ = -2153.866
1@ = -2314.685
2@ = 30.4687
else
if
0@ == 11051955
then
0@ = 20.4977
1@ = 1570.705
2@ = 12.8015
else
if and
0@ >= 1950
not 0@ >= 1960
not 0@ == 11051955
then
0@ = -86.4811
1@ = 1446.97
2@ = 9.2227
else
if and
0@ >= 1960
not 0@ >= 1970
then
0@ = -197.9514
1@ = 1110.84
2@ = 19.3084
else
if and
0@ >= 1970
not 0@ >= 1980
then
0@ = 2336.76
1@ = 121.9491
2@ = 26.4843
else
if and
0@ >= 1980
not 0@ >= 1990
then
0@ = 2336.76
1@ = 121.9491
2@ = 26.4843
else
if and
0@ >= 1990
not 0@ >= 2000
then
0@ = -2551.826
1@ = 2333.216
2@ = 4.5451
else
if and
0@ >= 2000
not 0@ >= 2010
then
0@ = -2551.826
1@ = 2333.216
2@ = 4.5451
else
if
0@ == 2854
then
0@ = 476.6376
1@ = -1726.982
2@ = 10.8785
else
if and
0@ >= 2010
not 0@ >= 3000
not 0@ == 2854
then
0@ = 1168.638
1@ = -1403.744
2@ = 13.711
else
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
02CE: 3@ = ground_z_at 0@ 1@ 2@
0AB2: ret 4 0@ 1@ 2@ 3@
{
:Teleport
// -- "Teletrans (Junior_Djjr).cs"
0172: 0@ = actor $PLAYER_ACTOR Z_angle
016A: fade 0 time 200
wait 250 ms
04E4: unknown_refresh_game_renderer_at 0@ 1@
03CB: set_rendering_origin_at 0@ 1@ 2@
00A1: put_actor $PLAYER_ACTOR at 0@ 1@ -100.0
0173: set_actor $PLAYER_ACTOR Z_angle_to @
016A: fade 1 time 300
wait 0 ms
02EB: restore_camera_with_jumpcut
wait 500
return

}

Edited by BTTFModMachine

Share this post


Link to post
Share on other sites

Strange, worked for me so far.

Anyway, its just an example to help you make it work - in theorie.

I'm currently trying to implement teleporting into 'BttF_TimeTravel.s'.

"IF" I will succeed (very little amount of variables left), it might be easy for you to edit your version accordingly. It's just a little bit of code.

Share this post


Link to post
Share on other sites

Yes but too early. Meaning fire trails will be at teleport location.

Share this post


Link to post
Share on other sites

Interesting. Cutscene time travel teleporting doesn't work for me at all.

I think I know why when I time travel, first I travel to the year specified, and don't teleport. Then, I travel again in the same year, and then teleport. It is depending on the current year variable. When I set the destination time, the year hasn't changed yet, so I don't teleport. Then, the year has changed, so the next time I time travel in that year, I teleport. I think it should read from the destination year, not the current year variable.

Unfortunately, there is no destination year variable. Does anyone have any suggestions?

Share this post


Link to post
Share on other sites

0AB4: 7@ = var 3 // Var 3: Destination MDY

--

Anyway, this script is really not meant to work correctly. I did about 5 minutes of testing.

The teleporting stuff should be included in timetravel.s to make use of cutscene and remote controlling etc without duplicating code over several scripts.

Edited by uokka

Share this post


Link to post
Share on other sites

Thats exactly what I did.

If destination DMY is "31121992" (Dec 31st 1992),

0AB4: 7@ = var 3 // Var 3: Destination MDY
if 
7@ > 0
jf continue

0085: 8@ = 7@ // (int)
7@ /= 10000
7@ *= 10000
0062: 8@ -= 7@ // (int)

it will become "1992"

Share this post


Link to post
Share on other sites

Well I see you guys have a lot of work with that script...I already told that I have bug after bug after bug with the installation of Delorean88MP's mod. But now I have trouble with the official mod for GTA SA as well. Does anybody knows what source codes I need to make it work ?

At this moment I have the standard game installed, the official mod from bttfhillvalley and source-code gtasa_20101105 which is the latest source-code. I also installed the new models and the new animation.ide. Do I need to install other source-codes before I install this one ?

The most common error I get is this one:

GTA:SA Crashed, Debug Info Follows:

GTA Info:

Version: US 1.0
Last File Loaded: cleo\DOOR.S
Last Library Loaded: C:\Program Files\VistaCodecPack\filters\bass_wv.dll
Error: Unknown

Assembly Info:

Exception At Address: 0x01565110
Exception Code: 0xc0000005 (EXCEPTION_ACCESS_VIOLATION)

Registers:

EAX: 0x00000000 EBX: 0x00000001
ECX: 0x00000000 EDX: 0x00002906
ESI: 0x0226C044 EDI: 0x00000000
EBP: 0x000007C5 ESP: 0x0022FB78

All the time that door.s file from the cleo-map, and this error happens whenever CJ is in the time-machine and when I go from normal mode to hover mode. The moment the wheel animation is playing...what could this be ?

Edited by Darth-Sidious

Share this post


Link to post
Share on other sites

@Darth-Sidious, I'd say you're actually pretty off-topic..

You need only the latest 'source code'. It will replace the old scripts.

About the 'patches' (Models 11242009) I'm not absolutely sure. They are older than the latest 'main release', though.

So I'd say you have the correct stuff.

Unfortunately, those debug messages don't provide any info for mortals like us (or me at least). It needs pretty skilled hackers to investigate those memory addresses and find out what happened. I havn't seen anyone replying to such things here.

The "last file loaded" does not tell you that this file contains a bug.

Yep, it definitely has its bugs. In my edits, I removed some models and sounds. I'm speculating that, besides scripting bugs, GTAs limits are getting exceeded. Thats why SALA is used by the mod to increasing certain limits which again makes the game unstable too.

However, crashes micht also be caused by incorrectly editing the came files, meaning the tools used for installing might have messed up something in the first place. You could try extracting the files from the installer using 7zip and install manuall using IMG Tool or similar.

--

@BTTFModMachine,

I'm half way through with 'timetravel.s'. I'm making a 'function' that you can add at the end of the script and then call it from anywhere in that script so no need to move hand over hand and edit small parts everywhere. I'm having difficulties though setting the camera position while in cut scene. And I can't really test it for remote controlling because my remote script is super bugged. :P

Edited by uokka

Share this post


Link to post
Share on other sites

@Darth-Sidious, I'd say you're actually pretty off-topic..

Sorry for that Uokka I know it's off-topic but I can't report bugs and errors in the topic for it...So I don't know where to ask questions about bugs and error for the official bttfhillvalley mod....but thnxsss anyway mate !

Edited by Darth-Sidious

Share this post


Link to post
Share on other sites

@Darth-Sidious,

yeah, I understand. You can choose original bugs or user made bugs. q:

@BTTFModMachine,

The edited 'BttF_TimeTravel.s' works pretty well.

I tryed to set the camera behind the car when time traveling in cut scene mode but that would need dozens of lines of code for funky math stuff because there seems to be no simple opcode available for that. I decided its not necessary.

I left out remote controlled teleporting. Who needs that anyway.

As you might have noticed, the car keeps its velocity. You better be aware of that when teleporting near buildings etc. (;

OK.. put all this stuff at the very end of your timetravel.s so "nothing" is after that (except other functions or gosubs which do a 'return').

:TimeTeleport    
0AB4: 3@ = var 3  // Var 3: Destination MDY
0085: 4@ = 3@ // (int)
4@ /= 10000
4@ *= 10000
0062: 3@ -= 4@ // (int)

if
0AB1: call_scm_func @GetTargetByYear 1 3@ store_to 4@ 5@ 6@ 10@
then
else
    if
    0AB1: call_scm_func @GetTargetMarkerCoords 0 store_to 4@ 5@ 6@ 10@
    then
    else
        //0407: store_coords_to 2@ 3@ 4@ from_car 0@ with_offset 0.0 0.0 0.0
        059A:  return_false
    end
end

0AB4: 11@ = var 11
if
    11@ == 0
then
    06A2: get_car 0@ velocity_in_direction_XYZ 7@ 8@ 9@
    04E4: refresh_game_renderer_at 4@ 5@
    03CB: set_rendering_origin_at 4@ 5@ 10@
    08C7: put_actor $PLAYER_ACTOR at 4@ 5@ -100.0 dont_warp_gang // versionB
    7@ /= 50.0
    8@ /= 50.0
    9@ /= 50.0    
    07D5: set_car 0@ velocity_in_direction_XYZ 7@ 8@ 9@ rotation_velocitiesXY 0.0 0.0 unk 0.0
else
    04E4: refresh_game_renderer_at 4@ 5@
    03CB: set_rendering_origin_at 4@ 5@ 10@
    0815: put_object 1@ at 4@ 5@ 6@ and_keep_rotation
end    
0AB2: ret 3 4@ 5@ 6@

:GetTargetMarkerCoords
if
0AB6:   store_target_marker_coords_to 0@ 1@ 2@ // IF and SET
then
    02CE: 3@ = ground_z_at 0@ 1@ 2@
    0AB2: ret 4 0@ 1@ 2@ 3@
else
    059A:  return_false
end

:GetTargetByYear
if
0@ < 0
then
    0AD1: show_formatted_text_highpriority "WARNING!~n~The Space-Time-Continuum is about to collapse.." time 3500
    059A:  return_false
else
    IF
    0@ > 2015
    THEN
        0AD1: show_formatted_text_highpriority "Where is my scooter brother?" time 4500
        // TEST - LV Stadium
        0@ = 1099.7675
        1@ = 1530.5302
        2@ = 52.5875
        0485:  return_true
    ELSE
        if
        0@ == 2015
        then
            0AD1: show_formatted_text_highpriority "Welcome to the future!" time 4500
            // TEST - LV Airport
            0@ = 1412.1206
            1@ = 1566.6691
            2@ = 18.1073
            0485:  return_true
        else
            IF
            0@ == 1985
            THEN
                0AD1: show_formatted_text_highpriority "Uh, yeah.. The 80s!" time 4500
                059A:  return_false
            ELSE
                if
                0@ == 1955
                then
                    0AD1: show_formatted_text_highpriority "uokk'N'Roll, baby!" time 4500
                    059A:  return_false
                else
                    IF
                    0@ == 1885
                    THEN
                        0AD1: show_formatted_text_highpriority "Beware the cows, boy!" time 4500
                        059A:  return_false
                    ELSE
                        if
                        0@ < 1885
                        then
                            0AD1: show_formatted_text_highpriority "Don't get erased from existance by killing anyone!" time 4500
                            059A:  return_false
                        else
                            0AD1: show_formatted_text_highpriority "~n~Welcome to~n~%d" time 4500 0@
                            059A:  return_false
                        end
                    END
                end
            END
        end
    END
end
02CE: 3@ = ground_z_at 0@ 1@ 2@
0AB2: ret 4 0@ 1@ 2@ 3@
 

Then scroll back up (at about line 165 in my script) and insert this line.

0AB1: call_scm_func @TimeTeleport 2 0@ 0 store_to 11@ 12@ 13@

It has to be placed in the part of the code which handles instant time traveling.

EXAMPLE:

            ...
            0AB3: var 0 = 1                
            // Instant Time Travel  
            0AB4: 30@ = var 11
            if
                30@ == 0
            then
            
                0AB1: call_scm_func @TimeTeleport 2 0@ 0 store_to 11@ 12@ 13@    //  <--  Only me!

                0AB4: 24@ = var 900
                0AAD: set_mp3 24@ perform_action 0                
                0AC5: link_3d_audiostream 24@ to_vehicle 0@
                0AAD: set_mp3 24@ perform_action 1
                0169: set_fade_color_RGB 255 255 255
                016A: fade 0 time 0

                // Regenerate world and clear wanted level
                03BA: clear_cars_from_cube_cornerA -100000.0 -100000.0 -100000.0  cornerB 100000.0  100000.0  100000.0
                042B: clear_peds_from_cube_cornerA -100000.0 -100000.0 -100000.0  cornerB 100000.0  100000.0  100000.0
                06DB: destroy_all_trains
                0395: clear_area 2 at 11@ 12@ 13@ radius 100000.0
                Player.ClearWantedLevel($PLAYER_CHAR)
                0AB3: var 9 = 1
                wait 50 
                ...

Now, for the cut scene mode, the line is slightly different !

0AB1: call_scm_func @TimeTeleport 2 0@ 30@ store_to 11@ 12@ 13@

In my code edits, it's about 60 lines below.

EXAMPLE:

            ...
            else                
                // Disable shadows.  They still show if you're invisible.                                       
                0A8D: 2@ = read_memory 0xA9AE54 size 1 virtual_protect 0
                0A8C: write_memory 0xA9AE54 size 1 value 0 virtual_protect 0
                // Make character unable to leave car and ignored_by_everyone
                07CC: set_player $PLAYER_CHAR button_15 0
                03BF: set_player $PLAYER_CHAR ignored_by_everyone 1
                gosub @TimeEntry
                wait 500
                0169: set_fade_color 0 0 0
                016A: fade 0 time 500
                wait 500                      
                0650: destroy_particle 18@
                0650: destroy_particle 19@

                0AB1: call_scm_func @TimeTeleport 2 0@ 30@ store_to 11@ 12@ 13@    //  <--  Me too!
 
                03BA: clear_cars_from_cube_cornerA -100000.0 -100000.0 -100000.0  cornerB 100000.0  100000.0  100000.0
                042B: clear_peds_from_cube_cornerA -100000.0 -100000.0 -100000.0  cornerB 100000.0  100000.0  100000.0
                06DB: destroy_all_trains
                0395: clear_area 2 at 11@ 12@ 13@ radius 100000.0
                Player.ClearWantedLevel($PLAYER_CHAR)
                0AB3: var 9 = 1  
                wait 1400
                016A: fade 1 time 500
                wait 1000
            end
            ...

oops, made a mistake. Edited..

Edited by uokka
  • Like 1

Share this post


Link to post
Share on other sites