Jump to content

Trader issue. Purchased vehicle spawns up in air


NightRain

Recommended Posts

Heya, I've been trying to tinker with this issue for a week. Here's the situation:

I've placed a LHD built in mission editor. I managed to add a Agent there as a trader which functions fine and exists constantly without vanishing into the ocean, right so that functions properly.

The issue is with purchasing a vehicle. It doesn't function as expected. I have included a HeliHCivil on it with a set position that its height should be about the same as carrier's deck. (I tested it previously that if you increase its Z it will spawn the machine exactly at that height and remain frozen in air until touched.) When purchasing a air vehicle it spawns 500m into the air as title informs, it is unclear to me whether the hitbox of the carrier just happens to be that huge or why it does it, this is beyond my ability to comprehend it.

This happens if there are a structure on the spawn point, if none exist it spawns precisely how you'd want it. I tested it by making it spawn above ocean it worked and then placed metal floors about it and bought it again. vehicle spawned in the air again.

I tried to lower the Helipad's height with -X (with X being amount added) but it results in the purchased vehicle spawning in the center of the map.

Are there any solution to how to make it spawn on the helipad even if the helipad is on top of a building or similar? I might've exhausted all my options. Thank you.

 

Update on 1.0.6.1

When purchasing on ocean the vehicle spawns on the bottom of the sea instead of on the helipad.

 

Link to comment
Share on other sites

Not really,

I fixed it by using fnc_getPos to properly get ASL height,  probably other changes as well, it was a while ago. You can look at the 1.0.6.1 github if you want to compare. But you may be wasting your time holding on to 1.0.5.1 because it will be removed from dayzlauncher in 2 weeks

Link to comment
Share on other sites

  • 2 weeks later...

Hey, A double post but this came to my attention.

In 1.0.6.1 I came to a new issue. I've laid the deck for the helipad to its correct height via SetPosASL but apperantly the trader is ignoring the marker  entirely and none of the purchased vehicles spawn in that spot. Instead they spawn down at the bottom of the sea.

I've studied the code and I think that this might be the reason why:

 
Quote

 

//Taken from trade_any_vehicle.sqf

if(count _helipad > 0) then {

_location = getPosATL (_helipad select 0);
} else {
_location = [player] call FNC_GetPos;

};

 

It looks the helipad's location from ATL perspective which means it doesn't look it correctly if the helipad uses SetPosASL.
 

Quote

 

//Helipad onboard the ship

_this = createVehicle ["HeliHCivil", [14736.882, 633.80219, 0], [], 0, "CAN_COLLIDE"];
  _vehicle_236 = _this;
  _this setPosASL [14733.882, 640.80219, 17]; //Height for proper position on ship = 17.

 

 

 

The radius for trader is 100m only but I played with it in the past and it didn't seem to matter.

Currently all purchased vehicles spawn on the helipad- except instead of following the ASL x,zy,z it ignores Z entirely and thus the vehicle spawns at the bottom of the sea.

The marker that indicates where the vehicle spawns appears 500m in to the air. This time the vehicle doesn't spawn there of course hah.

 

Link to comment
Share on other sites

@Epoch Contributor I can't get the trade_any_vehicle.sqf added as a modded script for some reason, how would I be able to use my own version of it instead of calling it from DayZ_Code?

@Hardened Anything above water is wonky since you need to use SetPosASL instead of SetPos or SetPosATL, but it is a little wonky because there is a structure as a platform.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...