Jump to content

"busted" opcode broken


Jack

Recommended Posts

I got a problem. My scrypt is made to work outside the missions (in main part of a main.scm) so I can't use this opcode to check if a player is busted:

 

0112: wasted_or_busted // mission only

 

and the below opcode is broken so its crashing the game:

 

0130:   player $PLAYER_CHAR busted ;; never used in VC

 

My only alternative is to try with these memory addresses:

0x94AD28 - [pointer] - Player pointer (Note that Player is an instance of CPed Class)

+0x244 - [byte] - player current status [2] [3], values include:

0x3E - busted

Using mem add is tricky but I tried this anyway:

 

:busted  thread 'busted'     :BC  wait 0   05E0: 0@ = read_memory 0x94AD28 size 4 virtual_protect 0   0@ += 0x244   05E0: 1@ = read_memory 0@ size 1 virtual_protect 0   if      1@ == 0x3E     else_jump @BC     Player.WantedLevel($PLAYER_CHAR) = 6  (test if a player is busted then 6 stars will flash)   jump @BC  end_thread 

 

and nothing has happened. I build this small scrypt by looking into some similar scrypt example that I found somewhere on this forum. When I puted the above scrypt into the Sanny Builder these two lines didn't have a number:

 

0@ += 0x244      1@ == 0x3E 

 

so I'm not quite sure what could they mean because Sanny Builder didn't recognized them.

Conditional checking for busting is really necessery in all scrypts. So can you help me with this please?

Also I used "create_thread" and "end_thread" commands to input the scrypt into the main.scm. Do I have to use CLEO scrypting to activate this busted checking or it's possible to activate it in main.scm?

Link to comment
Share on other sites

Have you not tried using

 

 

0112:   wasted_or_busted 

 

 

Anyway?

 

Also why not check if the player is defined, I'm pretty sure when the protagonist gets killed or arrested he becomes undefined until he spawns again

 

 

Link to comment
Share on other sites

"$player_char defined" checking ha. Good idea. All I have to do now is to add "$PLAYER_ACTOR sphere 0 near_busted point" in checking. This should work. Thanks Sorrow.

 

Link to comment
Share on other sites

Ashwin.Star

@sorrow

but that is not a perfect solution if someone want to check for Busted,

because the player become undefined whenever Actor is uncontrollable,

 

@JJ

i like how you try to use MEM ADD for it,

but you are checking for wrong value,

1@ == 0x3E

0x3E is the offset of busted not value,

i think you should check for, when the value becomes 62

 

{cleo}  thread 'Ashwin'   :0  wait 0   05E0: 0@ = read_memory 0x94AD28 size 4 virtual_protect 0   0@ += 0x244 05E0: 1@ = read_memory 0@ size 1 virtual_protect 0 if1@ == 62jf @0//////////// What ever you want//////////jump @0 

 

 

you can use this opcode to see the value of any global variable

 

03c4: $9000 0 'none'

 

$9000 is global variable

0 is to show integers value, you can use 1 to show it like health bar

'none' is the GXT string,

 

just get the value of mem add to a global variable & use it,

like this

:busted  thread 'busted'     wait 5000:BC  wait 0   05E0: 0@ = read_memory 0x94AD28 size 4 virtual_protect 0   0@ += 0x244   05E0: $9000 = read_memory 0@ size 1 virtual_protect 0   03c4: set_status_text_to $9000 0 'none'jump @BC 

 

good luck

Edited by Ashwin the new boy
Link to comment
Share on other sites

a simple method:

 

if and8256:  not player $PLAYER_CHAR defined8118:   not actor $PLAYER_ACTOR dead 004D: jump_if_false @BUSTCHK_1

 

Link to comment
Share on other sites

Ashwin.Star

does the player become undefined only when wasted or buster ?

what about during cutscene ?

Link to comment
Share on other sites

does the player become undefined only when wasted or buster ?

what about during cutscene ?

During cutscenes the player still defined, yes, only when wasted or busted, it simple does a

 

if(!Players[opcodeParameters[0]].isWastedBustedFlag)definedelsenot defined

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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.