Quantcast

Jump to content

» «
Photo

is there any way to keep the train still on raillway at high speed usi

7 replies to this topic
Anthony ok
  • Anthony ok

    Player Hater

  • Members
  • Joined: 25 Jun 2012

#1

Posted 24 October 2013 - 12:53 AM

I want to realize a super fast train like a bullet train, is there a way to make it happen :panic: :r*:
 


Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#2

Posted 24 October 2013 - 12:09 PM Edited by Wesser, 24 October 2013 - 12:11 PM.

Take these code snippets for enabling and disabling the train derailment:
// Disable the train derailment.
// nop dword ptr [eax+eax*1+00h]
0A8C: write_memory 0x006F8C2A size 4 value 0x00441F0F virtual_protect 1
0A8C: write_memory 0x006F8C2E size 1 value 0x00 virtual_protect 1
// nop
// jmp near
0A8C: write_memory 0x006F8C41 size 2 value 0xE990 virtual_protect 1
// Renable the train derailment.
// mov al, [esi+CEntity.m_ucType]
// test al, 0F8h
0A8C: write_memory 0x006F8C2A size 4 value 0xA836468A virtual_protect 1
0A8C: write_memory 0x006F8C2E size 1 value 0xF8 virtual_protect 1
// jnz near
0A8C: write_memory 0x006F8C41 size 2 value 0x850F virtual_protect 1
Let me know if you still want the shake effect at high speed.

Anthony ok
  • Anthony ok

    Player Hater

  • Members
  • Joined: 25 Jun 2012

#3

Posted 25 October 2013 - 07:12 AM

Wesser, on 24 Oct 2013 - 7:09 PM, said:

Take these code snippets for enabling and disabling the train derailment:

// Disable the train derailment.
// nop dword ptr [eax+eax*1+00h]
0A8C: write_memory 0x006F8C2A size 4 value 0x00441F0F virtual_protect 1
0A8C: write_memory 0x006F8C2E size 1 value 0x00 virtual_protect 1
// nop
// jmp near
0A8C: write_memory 0x006F8C41 size 2 value 0xE990 virtual_protect 1
// Renable the train derailment.
// mov al, [esi+CEntity.m_ucType]
// test al, 0F8h
0A8C: write_memory 0x006F8C2A size 4 value 0xA836468A virtual_protect 1
0A8C: write_memory 0x006F8C2E size 1 value 0xF8 virtual_protect 1
// jnz near
0A8C: write_memory 0x006F8C41 size 2 value 0x850F virtual_protect 1
thanks Wesser. This code helped me a lot.
and works well

but, can you help me arrange this script?
I set up a script that has a strange bug.
first time went well, but when passing the red country, the trains out of the actual track. and walked straight towards san Fiero left to go to the rail line near the airport, it's like a shortcut and ignore to skip las Venturas

im not clever in script and usualy make a simple script :die:
this is my screenshot and where the bug is happen.
bug.jpg

and this is my bugged script, whats wrong?
{$CLEO .cs}

thread 'derailment'

:0
wait 0
1@ = 0

:1
wait 0
if and
0256:   player $PLAYER_CHAR defined 
09AE:   actor $PLAYER_ACTOR driving_train 
jf @2
03C0: 0@ = actor $PLAYER_ACTOR car
if
1@ == 0
jf @2
// Disable the train derailment.
// nop dword ptr [eax+eax*1+00h]
0A8C: write_memory 0x006F8C2A size 4 value 0x00441F0F virtual_protect 1
0A8C: write_memory 0x006F8C2E size 1 value 0x00 virtual_protect 1
// nop
// jmp near
0A8C: write_memory 0x006F8C41 size 2 value 0xE990 virtual_protect 1
1@ = 1

:2
wait 0
if and
80DB:   not actor $PLAYER_ACTOR in_car 0@ 
1@ == 1
jf @1
// Renable the train derailment.
// mov al, [esi+CEntity.m_ucType]
// test al, 0F8h
0A8C: write_memory 0x006F8C2A size 4 value 0xA836468A virtual_protect 1
0A8C: write_memory 0x006F8C2E size 1 value 0xF8 virtual_protect 1
// jnz near
0A8C: write_memory 0x006F8C41 size 2 value 0x850F virtual_protect 1
jump @0

thanks for help :cookie: :cookie: :cookie: :lol:

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#4

Posted 25 October 2013 - 09:16 AM

I traveled all the train line to test the effectiveness of the script and nothing wrong happend. It might be a random bug due to the game physics as a consequence of the high speed or something is corrupted in your game.

Anthony ok
  • Anthony ok

    Player Hater

  • Members
  • Joined: 25 Jun 2012

#5

Posted 25 October 2013 - 09:23 AM

mybe.

any way, how you can find this memory adresses? it not listed in wiki.

please give me a trick :catloaf:


Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Members
  • Joined: 19 Aug 2006
  • European-Union

#6

Posted 25 October 2013 - 10:25 AM

You need IDA Pro Advanced to disassemble the game executable. Once much stuff is discovered (I use the listener's idb available here) finding other related things becomes easy especially if they are linked in some way. In the particular case, thanks to the existence of HAS_TRAIN_DERAILED command, I figured out which flag is responsible for the train derailment and also the location where it gets set. What I did in practice is skipping such code.

Deji
  • Deji

    Coding like a Rockstar!

  • Members
  • Joined: 24 Dec 2007

#7

Posted 25 October 2013 - 12:55 PM

That position that the train is in is actually a valid track. For some reason SA has lots of extra random ones. Perhaps the invalid ones are leftover from a previous state of map or just used as shortcuts for the trains to move between. Don't know what might be causing it here, but I once had a nice ride in that direction while messing with some train-related opcodes or possibly paths...


Silent
  • Silent

    Moderating Cookie Monster

  • Members
  • Joined: 01 Feb 2010
  • Poland

#8

Posted 25 October 2013 - 12:58 PM

To specify, I think this path is used in Wrong Side of The Tracks.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users