Post: [1.16] GSC functions codes list | Random Scripts
03-09-2015, 06:58 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); Ok so since I released how to call raw gsc functions, I thought, why not a gsc codes list?

Make sure you call this after each function. Scr_ClearOutParams();

    THIS IS UPDATED AFTER SHARKS POST

void Scr_ClearOutParams(){
VariableValue* Top;
uint Params = *(int*)(0x13C3140 + 0x1Cool Man (aka Tustin);
*(int*)(0x13C3140 + 0x1Cool Man (aka Tustin) = 0;
for(Top -= Params; Params; --Params){
((void(*)(int, VariableUnion))&ParseAddr(0x2DA724))(Top->type, Top->u); // RemoveRefToObject
--Top;
}
return;
}


GScr_Earthquake:

    void GScr_Earthquake(float scale, float duration, float* source, float radius){
Scr_AddFloat(radius);
Scr_AddVector(source);
Scr_AddFloat(duration);
Scr_AddFloat(scale);
Scr_SetParameters(4); //See how I set the parameter number after I finish calling the Scr_Adds?
((void(*)())&ParseAddr(0x268B60))(); //Call the actual function
//((void(*)(int))&ParseAddr(0x268B60))(ClientID << 16); //Only call this one if the one above doesn't work.
Scr_ClearOutParams();
}


Scr_PlayFX:

    void Scr_PlayFX(const char* EffectId, float* Position, float* Forward = 0, float* Up = 0){
Scr_AddVector(Up);
Scr_AddVector(Forward);
Scr_AddVector(Position);
Scr_AddInt(((int(*)(const char*))&ParseAddr(0x324D0))(EffectId));
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x2732D4))();
Scr_ClearOutParams();
}


Scr_MagicBullet:

    void Scr_MagicBullet(int ClientID, const char* Bullet, float* Start, float* End){
Scr_AddEntity(GetEntity(ClientID));
Scr_AddVector(End);
Scr_AddVector(Start);
Scr_AddString(Bullet);
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x264800))();
Scr_ClearOutParams();
}


Scr_PhysicsExplosionCylinder:

    void Scr_PhysicsExplosionCylinder(float* Origin, float OuterRadius, float InnerRadius, float Magnitude){
Scr_AddFloat(Magnitude);
Scr_AddFloat(InnerRadius);
Scr_AddFloat(OuterRadius);
Scr_AddVector(Origin);
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x273770))();
//If it doesn't work, try ((void(*)(int))&ParseAddr(0x273770))(ClientID << 16);
Scr_ClearOutParams();
}


GScr_SetMiniMap:

    void GScr_SetMiniMap(const char* Material, UpperLeftX, UpperLeftY, LowerRightX, LowerRightY){
Scr_AddFloat(LowerRightY);
Scr_AddFloat(LowerRightX);
Scr_AddFloat(UpperLeftY);
Scr_AddFloat(UpperLeftX);
Scr_AddString(Material);
Scr_SetParameters(5);
Scr_ClearOutParams();
}

___________________________Random functions___________________________

VectorScale:

    float* VectorScale(float* Angle, int Scale){
float Result[] = { Angle[0]* Scale, Angle[1]* Scale, Angle[2]* Scale };
return Result;
}


AnglesToForward:

    #define AngleVectors(Angle, Forward, Right, Up) ((void(*)(const float*, float*, float*, float*))&ParseAddr(0x38020Cool Man (aka Tustin))(Angle, Forward, Right, Up)

float* AnglesToForward(const float* Angle){
float Forward[3];
AngleVectors(Angle, Forward, 0, 0);
return Forward;//If this doesn't work, return Angle;
}



GetEye: //Equivalent to GetTagOrigin("tag_eye")

    #define G_GetPlayerViewOrigin(PS, Origin) ((void(*)(int, float*))&ParseAddr(0x231884))(PS, Origin)

float* GetEye(unsigned int ClientID){
float Org[3];
G_GetPlayerViewOrigin(G_Client(ClientID), Org);
return Org;
}


GetCursorPos:

    

#define G_LocationalTrace(Trace, Start, End, PassEnt, ContentMask, PriorityMap) ((void(*)(trace_t*, const float*, const float*, int, int, char*))&ParseAddr(0x250FA4))(Trace, Start, End, PassEnt, ContentMask, PriorityMap)
#define Trace_GetEntityHitId(Trace) ((ushort(*)(trace_t*))&ParseAddr(0x2A9750))(Trace)

struct BulletTraceType{
short entnum;
float Pos[3];
};

struct trace_t{//Xx jAmes t xX
float fraction;
byte Buffer[0x28];
};

void BulletTrace(BulletTraceType* Type, float* Start, float* End, unsigned int ClientID){//Xx jAmes t xX
trace_t trace;
G_LocationalTrace(&trace, Start, End, ClientID, 0x80A831, 0);
for(unsigned char i = 0; i < 3; i++) Type->Pos[i] = (((End[i]-Start[i]) * trace.fraction) + Start[i]);
short Entity = Trace_GetEntityHitId(&trace) & 0xFFFF;
if(Entity < 0x7FE) Type->entnum= Entity;
}

float* GetCursorPos(unsigned int ClientID){
BulletTraceType Type;
BulletTrace(&Type, GetEye(), VectorScale(AnglesToForward((float*)(G_Client(ClientID) + 0x184), 100000), ClientID);
return Type.Pos;
}


___________________________Hooks that you can use___________________________

VM_Execute:

Address location - 0x2E6444

    

int VM_ExecuteStub(){
__asm("li %r3, 0x4");
}

int VM_Execute(){
//Do stuff here
return VM_ExecuteStub();
}
What you can use this for: A loop? Calling Scr_Adds?


Scr_Notify:

Address location - 0x28B73C

    

int Scr_NotifyStub(){
__asm("li %r3, 0x5");
}
#define SL_ConvertToString(StringValue) ((const char*(*)(unsigned short))&ParseAddr(0x2D894C))(StringValue)
#define iClient *(short*)Entity

void Scr_Notify(int Entity, short StringValue, unsigned int Paramcount){
/*
if(!strcmp(SL_ConvertToString(StringValue), "weapon_fired")) MagicBullet(iClient, GetEye(), GetCursorPos());
*/
return Scr_NotifyStub(Entity, StringValue, Paramcount);
}

What you can use this for: Calling Scr_Adds | Waitill. Only use this if you're having crashing problems with VM_Notify



I'll update this more when I find more functions.
Last edited by Ambition sG ; 03-27-2015 at 09:16 PM.

The following 14 users say thank you to Ambition sG for this useful post:

01cedricv2, BaSs_HaXoR, Father Luckeyy, FusionIsDaName, gοd, GFM, ImManga, kiwi_modz, LBK, lutsch1234, Stunz, Swaqq, TotalModzHD, XenonLegend
03-10-2015, 06:37 AM #11
mariokilla23
Vault dweller
Originally posted by Ambition
Are you serious right now lol. You obviously don't know what this is if you think this should be in the GSC list. This isn't GSC, yes I'm calling GSC functions, but I'm not writing gsc. Know the difference -.-


First off I know the difference. Secondly if it has anything to do with gsc in any way, shape, or form people put it in the gsc managed list. I read every single comment on them and people ask alot of questions about it. Thirdly, don't start an argument unless you know what you are talking about.
03-10-2015, 06:44 AM #12
mariokilla23
Vault dweller
Originally posted by iMoD1998 View Post
As ethernet said its memory not GSC scripting MATE


So next time when people are creating an offsets list they need to put it in the memory section? :P :mate:
03-10-2015, 07:31 AM #13
Shark
Retired.
Originally posted by mariokilla23 View Post
So next time when people are creating an offsets list they need to put it in the memory section? :P :mate:


you are fucking autistic, please request that your account be guested ASAP before you make even more of a fool out of yourself then you already are, first off this hasn't got anything to do with the 'Managed GSC Code List', this isn't even GSC, what he's saying is the functions and methods he's using is similar to what is used in GSC, example the function MagicBullet is a common function used in GSC Scripting, you can't just call this normally lets say from an SPRX (well you can now), but its not the same, to the game the MagicBullet function is listed as GScr_MagicBullet, This is what we are actually calling here when we call magicbullet just in GSC Scripting you do not require the need to make the functions like this, so what this is actually doing is making it possible to actually call functions which usually you could only call from a GSC Script, but instead we are actually able to now call them from an SPRX or RTM Tool (Would require some tweaking), so before you come in here acting like you know your shit please take a minute to think before you speak. Fuckwit.

Don't make any comments on my grammar I'm not going to fucking add full stops and shit for something that is being posted on a web-based forum.

The following 2 users say thank you to Shark for this useful post:

Connerg123, kiwi_modz
03-10-2015, 07:31 AM #14
Originally posted by mariokilla23 View Post
First off I know the difference. Secondly if it has anything to do with gsc in any way, shape, or form people put it in the gsc managed list. I read every single comment on them and people ask alot of questions about it. Thirdly, don't start an argument unless you know what you are talking about.


You do realize that this doesn't belong in the GSC list because it would be irrelevant to the post. Think about it, it would be confusing af if I posted this in the Gsc thread because if someone's looking for earthquake for eg, and they C&P'ed it in their source. It wouldn't work, simple. Which is why I created this thread because you can't call Gsc functions in an sprx unless you follow my method. Meanwhile...

You must login or register to view this content.
03-10-2015, 08:27 AM #15
Shark
Retired.
Originally posted by Ambition
Ok so since I released how to call raw gsc functions, I thought, why not a gsc codes list?

Make sure you call this after each function. Scr_ClearOutParams();

    #define Scr_ClearOutParams() ((void(*)(void))&ParseAddr(0x2E005Cool Man (aka Tustin))()


GScr_Earthquake:

    void GScr_Earthquake(float scale, float duration, float* source, float radius){
Scr_AddFloat(radius);
Scr_AddVector(source);
Scr_AddFloat(duration);
Scr_AddFloat(scale);
Scr_SetParameters(4); //See how I set the parameter number after I finish calling the Scr_Adds?
((void(*)())&ParseAddr(0x268B60))(); //Call the actual function
//((void(*)(int))&ParseAddr(0x268B60))(ClientID << 16); //Only call this one if the one above doesn't work.
Scr_ClearOutParams();
}


Scr_PlayFX:

    void Scr_PlayFX(const char* EffectId, float* Position, float* Forward = 0, float* Up = 0){
Scr_AddVector(Up);
Scr_AddVector(Forward);
Scr_AddVector(Position);
Scr_AddInt(((int(*)(const char*))&ParseAddr(0x324D0))(EffectId));
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x2732D4))();
Scr_ClearOutParams();
}


Scr_MagicBullet:

    void Scr_MagicBullet(int ClientID, const char* Bullet, float* Start, float* End){
Scr_AddEntity(GetEntity(ClientID));
Scr_AddVector(End);
Scr_AddVector(Start);
Scr_AddString(Bullet);
Scr_SetParameters(4);
((void(*)())&ParseAddr(0x264800))();
Scr_ClearOutParams();
}


    


___________________________Random functions___________________________

VectorScale:

    float* VectorScale(float* Angle, int Scale){
float Result[] = { Angle[0]* Scale, Angle[1]* Scale, Angle[2]* Scale };
return Result;
}


AnglesToForward:

    #define AngleVectors(Angle, Forward, Right, Up) ((void(*)(const float*, float*, float*, float*))&ParseAddr(0x38020Cool Man (aka Tustin))(Angle, Forward, Right, Up)

float* AnglesToForward(const float* Angle){
float Forward[3];
AngleVectors(Angle, Forward, 0, 0);
return Forward;//If this doesn't work, return Angle;
}



GetEye: //Equivalent to GetTagOrigin("tag_eye")

    #define G_GetPlayerViewOrigin(PS, Origin) ((void(*)(int, float*))&ParseAddr(0x231884))(PS, Origin)

float* GetEye(unsigned int ClientID){
float Org[3];
G_GetPlayerViewOrigin(G_Client(ClientID), Org);
return Org;
}


GetCursorPos:

    

#define G_LocationalTrace(Trace, Start, End, PassEnt, ContentMask, PriorityMap) ((void(*)(trace_t*, const float*, const float*, int, int, char*))&ParseAddr(0x250FA4))(Trace, Start, End, PassEnt, ContentMask, PriorityMap)
#define Trace_GetEntityHitId(Trace) ((ushort(*)(trace_t*))&ParseAddr(0x2A9750))(Trace)

struct BulletTraceType{
short entnum;
float Pos[3];
};

struct trace_t{//Xx jAmes t xX
float fraction;
byte Buffer[0x28];
};

void BulletTrace(BulletTraceType* Type, float* Start, float* End, unsigned int ClientID){//Xx jAmes t xX
trace_t trace;
G_LocationalTrace(&trace, Start, End, ClientID, 0x80A831, 0);
for(unsigned char i = 0; i < 3; i++) Type->Pos[i] = (((End[i]-Start[i]) * trace.fraction) + Start[i]);
short Entity = Trace_GetEntityHitId(&trace) & 0xFFFF;
if(Entity < 0x7FE) Type->entnum= Entity;
}

float* GetCursorPos(unsigned int ClientID){
BulletTraceType Type;
BulletTrace(&Type, GetEye(), VectorScale(AnglesToForward((float*)(G_Client(ClientID) + 0x184), 100000), ClientID);
return Type.Pos;
}


___________________________Hooks that you can use___________________________

VM_Execute:

Address location - 0x2E6444

    

int VM_ExecuteStub(){
__asm("li %r3, 0x4");
}

int VM_Execute(){
//Do stuff here
return VM_ExecuteStub();
}
What you can use this for: A loop? Calling Scr_Adds?


Scr_Notify:

Address location - 0x28B73C

    

int Scr_NotifyStub(){
__asm("li %r3, 0x5");
}
#define SL_ConvertToString(StringValue) ((const char*(*)(unsigned short))&ParseAddr(0x2D894C))(StringValue)
#define iClient *(short*)Entity

void Scr_Notify(int Entity, short StringValue, unsigned int Paramcount){
/*
if(!strcmp(SL_ConvertToString(StringValue), "weapon_fired")) MagicBullet(iClient, GetEye(), GetCursorPos());
*/
return Scr_NotifyStub(Entity, StringValue, Paramcount);
}

What you can use this for: Calling Scr_Adds | Waitill. Only use this if you're having crashing problems with VM_Notify



I'll update this more when I find more functions.


    
enum scr_string_t {
//Blank
};

enum TraceHitType {
TRACE_HITTYPE_NONE = 0x0,
TRACE_HITTYPE_ENTITY = 0x1,
TRACE_HITTYPE_DYNENT_MODEL = 0x2,
TRACE_HITTYPE_DYNENT_BRUSH = 0x3,
TRACE_HITTYPE_GLASS = 0x4,
};

struct __declspec(align(2)) trace_t {
float fraction;
float normal[3];
int surfaceFlags;
int contents;
TraceHitType hitType;
unsigned __int16 hitId;
unsigned __int16 modelIndex;
scr_string_t partName;
unsigned __int16 partGroup;
bool allsolid;
bool startsolid;
bool walkable;
bool getPenetration;
bool removePitchAndRollRotations;
};


Might be useful idk
03-10-2015, 08:40 AM #16
mariokilla23
Vault dweller
Originally posted by Shark View Post
    
enum scr_string_t {
//Blank
};

enum TraceHitType {
TRACE_HITTYPE_NONE = 0x0,
TRACE_HITTYPE_ENTITY = 0x1,
TRACE_HITTYPE_DYNENT_MODEL = 0x2,
TRACE_HITTYPE_DYNENT_BRUSH = 0x3,
TRACE_HITTYPE_GLASS = 0x4,
};

struct __declspec(align(2)) trace_t {
float fraction;
float normal[3];
int surfaceFlags;
int contents;
TraceHitType hitType;
unsigned __int16 hitId;
unsigned __int16 modelIndex;
scr_string_t partName;
unsigned __int16 partGroup;
bool allsolid;
bool startsolid;
bool walkable;
bool getPenetration;
bool removePitchAndRollRotations;
};


Might be useful idk


I thought shark was banned. Has he returned from the dead? Haha
03-10-2015, 08:46 AM #17
mariokilla23
Vault dweller
Originally posted by Ambition
You do realize that this doesn't belong in the GSC list because it would be irrelevant to the post. Think about it, it would be confusing af if I posted this in the Gsc thread because if someone's looking for earthquake for eg, and they C&P'ed it in their source. It wouldn't work, simple. Which is why I created this thread because you can't call Gsc functions in an sprx unless you follow my method. Meanwhile...

You must login or register to view this content.


I'm not saying that you do put this into the gsc, but what I am saying is this has been posted before somewhere. Also who is stupid enough to copy and paste if they don't understand it? actually I take that back because there are alot of people that haha. Anyways whoever has the ability to create an sprx to some degree would know you can't just go to the bo2 gsc section and copy and paste the earthquake function lolol. I'll stop here though. It seems that by now I am just ranting and making a fool out of myself xD
03-10-2015, 08:49 AM #18
Originally posted by mariokilla23 View Post
I'm not saying that you do put this into the gsc, but what I am saying is this has been posted before somewhere. Also who is stupid enough to copy and paste if they don't understand it? actually I take that back because there are alot of people that haha. Anyways whoever has the ability to create an sprx to some degree would know you can't just go to the bo2 gsc section and copy and paste the earthquake function lolol. I'll stop here though. It seems that by now I am just ranting and making a fool out of myself xD


If it makes you feel any better, I put other stuff besides gsc functions. I hope the magnitude of your jimmies won't russle my post off the screen :spoder:

The following user thanked Ambition sG for this useful post:

zZHackzZ
03-10-2015, 12:15 PM #19
mariokilla23
Vault dweller
Originally posted by Shark View Post
you are fucking autistic, please request that your account be guested ASAP before you make even more of a fool out of yourself then you already are, first off this hasn't got anything to do with the 'Managed GSC Code List', this isn't even GSC, what he's saying is the functions and methods he's using is similar to what is used in GSC, example the function MagicBullet is a common function used in GSC Scripting, you can't just call this normally lets say from an SPRX (well you can now), but its not the same, to the game the MagicBullet function is listed as GScr_MagicBullet, This is what we are actually calling here when we call magicbullet just in GSC Scripting you do not require the need to make the functions like this, so what this is actually doing is making it possible to actually call functions which usually you could only call from a GSC Script, but instead we are actually able to now call them from an SPRX or RTM Tool (Would require some tweaking), so before you come in here acting like you know your shit please take a minute to think before you speak. Fuckwit.

Don't make any comments on my grammar I'm not going to fucking add full stops and shit for something that is being posted on a web-based forum.


I would like to alot about your misused grammer, but then I would be a hypocrite. Now as for the part about talking shit and how I don't know what I'm talking about is where you are wrong. I guess it's just like how people who make tools are too lazy to actually find out what the offsets are. The point I'm making is that this was posted somewhere else and your lazy ass could find it if you wanted. Also if you were to make a prx then it honestly wouldn't take more than 5 mins being that he did earlier release the raw files. And something to this nature was posted in the gsc managed list in the comments. :snarl:

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo