Community Forum

Reset Vehicles

Forum Overview >> Scripting

CategoryScripting
Created11.05.2017 17:53


Aden Kuenzi (akuenzi) 11.05.2017 17:58
I have a couple questions that I think are related:

1. How does one change the vehicle reset point through a script? In g_currentMission, I've seen data for loadSpawnPlaces and storeSpawnPlaces. The data in these tables match the map's store spawning (and reset) location. However, when I've attempted to manipulate this data with a script, I've been unsuccessful in having it work in-game. Is there another place where this information should be changed in order for it to work properly?

2. Related to the above, which function is activated when a player asks for a vehicle to be reset? Someone else asked me if it was possible to charge the player a 'fee' for resetting vehicles, the premise being that it would cost money in real life to pull a vehicle out of a tight spot. I'm assuming this is possible, but after hours of searching the LUADOC, I don't see the place where vehicle re-setting takes place.

Thank you!

Emil Drefers (Unknown) 12.05.2017 08:03
Hi,

1.
Right, the table "g_currentMission.loadSpawnPlaces" is used to find a spot to place the vehicle.
What values did you change?
You could remove all "places" and create new ones which you can insert into the table by using:
local place = PlacementUtil.createPlace(id)

2.
The vehicle is deleted and loaded again.
https://gdn.giants-software.com/documentation_scripting.php?version=script&category=69&class=3534
search for "resetVehicles" ;)

Cheers,
Emil





Note: Log in to post. Create a new account here.