Quantcast

Jump to content

» «
Photo

[V] Script/Native Documentation and Research

254 replies to this topic
NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Most Knowledgeable [Technology] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Contribution Award [Modding]

#241

Posted 24 October 2014 - 01:20 AM

>'VM_Execute'

this isn't f*cking call of duty

  • XeClutch likes this

AdamSelene
  • AdamSelene

    Player Hater

  • New Members
  • Joined: 12 Sep 2014
  • Unknown

#242

Posted 26 October 2014 - 02:56 AM Edited by AdamSelene, 26 October 2014 - 02:56 AM.

'VM_Execute'
this isn't f*cking call of duty

and it is an "SM" (Stack Machine) ...

proditaki
  • proditaki

    Square Civilian

  • Members
  • Joined: 20 May 2014
  • Netherlands

#243

Posted 31 October 2014 - 09:35 AM

 

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


MulleDK19
  • MulleDK19

    1337 Programmer

  • Members
  • Joined: 30 May 2009

#244

Posted 21 November 2014 - 02:20 AM

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.

Alexander Blade
  • Alexander Blade

    Come As You Are

  • Members
  • Joined: 05 Nov 2006
  • None

#245

Posted 21 November 2014 - 06:25 AM Edited by Alexander Blade, 21 November 2014 - 06:27 AM.

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.

 


testfr
  • testfr

    Player Hater

  • New Members
  • Joined: 06 Sep 2014
  • Belgium

#246

Posted 4 weeks ago

It's possible to hook a native ? How ?


XeClutch
  • XeClutch

    Founder of Phantomware

  • Feroci
  • Joined: 30 Jan 2013
  • Israel

#247

Posted 3 weeks ago

It's possible to hook a native ? How ?

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

fOmey
  • fOmey

    The King Pin

  • Members
  • Joined: 16 Nov 2006
  • Australia

#248

Posted 2 days ago Edited by fOmey, 2 days ago.

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.


InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#249

Posted 2 days ago

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.

  • fOmey likes this

fOmey
  • fOmey

    The King Pin

  • Members
  • Joined: 16 Nov 2006
  • Australia

#250

Posted 23 hours ago

 

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 !


NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Most Knowledgeable [Technology] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Contribution Award [Modding]

#251

Posted 19 hours ago Edited by NTAuthority, 18 hours ago.

blip icons have always been indices

  • fOmey likes this

funmw2
  • funmw2

    Li'l G Loc

  • Feroci
  • Joined: 30 Sep 2013
  • None

#252

Posted 19 hours ago

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 .

  • fOmey likes this

fOmey
  • fOmey

    The King Pin

  • Members
  • Joined: 16 Nov 2006
  • Australia

#253

Posted 19 hours ago Edited by fOmey, 18 hours ago.

 

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 ?


NTAuthority
  • NTAuthority

    hell, no, tunnel, no

  • Feroci
  • Joined: 09 Sep 2008
  • European-Union
  • Most Knowledgeable [Technology] 2013
    Best Map 2013 "ViceCityStories PC Edition"
    Contribution Award [Modding]

#254

Posted 18 hours ago Edited by NTAuthority, 18 hours ago.

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)

  • fOmey likes this

fOmey
  • fOmey

    The King Pin

  • Members
  • Joined: 16 Nov 2006
  • Australia

#255

Posted 6 hours ago Edited by fOmey, An hour ago.

 

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.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users