Open Lupus590 opened 4 months ago
Scorpii — Today at 23:15 So TFAR comes built in with a function called TFAR_AdditionalLR_Turret[] which you can insert into the class of a vehicle The way the funtion works is you need to find the turret index number by running the following script while you're in each position of the vehicle: vehicle player unitTurret player; - returns the numerical index of the turret in the vehicle's config vehicle player getCargoIndex player; - returns the cargo index of the seated position
lupus590 — Today at 23:19 It might be good for me to look at your config as our springbok commanders don't have an LR in their seat.
Scorpii — Today at 23:19 The turret index is unique to every seat in a vehicle and is dependent on how the vehicle is config'd. All I did was the following:
lupus590 — Today at 23:20 Wow, that's simple. Finding the number is the hard part then.
Scorpii — Today at 23:20 The index number is the numerical value assigned to the commander seat of the vehicle Nah its really not Go into a MP session (local or on the server as an admin), go into the seat you need to look up the index for, and run the following function in the debug console: vehicle player unitTurret player; It should return a number in brackets, for example the gunner seat in the BTR returns as [0]. the commander seat is [1] and the driver seat is [-1] When you put it into TFAR_AdditionalLR_Turret, if you want to apply an LR to a turret, you need to input each number in { } instead of [ ] AND you need to state each index in a seperate { } per one For example, if I wanted to apply an LR to the gunner and the driver seat, the funtion would be as follows: TFAR_AdditionalLR_Turret[] = {{0},{-1}}; Btw no documentation of this function on the TFAR wiki, so Dedmen (the current maintainer of TFAR) held this esoteric knowledge
lupus590 — Today at 23:25 I love undocumented features.
Scorpii — Today at 23:26 Very simple and cool feature. Be aware though that this function only works on vehicle positions coded as turrets. So as long as the springbak commander position is a turret, it will work If you run vehicle player unitTurret player; and get empty brackets, then shit out of luck Also turning out can also count as a seperate turret so make sure to get the index for turning out as well
Springbok command seat doesn't have an LR built in but the driver and gunner do have one