Jump to content

Labels? in Gta 5 .csc scripts ?


Recommended Posts

megachaos17

im looking at some mod menus and im reading a bunch of "@label" with numbers at the end... so far the only thing i know is "PushString" which gives text or in other words.. "echos" the words you want on your menu if im correct.. and not only that i see "function 20 2 3" and a lot of "i get push" and "ipush"

what are these?

Link to comment
https://gtaforums.com/topic/769792-labels-in-gta-5-csc-scripts/
Share on other sites

pushing an integer onto a stack maybe?

 

i usually represents an integer and push refers to putting values onto a stack which organizes data in a first in last out fashion... just google for better explanation

 

that i is probably being used in some function being called after the push

Edited by byteMe420

Those are all opcodes used in scripts. Many of them are used for pushing different things onto the stack. There are a ton of them but here's the description of the few you talked about in the op.

 

  • PushString is just pushing a string onto the stack. A single PushString will not display anything onscreen, a few natives are required for that.
  • iPush is pushing an integer onto the stack. There are a few different iPush opcodes which are for how many bytes the integer takes up but they all have the same function.
  • Function is for starting a function. The three numbers after it meanings are as following:
    • Function[1] Parameter count .
    • Function[2] Frame count, frames being like local variables in high level.
    • Function[3] Unknown to me. For creation of my own scripts I always keep it at 0
  • Return comes at the end of every function even if it doesn't actually return any values. It has two numbers after it and their meanings are as following:
    • Return[1] Parameter count. Should be the same number as Function[1]
    • Return[2] Number of values to take off the stack of the function and actually return.
  • Labels are used for calling functions and jumping around in code inside of functions.

 

Like sasuke said, the names of these opcodes vary depending on what decompiler/compiler you use. However they are all pretty similar.

Edited by 2much4u
  • 2 weeks later...
unknown modder

The label system is used to show where to go for branching instructions(Conditional and loops mainly) They aren't specifically defined in the script container, but decompilers can work out where they are looking at where branches go to. What disassembler are you using to look at the script, each one will likely have their own way of representing opcodes

  • Like 1

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.