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. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    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 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 Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA 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

gtaVmod

Applying visible damage to car

Recommended Posts

gtaVmod

Is it possible?

setting damage via SET_VEHICLE_BODY_HEALTH() does not visualize anything

Share this post


Link to post
Share on other sites
ISOFX

I'm not sure if there's a native but you could spawn a car at another place and set its speed to about 70 so,

Game.Player.Character.CurrentVehicle.Speed = 70;

Spawn it near a wall and make it crash into the wall. Then set its position to the position you want.

That's the only way I can think of.

Hope it helps! :)

Share this post


Link to post
Share on other sites
GeorgeZhang
VEHICLE::SET_VEHICLE_DAMAGEHashes: 0xA1DD317EA8FD4F29 0x21B458B2void SET_VEHICLE_DAMAGE(Vehicle vehicle, float xOffset, float yOffset,  float zOffset, float damage, float radius, BOOL p6)// 0xA1DD317EA8FD4F29 0x21B458B2Apply damage to vehicle at a location. Location is relative to vehicle model (not world).Radius of effect damage applied in a sphere at impact location

Copied directly from NativeDB. It rarely works (in my case), there's only a few times it actually made a dent in the car's body. Please inform me if anyone realize how to make it work everytime...

 

EDIT: btw, you can just add an invisible explosion near the car as a workaround.

Edited by GeorgeZhang

Share this post


Link to post
Share on other sites
gtaVmod

 

Copied directly from NativeDB.

 

Thanks, i missed it somehow but do search for DAMAGE keyword though.

 

Another question related to vehicle damage, there is two functions: SET_PLAYER_VEHICLE_DAMAGE_MODIFIER and SET_PLAYER_VEHICLE_DEFENSE_MODIFIER. And while first one works (setting it high would cause other cars to catch fire on impact when you hit them hard) the second seems like does nothing.

I want to make player car more fragile to hits...

Share this post


Link to post
Share on other sites
GeorgeZhang

 

 

Copied directly from NativeDB.

 

Thanks, i missed it somehow but do search for DAMAGE keyword though.

 

Another question related to vehicle damage, there is two functions: SET_PLAYER_VEHICLE_DAMAGE_MODIFIER and SET_PLAYER_VEHICLE_DEFENSE_MODIFIER. And while first one works (setting it high would cause other cars to catch fire on impact when you hit them hard) the second seems like does nothing.

I want to make player car more fragile to hits...

 

I think the second one can only makes your car stronger? Since SET_PLAYER_WEAPON_DEFENSE_MODIFIER makes the player more endurable, but cannot be weaker.

Edited by GeorgeZhang

Share this post


Link to post
Share on other sites
gtaVmod

theoretically it can accept negative value but i don't noticed any changes

Share this post


Link to post
Share on other sites
totolia

There is some way to apply blows to a car without using a force.
I want to apply blows without moving the car, I am trying to use SET_VEHICLE_DAMAGE but it does not work.

 

Vector3 rel_position = Function.Call<Vector3>(Hash.GET_OFFSET_FROM_ENTITY_GIVEN_WORLD_COORDS, curr_vehicle, position.X, position.Y, position.Z);
Function.Call(Hash.SET_ENTITY_CAN_BE_DAMAGED, curr_vehicle, true);
Function.Call(Hash.SET_VEHICLE_CAN_BE_VISIBLY_DAMAGED, curr_vehicle, true);
Function.Call(Hash.SET_VEHICLE_DAMAGE, curr_vehicle, rel_position.X, rel_position.Y, rel_position.Z, 100000, 500000);

 

Share this post


Link to post
Share on other sites
dirtmanforever
On 10/5/2015 at 3:36 AM, GeorgeZhang said:
VEHICLE::SET_VEHICLE_DAMAGEHashes: 0xA1DD317EA8FD4F29 0x21B458B2void SET_VEHICLE_DAMAGE(Vehicle vehicle, float xOffset, float yOffset,  float zOffset, float damage, float radius, BOOL p6)// 0xA1DD317EA8FD4F29 0x21B458B2Apply damage to vehicle at a location. Location is relative to vehicle model (not world).Radius of effect damage applied in a sphere at impact location

Copied directly from NativeDB. It rarely works (in my case), there's only a few times it actually made a dent in the car's body. Please inform me if anyone realize how to make it work everytime...

 

EDIT: btw, you can just add an invisible explosion near the car as a workaround.

try...

 

SET_VEHICLE_DAMAGE(vehicle, vehicle.Model.Dimension.X / 2f, 1f, 0f, 100f, 0.25f, true);

 

the idea to use the model X dimension is to go from the center of the car to make the point of impact on the side of the car, positive X would be right side... then the Y offset should be calculated from the Y dimension to go from front to back of the car, in my example i just moved it forward a little and made an impact 0.25f in radius... i think 100f might do the most intense damage (probably on a 0 to 100 scale)

 

not sure if you are using model dimension but i think to make it work everytime you need to put the damage in a specific place and not just guess.

 

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.

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.


  • 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.