Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Alexander Blade

[V] Script/Native Documentation and Research

Recommended Posts

NTAuthority

>'VM_Execute'

this isn't f*cking call of duty

Share this post


Link to post
Share on other sites
AdamSelene

'VM_Execute'

this isn't f*cking call of duty

and it is an "SM" (Stack Machine) ... Edited by AdamSelene

Share this post


Link to post
Share on other sites
proditaki

 

Here is a ton of scripts I wrote in C++. Nothing crazy but it works for the most part.

 

Vehicle Nitrous

VOID Nitrous(){    while (true) // for (;        if (!IS_PED_ON_FOOT(PLAYER_PED_ID()))            if (IS_PLAYER_PRESSING_HORN(PLAYER_ID()))                SET_VEHICLE_BOOST_ACTIVE(GET_VEHICLE_PED_IS_IN(PLAYER_PED_ID(), 0), TRUE);            else                SET_VEHICLE_BOOST_ACTIVE(GET_VEHICLE_PED_IS_IN(PLAYER_PED_ID(), 0), FALSE);        else            SET_VEHICLE_BOOST_ACTIVE(GET_VEHICLE_PED_IS_IN(PLAYER_PED_ID(), 0), FALSE);}

 

You also use apply_force_to_entity for vehicle nitrous .

 

or SET_VEHICLE_FORWARD_SPEED

Share this post


Link to post
Share on other sites
MulleDK19

And we don't even know if there will be a 64-bit version of the game on PC.

Well, that's not quite true. It might very well be that the PC version will be 64-bit exclusive, sadly.

The AMD graphics drivers contain profiles for gta5\Game_win64_final.exe, gta5\Game_win64_beta.exe, etc.

Hopefully they'll provide both 32-bit and 64-bit executables.

Share this post


Link to post
Share on other sites
Alexander Blade

Old news , however I expect that there will be x64 binaries only

 

 

And we don't even know if there will be a 64-bit version of the game on PC.


Well, that's not quite true. It might very well be that the PC version will be 64-bit exclusive, sadly.
The AMD graphics drivers contain profiles for gta5\Game_win64_final.exe, gta5\Game_win64_beta.exe, etc.
Hopefully they'll provide both 32-bit and 64-bit executables.

 

Edited by Alexander Blade

Share this post


Link to post
Share on other sites
testfr

It's possible to hook a native ? How ?

Share this post


Link to post
Share on other sites
XeClutch

It's possible to hook a native ? How ?

Look back to the last few pages, you'll be able to figure it out.

Share this post


Link to post
Share on other sites
fOmey

Hey lads,

 

Hoping you guys can help me out.. I'm working on a little stripper function...

 

The plan is to create a ped and make them dance as a stripper, simple enough right ? Although I don't want them to react to guns being pointed at them or get scared...

 

I thought of the following:

  • SET_BLOCKING_OF_NON_TEMPORARY_EVENTS
  • SET_PED_CONFIG_FLAG ? Not sure what flags to set tho, would love any further information on this !!

 

 

Would appreciate any further information !

 

 

 

On another note, I was wondering if someone could supply some updated script dumps, I would love to find the animations for the tasks like the salute, hands clap etc. by pressing L3 + R3.

Edited by fOmey

Share this post


Link to post
Share on other sites
InfamousSabre

Hey lads,

 

Hoping you guys can help me out.. I'm working on a little stripper function...

 

The plan is to create a ped and make them dance as a stripper, simple enough right ? Although I don't want them to react to guns being pointed at them or get scared...

 

I thought of the following:

  • SET_BLOCKING_OF_NON_TEMPORARY_EVENTS
  • SET_PED_CONFIG_FLAG ? Not sure what flags to set tho, would love any further information on this !!

 

 

Would appreciate any further information !

 

 

 

On another note, I was wondering if someone could supply some updated script dumps, I would love to find the animations for the tasks like the salute, hands clap etc. by pressing L3 + R3.

In IV, to disable those reactions you have to set their DecisionMaker (DM) to a DM that doesn't have reactions to those events. I usually use a blank DM. I don't mod V, but maybe it is similar.

Share this post


Link to post
Share on other sites
fOmey

 

Hey lads,

 

Hoping you guys can help me out.. I'm working on a little stripper function...

 

The plan is to create a ped and make them dance as a stripper, simple enough right ? Although I don't want them to react to guns being pointed at them or get scared...

 

I thought of the following:

  • SET_BLOCKING_OF_NON_TEMPORARY_EVENTS
  • SET_PED_CONFIG_FLAG ? Not sure what flags to set tho, would love any further information on this !!

 

 

Would appreciate any further information !

 

 

 

On another note, I was wondering if someone could supply some updated script dumps, I would love to find the animations for the tasks like the salute, hands clap etc. by pressing L3 + R3.

In IV, to disable those reactions you have to set their DecisionMaker (DM) to a DM that doesn't have reactions to those events. I usually use a blank DM. I don't mod V, but maybe it is similar.

 

Thanks for the reply, I will certainly see what I can dig up..

 

 

On another note, Does anyone know any info about teleporting to a waypoint set on map ?

 

I believe the function will consist of the following natives:

  • GET_FIRST_BLIP_INFO_ID
  • GET_BLIP_COORDS
  • GET_GROUND_Z_FOR_3D_COORD

 

I cant figure out what the handle is for "GET_FIRST_BLIP_INFO_ID".. I tried to push string "BLIP_WAYPOINT", also tried the jenkins hash for "BLIP_WAYPOINT".. still no avail.. any further information would be apprecaited !

Share this post


Link to post
Share on other sites
NTAuthority

blip icons have always been indices

Edited by NTAuthority

Share this post


Link to post
Share on other sites
Fun 2

Thanks for the reply, I will certainly see what I can dig up..

 

 

On another note, Does anyone know any info about teleporting to a waypoint set on map ?

 

I believe the function will consist of the following natives:

  • GET_FIRST_BLIP_INFO_ID
  • GET_BLIP_COORDS
  • GET_GROUND_Z_FOR_3D_COORD
I cant figure out what the handle is for "GET_FIRST_BLIP_INFO_ID".. I tried to push string "BLIP_WAYPOINT", also tried the jenkins hash for "BLIP_WAYPOINT".. still no avail.. any further information would be apprecaited !

 

Use get_first_blip_info_id native with first arg set to 8 .

get_first_blip_info_id(8);

Then use get_blip_coords and set_entity_coords with load_all_objects_now .

Share this post


Link to post
Share on other sites
fOmey

 

Thanks for the reply, I will certainly see what I can dig up..

 

 

On another note, Does anyone know any info about teleporting to a waypoint set on map ?

 

I believe the function will consist of the following natives:

  • GET_FIRST_BLIP_INFO_ID
  • GET_BLIP_COORDS
  • GET_GROUND_Z_FOR_3D_COORD
I cant figure out what the handle is for "GET_FIRST_BLIP_INFO_ID".. I tried to push string "BLIP_WAYPOINT", also tried the jenkins hash for "BLIP_WAYPOINT".. still no avail.. any further information would be apprecaited !

 

Use get_first_blip_info_id native with first arg set to 8 .

get_first_blip_info_id(8);

Then use get_blip_coords and set_entity_coords with load_all_objects_now .

 

 

Thank you very much for your help. Merry Christmas.

 

EDIT: Worked like a charm, cant thank you enough.. been scratching my head trying to figure this out.

 

EDIT 2: I cant figure out what the handles for "GET_GROUND_Z_FOR_3D_COORD" are. Supposedly it requires a X, Y, Z & variable.. although that makes no sense to me, If I'm attempting to discover the Z coordinates of a location what do I input ?

Edited by fOmey

Share this post


Link to post
Share on other sites
NTAuthority

EDIT 2: I cant figure out what the handles for "GET_GROUND_Z_FOR_3D_COORD" are. Supposedly it requires a X, Y, Z & variable.. although that makes no sense to me, If I'm attempting to discover the Z coordinates of a location what do I input ?

pre-conditions: collisions to be loaded at said position

 

usage: GET_GROUND_Z_FOR_3D_COORD(x, y, z, &outZ)

 

this will call CWorld::ProcessVerticalLine or equivalent (seeing how rage::fw* are used in V now) and return the first collision found casting a ray vertically down from (x, y, z)

 

also: don't use LOAD_ALL_OBJECTS_NOW, use LOAD_SCENE or REQUEST_COLLISION_AT_COORD and wait for the streamer to load the scene at runtime (especially important if networked, since various subsystems won't get serviced during a regular LOAD_SCENE - original scripts use an unknown native (formerly START_LOAD_SCENE) combined with NETWORK_UPDATE_LOAD_SCENE and call a bunch of servicing funcs in the middle, but you typically don't have access to the original script code)

Edited by NTAuthority

Share this post


Link to post
Share on other sites
fOmey

 

EDIT 2: I cant figure out what the handles for "GET_GROUND_Z_FOR_3D_COORD" are. Supposedly it requires a X, Y, Z & variable.. although that makes no sense to me, If I'm attempting to discover the Z coordinates of a location what do I input ?

pre-conditions: collisions to be loaded at said position

 

usage: GET_GROUND_Z_FOR_3D_COORD(x, y, z, &outZ)

 

this will call CWorld::ProcessVerticalLine or equivalent (seeing how rage::fw* are used in V now) and return the first collision found casting a ray vertically down from (x, y, z)

 

also: don't use LOAD_ALL_OBJECTS_NOW, use LOAD_SCENE or REQUEST_COLLISION_AT_COORD and wait for the streamer to load the scene at runtime (especially important if networked, since various subsystems won't get serviced during a regular LOAD_SCENE - original scripts use an unknown native (formerly START_LOAD_SCENE) combined with NETWORK_UPDATE_LOAD_SCENE and call a bunch of servicing funcs in the middle, but you typically don't have access to the original script code)

 

What a great breakdown ! Thanks for taking the time to reply and explain in such detail.

 

Haven't had much luck at all sadly..

 

What I tried was:

  • REQUEST_COLLISION_AT_COORD(blipCoords[0], blipCoord[1], 50f)
  • Wait(1000)
  • GET_GROUND_Z_FOR_3D_COORD(blipCoord[0], blipCoord[1], 50f, &var);

 

I also tried:

  • NEW_LOAD_SCENE_START(blipCoord[0], blipCoord[1], 50f)
  • While (IS_NEW_LOAD_SCENE_LOADED == 0) { Wait(10) }
  • GET_GROUND_Z_FOR_3D_COORD(blipCoord[0], blipCoord[1], 50f, &var);

 

Sadly returns 0 everytime..

 

 

EDIT: While re-reading your post I realized you recommended to use "LOAD_SCENE".

 

I tried the following:

  • LOAD_SCENE(blipCoord[0], blipCoord[1], 150f)
  • GET_GROUND_Z_FOR_3D_COORD(blipCoord[0], blipCoord[1], 150f, &var);

 

It returns a float majority of the time, I thought it may be due to the varying levels.. although all the waypoints I set were < 150f Z... So it semi works !! Some progress !

 

 

EDIT 2: A little work around, not sure if its intended to be done this way... although if I "SET_ENTITY_COORDS" to the waypoint coordinates and then detect the Z coordinates it seems to work everytime.

 

I then "SET_ENTITY_COORDS" again to readjust once the Z coordinates are found seems to do the trick.

Edited by fOmey

Share this post


Link to post
Share on other sites
Skorpro

Hmm... I know this method (used in C++ and SCO):

void TeleportToWaypoint(){    Blip wpBlip = UI::GET_FIRST_BLIP_INFO_ID(8); // 8 = BLIP_WAYPOINT    if(UI::IS_WAYPOINT_ACTIVE())    {	Vector3 wpVec;        wpVec = UI::GET_BLIP_COORDS(wpBlip);	ENTITY::SET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), wpVec.X, wpVec.Y, wpVec.Z, 1, 1, 1, 1); // 1, 1, 1, 1 ?	for (;wpVec.Z == 0.0f;)	{		GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(wpVec.X, wpVec.Y, 1000.0f, &wpVec.Z);		SYSTEM::WAIT(0);	}	//STREAMING::LOAD_SCENE(wpVec.X, wpVec.Y, wpVec.Z); // not necessary?!        ENTITY::SET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), wpVec.X, wpVec.Y, wpVec.Z, 1, 1, 1, 1); // 1, 1, 1, 1 ?		    }}

Share this post


Link to post
Share on other sites
KiLLerBoy_001

 

Hmm... I know this method (used in C++ and SCO):

void TeleportToWaypoint(){    Blip wpBlip = UI::GET_FIRST_BLIP_INFO_ID(8); // 8 = BLIP_WAYPOINT    if(UI::IS_WAYPOINT_ACTIVE())    {	Vector3 wpVec;        wpVec = UI::GET_BLIP_COORDS(wpBlip);	ENTITY::SET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), wpVec.X, wpVec.Y, wpVec.Z, 1, 1, 1, 1); // 1, 1, 1, 1 ?	for (;wpVec.Z == 0.0f;)	{		GAMEPLAY::GET_GROUND_Z_FOR_3D_COORD(wpVec.X, wpVec.Y, 1000.0f, &wpVec.Z);		SYSTEM::WAIT(0);	}	//STREAMING::LOAD_SCENE(wpVec.X, wpVec.Y, wpVec.Z); // not necessary?!        ENTITY::SET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), wpVec.X, wpVec.Y, wpVec.Z, 1, 1, 1, 1); // 1, 1, 1, 1 ?		    }}

 

the 1, 1, 1, 1 are the rotations on the axes X ,Y, Z , Unknown.

Share this post


Link to post
Share on other sites
fOmey

Hey guys, I'm back to pick your brains for some info !

 

Currently working on attaching a object to the roof of a vehicle..

 

Due to the varying sizes of vehicles, I'm trying to figure out a full proof way of calculating the height of a vehicle:

 

 

I'm thinking one of the following:

  • GET_ENTITY_HEIGHT
  • GET_ENTITY_HEIGHT_ABOVE_GROUND

 

I believe when using the ATTACH_ENTITY_TO_ENTITY native, The entity being attached is attached to the center by default if not told otherwise.

 

 

Open to suggestions and thoughts.

Share this post


Link to post
Share on other sites
XeClutch

To anyone using the script engine hook and is having trouble printing text you now need to print the text from inside of the hook.

 

In other news, here is a little something something I wrote up to show you who is talking. I never really liked how in GTA somebody could be talking and you have no idea who it is.

 

void PrintChat() // call this from inside of the hook{    float pos = 0.07f;    for (int i = 0; i < 16; i++)        if (i != PLAYER_ID())            if (NETWORK_IS_PLAYER_TALKING(i))                if (!NETWORK_IS_PLAYER_MUTED_BY_ME(i))                    SET_TEXT(GET_PLAYER_NAME(i), 0.07f, (pos -= 0.05)); // replace with your function for printing text}
EDIT: For anyone that is interested, here is an enumeration with all usable weapons in the game including DLC weapons.

 

 

typedef enum Weapons : DWORD{    weapon_advancedrifle = 0xAF113F99,    weapon_appistol = 0x22D8FE39,    weapon_assaultrifle = 0xBFEFFF6D,    weapon_assaultshotgun = 0xE284C527,    weapon_assaultsmg = 0xEFE7E2DF,    weapon_ball = 0x23C9F95C,    weapon_bat = 0x958A4A8F,    weapon_bottle = 0xF9E6AA4B,    weapon_briefcase = 0x88C78EB7,    weapon_briefcase_02 = 0x01B79F17,    weapon_bullpuprifle = 0x7F229F94,    weapon_bullpupshotgun = 0x9D61E50F,    weapon_bzgas = 0xA0973D5E,    weapon_carbinerifle = 0x83BF0278,    weapon_combatmg = 0x7FD62962,    weapon_combatpistol = 0x5EF9FEC4,    weapon_crowbar = 0x84BD7BFD,    weapon_dagger = 0x92A27487,    weapon_digiscanner = 0xFDBADCED,    weapon_fireextinguisher = 0x060EC506,    weapon_firework = 0x7F7497E5,    weapon_flare = 0x497FACC3,    weapon_golfclub = 0x440E4788,    weapon_grenade = 0x93E220BD,    weapon_grenadelauncher = 0xA284510B,    weapon_grenadelauncher_smoke = 0x89D58DB2,    weapon_gusenberg = 0x61012683,    weapon_hammer = 0x4E875F73,    weapon_heavypistol = 0xD205520E,    weapon_heavyshotgun = 0x3AABBBAA,    weapon_heavysniper = 0x0C472FE2,    weapon_hominglauncher = 0x63AB0442,    weapon_knife = 0x99B507EA,    weapon_marskmanrifle = 0xC8E9C778,    weapon_microsmg = 0x13532244,    weapon_mg = 0x9D07F764,    weapon_minigun = 0x42BF8A85,    weapon_molotov = 0x24B17070,    weapon_musket = 0xA89CB99E,    weapon_nightstick = 0x678B81B1,    weapon_petrolcan = 0x34A67B97,    weapon_pistol = 0x1B06D571,    weapon_pistol50 = 0x99AEEB3B,    weapon_proxmine = 0xAB564B93,    weapon_pumpshotgun = 0x1D073A89,    weapon_sawnoffshotgun = 0x7846A318,    weapon_smg = 0x2BE6766B,    weapon_smokegrenade = 0xFDBC8A50,    weapon_sniperrifle = 0x05FC3C11,    weapon_snowball = 0x0787F0BB,    weapon_snspistol = 0xBFD21232,    weapon_specialcarbine = 0xC0A3098D,    weapon_stickybomb = 0x2C3731D9,    weapon_stinger = 0x687652CE,    weapon_stungun = 0x3656C8C1,    weapon_remotesniper = 0x33058E22,    weapon_rpg = 0xB1CA77B1,    weapon_vintagepistol = 0x083839C4,};
DOUBLE EDIT: Here are the next gen weapons

 

 

typedef enum Weapons_NextGen : DWORD{    weapon_hatchet = 0xF9DCBF2D,    weapon_railgun = 0x6D544C99,};
Edited by XeClutch

Share this post


Link to post
Share on other sites
GTA Imperium

Thanks

Share this post


Link to post
Share on other sites
StevorNtheHouse

Nice job Alex. Looking forward to seeing the dev community open doors to expanding GTA 5 and unleasing potential with these new natives. I feel like I'm in 2009 again when I first purchased GTA IV. It was during that era I taught myself c++ and wrote a sub menu that quickly excelled the time to write a new native. Also met some pretty amazing people during that time. Thanks so much.

 

For the sake of an argument I have always preferred c++ over .NET. :cool:

 

Flash back code

void CustomFiberThread::MonsterExplosions(){	Ped ped = GetPlayerPed();	Player playerIndex = ConvertIntToPlayerIndex(GetPlayerId());	GetPlayerChar(playerIndex, &ped);	f32 X, Y, Z;	GetDeadCharCoordinates(ped, &X, &Y, &Z);	//AddExplosion(X, Y, Z, 0, 1.0f + expType, 1 + expType, 0, 1);		AddExplosion(X+fireX, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	// Surrounding Explosions (distance from Player)	AddExplosion(X+fireX+15, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX-15, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY+15, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY-15, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ+15, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ-15, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX+25, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX-25, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY+25, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY-25, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ+25, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ-25, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	// Further away	AddExplosion(X+fireX+1000, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX-1000, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY+1000, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY-1000, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ+1000, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ-1000, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	if (expType >  1255)	{		expType = 0; 	}	sprintf_s(mes1, 300,"Monster Explosions: %f, %i, %f" , 1.0f + expType, 1 + expType, 0, 1);	PrintStringWithLiteralStringNow("STRING", mes1, 9500, 1);}
Edited by StevorNtheHouse

Share this post


Link to post
Share on other sites
StevorNtheHouse

Posted Today, 09:19 PM Edited by StevorNtheHouse, Today, 10:34 PM.

Nice job Alex. Looking forward to seeing the dev community open doors to expanding GTA 5 and unleasing potential with these new natives. I feel like I'm in 2009 again when I first purchased GTA IV. It was during that era I taught myself c++ and wrote a sub menu that quickly excelled the time to write a new native. Also met some pretty amazing people during that time. Thanks so much.

For the sake of an argument I have always preferred c++ over .NET. :cool:

Flash back code

void CustomFiberThread::MonsterExplosions(){	Ped ped = GetPlayerPed();	Player playerIndex = ConvertIntToPlayerIndex(GetPlayerId());	GetPlayerChar(playerIndex, &ped);	f32 X, Y, Z;	GetDeadCharCoordinates(ped, &X, &Y, &Z);	//AddExplosion(X, Y, Z, 0, 1.0f + expType, 1 + expType, 0, 1);		AddExplosion(X+fireX, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	// Surrounding Explosions (distance from Player)	AddExplosion(X+fireX+15, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX-15, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY+15, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY-15, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ+15, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ-15, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX+25, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX-25, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY+25, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY-25, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ+25, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ-25, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	// Further away	AddExplosion(X+fireX+1000, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX-1000, Y+fireY, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY+1000, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY-1000, Z+fireZ, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ+1000, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	AddExplosion(X+fireX, Y+fireY, Z+fireZ-1000, 0, explosionType, AddExpRadius, isExplosionVisible, cameraShake);	if (expType >  1255)	{		expType = 0; 	}	sprintf_s(mes1, 300,"Monster Explosions: %f, %i, %f" , 1.0f + expType, 1 + expType, 0, 1);	PrintStringWithLiteralStringNow("STRING", mes1, 9500, 1);}

Sorry for the double post. Can't get the other post to delete.

 

Edited by StevorNtheHouse

Share this post


Link to post
Share on other sites
proditaki

Too bad the PC release was delayed.

 

I'm looking for a way to get the angle on the axis of what your ped is aiming at.

Does anybody know how to get that?

 

Below it's illustrated.. i would want to calculate a point on the BLUE line.

(and want the red angle)

 

azimuth-elevation.png

Edited by proditaki

Share this post


Link to post
Share on other sites
StevorNtheHouse

Could someone here supply me with a link or the tool that is used to decompile the SCO scripts. I had it before, but I lost it. I've been away from the GTA community for a long time, but I'm interested in contributing to help out with the research when I find the time. Coding is my life regardless. It is great to see familiar names on here again, such as Nixo, etc. Has anybody heard from SneakyJanit0r in awhile?

Share this post


Link to post
Share on other sites
IgorX

Could someone here supply me with a link or the tool that is used to decompile the SCO scripts. I had it before, but I lost it. I've been away from the GTA community for a long time, but I'm interested in contributing to help out with the research when I find the time. Coding is my life regardless. It is great to see familiar names on here again, such as Nixo, etc. Has anybody heard from SneakyJanit0r in awhile?

You can decompile modified sco scripts in Low-Level code only, but IV sco's on hl or ll. Use OpenIV for this.

Scocl has tool in bin folder that decompililng modified scripts in LowLevel code.

Share this post


Link to post
Share on other sites
ClareXoBearrx3R9

 

The .net hook didn't call game natives directly (even though you could call them directly) and had many things preconfigured. Yes that is indeed easier to use but makes customization harder to achieve.

 

The scripthook came with a development loader in which any asi/dll that was loaded could be unloaded and reloaded. Including the .net scripthook by the way. Which is another downside I mentioned before, it is another layer.

 

 

Though I have never programmed in .NET (I'm fluent mainly in only C and C++), I personally noticed large performance hits when using others' .NET modifications.

 

As sjaak mentioned, easier isn't always better. For general programming, Java is considered a useful language to be familiar in since it can be compiled once and the same code can run on any system that has the Java Virtual Machine - be it Windows, Linux, Mac, or otherwise (unlike C and C++ that must usually be re-compiled for different systems). However, for certain high-demanding applications, Java programs may suffer from performance issues due to to the additional JVM layer that must "translate" the compiled Java code on-the-fly.

Share this post


Link to post
Share on other sites
Skorpro

Could someone here supply me with a link or the tool that is used to decompile the SCO scripts. I had it before, but I lost it. I've been away from the GTA community for a long time, but I'm interested in contributing to help out with the research when I find the time. Coding is my life regardless. It is great to see familiar names on here again, such as Nixo, etc. Has anybody heard from SneakyJanit0r in awhile?

Hi,

yeah, it's long time ago but I remember your YT clip :)

IMO the best tool to decompile the SCO scripts is (as solom already said) OpenIV.

I'm sure you don't need a TUT how to use SCOCL... anyway, maybe it's useful: Click here :)

 

Here is a ASI SCO Loader (C++).

 

C ya

Share this post


Link to post
Share on other sites
proditaki

Too bad the PC release was delayed.

 

I'm looking for a way to get the angle on the axis of what your ped is aiming at.

Does anybody know how to get that?

 

Below it's illustrated.. i would want to calculate a point on the BLUE line.

(and want the red angle)

 

azimuth-elevation.png

 

Never mind i got it GET_GAMEPLAY_CAM_RELATIVE_PITCH

Edited by proditaki

Share this post


Link to post
Share on other sites
ceedj

Will be going through all the pages in this topic before I start asking questions, but seriously gang, GREAT FREAKING WORK!

 

Love it, will be having fun researching all this!

 

(smacks head)

 

AFTER I finish filming. AFTER. :lol:

 

EDIT: Ok, just one:

 

AI::TASK_PLAY_ANIM(PLAYER::PLAYER_PED_ID(), "rcmpaparazzo_2", "idle_d", 1000f, -1000f, -1, 1, 0.4f, 0, 0, 0);

 

1 = Actor ID

2 = AnimIMG (ifp?)

3 = Animation Name

4 = Float

5 = Float

6 = Flag (loop?)

7 = Flag (hold last animation frame?)

8 = Float (playback rate?)

9 = Flag (X lock?)

10 = Flag (Y lock?)

11 = Flag (Z lock?)

 

Chastise me if you must, no way to test ATM (lost all of my IVStudios source code). Just one I noticed. ;)

 

EDIT2:

IS_AN_ENTITYIS_ENTITY_A_PEDIS_ENTITY_A_MISSION_ENTITY

Is ENTITY a fancy name for an actor/car/object handle?

Edited by ceedj

Share this post


Link to post
Share on other sites
XBLToothPik

Will be going through all the pages in this topic before I start asking questions, but seriously gang, GREAT FREAKING WORK!

 

Love it, will be having fun researching all this!

 

(smacks head)

 

AFTER I finish filming. AFTER. :lol:

 

EDIT: Ok, just one:

 

AI::TASK_PLAY_ANIM(PLAYER::PLAYER_PED_ID(), "rcmpaparazzo_2", "idle_d", 1000f, -1000f, -1, 1, 0.4f, 0, 0, 0);

 

1 = Actor ID

2 = AnimIMG (ifp?)

3 = Animation Name

4 = Float

5 = Float

6 = Flag (loop?)

7 = Flag (hold last animation frame?)

8 = Float (playback rate?)

9 = Flag (X lock?)

10 = Flag (Y lock?)

11 = Flag (Z lock?)

 

Chastise me if you must, no way to test ATM (lost all of my IVStudios source code). Just one I noticed. ;)

 

EDIT2:

IS_AN_ENTITYIS_ENTITY_A_PEDIS_ENTITY_A_MISSION_ENTITY

Is ENTITY a fancy name for an actor/car/object handle?

 

Yea, entity is just a handle in V.

 

EDIT: Also, w/ TASK_PLAY_ANIM:

338e50621e.png

Also, anything new in the world of V scripts, Alexander?

Edited by XBLToothPik

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    1 member, 0 Anonymous, 1 Guest

    • NotMeMan
×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.