:
Destination Time
:
Present Time
:
Last Time Departed
BTTFModMachine

Teleport Code By Year: BTTF SA Problem

Recommended Posts

I've been making a teleport code for the BTTFSA mod, and I've run into some trouble. I added a section of code like so:

:T_CIRC_6080


if and
3@ >= 0
not 3@ >= 1600
jf @T_CIRC_6138
Actor.PutAt($PLAYER_ACTOR, -522.182, -2028.447, 51.1887)
Actor.Angle($PLAYER_ACTOR) = 77.0
Player.CanMove($PLAYER_CHAR) = True
return

:T_CIRC_6138
if and
3@ >= 1600
not 3@ >= 1900
jf @T_CIRC_6195
Actor.PutAt($PLAYER_ACTOR, -797.725, 2349.927, 118.7565)
Actor.Angle($PLAYER_ACTOR) = 267
Player.CanMove($PLAYER_CHAR) = True
return


:T_CIRC_6195
if
3@ >= 1900
Player.CanMove($PLAYER_CHAR) = True
return

And a gosub at the beginning to call to it:

gosub @T_CIRC_6080 

However, when I time travel, I can't move from the designated position I chose. I am probably missing something, but I can't seem to find it.

I would appreciate any coding advice.

See you here...or there... :roll:

-BTTFModMachine

Share this post


Link to post
Share on other sites
Player.CanMove($PLAYER_CHAR, true)
  • Like 1

Share this post


Link to post
Share on other sites

Thanks. I tried your suggestion, but it still gives the same result. My car is still stuck and can't move, and when I get out of the car, I seem to snap to the center of the car and remain immobilized.

I think the problem is the year. I want it to go to the location, but not stay there. Hmmm...

Share this post


Link to post
Share on other sites

hmm, maybe:

03C0: 0@ = actor $PLAYER_ACTOR car

00A1: put_actor $PLAYER_ACTOR at -522.182 -2028.447 51.1887
0175: set_car 0@ Z_angle_to 77.0

00A1: put_actor ... works for vehicles too but maybe .Angle() & .CanMove() doesn't ?



This is my teleport script - Not related to BTTF.

Teleports player (and if driving) together with vehicle.

{$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
    016A: fade 0 time 50
    wait 100
    04E4: unknown_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_cab 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 84  // 't'
        then
        else
            wait 100
            break
        end
    END
end 


Share this post


Link to post
Share on other sites

Thanks, I tried that. Now it crashes instead of snapping me to the middle of the car when I get out. :P

I had an idea. If I could get it to teleport me and then end that section of the code and allow me to move around (Ignore the year). That might work. Like an end sub command.

Share this post


Link to post
Share on other sites

add jump @T_CIRC_126 I'm doing my addon too and this worked. Minus is that time circuits are dissappearing. They're working but we don't see them in the year where you have this jump and actor.putat...

Edited by oswi54

Share this post


Link to post
Share on other sites

Jump lables like :T_CIRC_126 are generated by sanny when decompiling a script. If you decompile a modified version those lables change.

Which script are you editing anyway?

Share this post


Link to post
Share on other sites

em ok... kinda weird cause you can use search (ctrl+f) but...

// This file was decompiled using SASCM.INI published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007

{$VERSION 3.1.0027}
{$CLEO .cs}

//-------------MAIN---------------
thread "T_CIRC" 
0AB3: var 7 = 6101992 
0A95: enable_thread_saving 
16@ = 0 
21@ = 0 
23@ = 1 
25@ = 1 
27@ = 1 
gosub @T_CIRC_2352

:T_CIRC_63
wait 0 
gosub @T_CIRC_2446 
gosub @T_CIRC_7327 
03F0: enable_text_draw 1 
if 
   Player.Defined($PLAYER_CHAR)
jf @T_CIRC_63 
0AB4: 0@ = var 0 
if 
  0@ == 1 
jf @T_CIRC_324 

:T_CIRC_126
wait 0 
03F0: enable_text_draw 1 
0AB4: 0@ = var 9 
if 
  0@ == 1 
jf @T_CIRC_126
0AB4: 1@ = var 7 
0AB3: var 5 = 1@ 
00BF: 1@ = current_time_hours, 2@ = current_time_minutes 
1@ *= 100 
005A: 1@ += 2@ // (int) 
0AB3: var 6 = 1@ 
0AB4: 1@ = var 3 
0AB3: var 7 = 1@ 
0AB4: 1@ = var 4 
0AB1: call_scm_func @T_CIRC_8459 2 1@ 100 2@ 
1@ /= 100 
00C0: set_current_time_hours_to 1@ minutes_to 2@ 
0AB3: var 9 = 0 
gosub @T_CIRC_2352 
gosub @T_CIRC_2446 
gosub @T_CIRC_8156 
gosub @T_CIRC_7327 

:T_CIRC_291
wait 0 
03F0: enable_text_draw 1 
0AB4: 0@ = var 0 
if 
  0@ == 0 
jf @T_CIRC_291 

:T_CIRC_324
0AB4: 0@ = var 0 
if 
  0@ == 0 
jf @T_CIRC_63 
if 
  25@ == 1 
jf @T_CIRC_63 
0AB4: 26@ = var 8 
if 
   not Car.Wrecked(26@)
jf @T_CIRC_63 
if 
   Actor.InCar($PLAYER_ACTOR, 26@)
jf @T_CIRC_63 
gosub @T_CIRC_2370 
gosub @T_CIRC_7307 
0AB4: 0@ = var 1 
if and
   not 0@ == 0 
  27@ == 1 
jf @T_CIRC_63 
15@ = 200.0 
0AB4: 0@ = var 10 
if 
   not 0@ >= 2 
jf @T_CIRC_591 
1@ = 255 
2@ = 50 
3@ = 50 
if or
   Car.Model(26@) == #SUPERGT
   Car.Model(26@) == #BULLET
   Car.Model(26@) == #BUFFALO
jf @T_CIRC_570 
17@ = 255 
18@ = 175 
19@ = 100 

:T_CIRC_570
0AB4: 4@ = var 3 
0AB4: 11@ = var 4 

Share this post


Link to post
Share on other sites

Thanks! For some reason, that line is :T_CIRC_133 in my code. Anyway, it's fixed! The problem is solv-ed. :headphonedance:

Edited by BTTFModMachine

Share this post


Link to post
Share on other sites