Quantcast

Jump to content

» «
Photo

[.NET] (working title) Getting All Vehicles/PEDS Currently in the Game World

4 replies to this topic
OfficerJohnson
  • OfficerJohnson

    Crackhead

  • Members
  • Joined: 07 Jan 2018
  • United-States

#1

Posted 2 weeks ago

Hi all.

I would like to play around with this concept a bit. I'd like to know if it's possible to...store all the current peds/vehicles that are in the game world? Not like getting closest peds or vehicles.

Maybe a quick scenario would explain my goals better...Lets say I want to do the following:

-Capture the total number of vehicles/Peds in one "recording" (one function call)
-Capturing and updating the total number of vehicles/Peds currently rendered in the game world
-Writing the name of the PED/vehicle to the screen as this capture updates
-Change a PED/vehicle in this capture into another (capture all peds, if ped is LSPD cop model, change all to SWAT)

These are just some of the things I'd like to play around with. My goal is to create some kind of ambient dispatching system, where if a crime does occur in the game world, it will be added to a list and you can respond to it and investigate, where a blip and marker line will render.

Bob_74
  • Bob_74

    Crackhead

  • Members
  • Joined: 05 Jan 2018
  • None

#2

Posted 2 weeks ago

You can get all Vehicles and all Peds loaded by the game easily with ScriptHookVDotNet (loaded means the ones around you, the game only loads Vehicles and Peds in a radius around the player):

World.GetAllPeds() // You can filter by model: World.GetAllPeds("TheModelName")
World.GetAllVehicles() // Same
  • OfficerJohnson likes this

OfficerJohnson
  • OfficerJohnson

    Crackhead

  • Members
  • Joined: 07 Jan 2018
  • United-States

#3

Posted 2 weeks ago

 

You can get all Vehicles and all Peds loaded by the game easily with ScriptHookVDotNet (loaded means the ones around you, the game only loads Vehicles and Peds in a radius around the player):

World.GetAllPeds() // You can filter by model: World.GetAllPeds("TheModelName")
World.GetAllVehicles() // Same

Okay. This is better than nothing. Will have to keep playing with things. Thanks again, Bob.


nm710
  • nm710

    None

  • Members
  • Joined: 15 Aug 2016
  • United-States

#4

Posted 2 weeks ago

 

You can get all Vehicles and all Peds loaded by the game easily with ScriptHookVDotNet (loaded means the ones around you, the game only loads Vehicles and Peds in a radius around the player):

World.GetAllPeds() // You can filter by model: World.GetAllPeds("TheModelName")
World.GetAllVehicles() // Same

Do you know the maximum radius of collection? Or is that a variable that GTAV changes?


Bob_74
  • Bob_74

    Crackhead

  • Members
  • Joined: 05 Jan 2018
  • None

#5

Posted 2 weeks ago

 

 

You can get all Vehicles and all Peds loaded by the game easily with ScriptHookVDotNet (loaded means the ones around you, the game only loads Vehicles and Peds in a radius around the player):

World.GetAllPeds() // You can filter by model: World.GetAllPeds("TheModelName")
World.GetAllVehicles() // Same

Do you know the maximum radius of collection? Or is that a variable that GTAV changes?

 

I don't know the radius, it is set by the game itself. It may even not really be a real radius since the game may only load what can be seen by the player.

If you want to increase the radius, you can't do that easily, but if you want to reduce it, you can use:

World.GetClosestPed(Vector3 position, float radius)
  • nm710 likes this




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users