Armed Caesar BTT?

Armed Caesar BTT?

« posted: Nov 25, 2016, 01:25 PM »
This has been in high demand by players on my server for awhile now (They want dogfighting). Initially dismissed the idea assuming client side mod would be required to work well, it would cause lag, or depending on implementation may get blocked by antihack.

Recently one of my admins pointed me to a mission which allows customization of all vehicles with player weapons(http://getwrecked.info/). I unpacked the pbo and discovered it was actually simulating the effect of the weapons. The weapons attached to vehicles are just props, and everything from muzzle flash, to gunfire sounds, spawning projectile, assigning velocity to projectile is all scripted. It even simulates ammo magazines and reload times since technically it is not a real weapon being fired. Within the draw loop it checks to see if a mousedown event is active, if so it checks for a player vehicle, loops all attached objects, if they are weapons it begins firing.

I extracted the code I wanted and got a Caesar BTT to fire from attached weapons on my Wasteland Dev server. I'm probably going to go with MK200 rounds if I release it. So technically I already have this working.This dev server is not running battleye though, and I suspect the createVehicle on the bullets may get blocked since it is done client side.

A note on lag... What I noticed in testing so far is that setVelocity creates lag/choppy animations when issued server side, but when done client side it is smooth. Even for other clients (Not tested with large number of players). More testing is required, but my initial assumption is that the client responsible for applying force to the object ends up doing more physics processing and the other clients/server simply validate the state of an object on some kind of interval. Maybe AgentRev or another dev here knows more regarding this behaviour.

Anyway, I am more or less just doing this for fun. If anyone has any feedback or suggestions let me know.








  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1073
  • ^_^;;

Re: Armed Caesar BTT?

« Reply #1 posted: Dec 30, 2016, 11:29 AM »
This has been in high demand by players on my server for awhile now (They want dogfighting). Initially dismissed the idea assuming client side mod would be required to work well, it would cause lag, or depending on implementation may get blocked by antihack.

Recently one of my admins pointed me to a mission which allows customization of all vehicles with player weapons(http://getwrecked.info/). I unpacked the pbo and discovered it was actually simulating the effect of the weapons. The weapons attached to vehicles are just props, and everything from muzzle flash, to gunfire sounds, spawning projectile, assigning velocity to projectile is all scripted. It even simulates ammo magazines and reload times since technically it is not a real weapon being fired. Within the draw loop it checks to see if a mousedown event is active, if so it checks for a player vehicle, loops all attached objects, if they are weapons it begins firing.

I extracted the code I wanted and got a Caesar BTT to fire from attached weapons on my Wasteland Dev server. I'm probably going to go with MK200 rounds if I release it. So technically I already have this working.This dev server is not running battleye though, and I suspect the createVehicle on the bullets may get blocked since it is done client side.

A note on lag... What I noticed in testing so far is that setVelocity creates lag/choppy animations when issued server side, but when done client side it is smooth. Even for other clients (Not tested with large number of players). More testing is required, but my initial assumption is that the client responsible for applying force to the object ends up doing more physics processing and the other clients/server simply validate the state of an object on some kind of interval. Maybe AgentRev or another dev here knows more regarding this behaviour.

Anyway, I am more or less just doing this for fun. If anyone has any feedback or suggestions let me know.

attachTo the correct stuff on spawn when purchasing is done server side i believe ( spawnStoreObject.sqf i think it was ) - no issues with BE.

I used to add DAGR missles to my Pawnee's in a similar fashion.

- from the grassy knoll -
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2287

Re: Armed Caesar BTT?

« Reply #2 posted: Jan 11, 2017, 06:36 PM »
It's actually very easy to add any weapon to any vehicle, using a much simpler method than GetWrecked, although the effects might be unpredictable.

Here's my favorite one; go in the editor, place a kart, and set this as init:

Code: [Select]
this addWeaponTurret ["Gatling_30mm_Plane_CAS_01_F",[-1]]; this addMagazineTurret ["1000Rnd_Gatling_30mm_Plane_CAS_01_F",[-1]];
This method is used by A3Armory to replace DGAR missiles by unguided DAR on some helis. In fact, I included a script that allows you to customize the default weapons and magazines by vehicle class: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/blob/dev/server/functions/fn_setVehicleLoadout.sqf

Here's a loadout that could be interesting for the Caesar:

Code: [Select]
case (_class isKindOf "Plane_Civil_01_base_F"):
{
_mags =
[
["5000Rnd_762x51_Belt", [-1]]
];
_weapons =
[
["M134_minigun", [-1]]
];
};

(I don't know if that one works, your job to try it)

Note that the weapons defined in that file override all the default ones, so if you want to add stuff to a vehicle with existing weapons then you need to include all the default stuff in the config.
  • Offline Matt76
  • Mercenary
  • *****
  • Posts: 388
  • co founder of customcombatgaming.com

Re: Armed Caesar BTT?

« Reply #3 posted: Jan 11, 2017, 08:36 PM »
i can confirm this works well Rev,

i think this will be a fun edition for the players and utilise such an underused plane :)
  • Offline eldrich
  • First Blood
  • ***
  • Posts: 62
  • 40-1 Clan

Re: Armed Caesar BTT?

« Reply #4 posted: Jan 13, 2017, 02:18 PM »
works fine so far thanks Rev :)

Re: Armed Caesar BTT?

« Reply #5 posted: Feb 01, 2017, 11:22 AM »
Hmm well I did it this way:

Nevermind. Does not work. Still using my "own" method that is wrong but working.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2287

Re: Armed Caesar BTT?

« Reply #6 posted: Feb 01, 2017, 11:24 AM »
This is the wrong way to do it, use fn_setVehicleLoadout. -1 is pilot, 0 is copilot.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2287

Re: Armed Caesar BTT?

« Reply #7 posted: Feb 01, 2017, 02:32 PM »
The reason why it's wrong is because if you have vehicle saving, it will keep adding an extra magazine every server restart.

Re: Armed Caesar BTT?

« Reply #8 posted: Feb 03, 2017, 10:37 PM »
The reason why it's wrong is because if you have vehicle saving, it will keep adding an extra magazine every server restart.

And then again there is this:

\server\functions\vehicleSetup.sqf
Code: [Select]
case (_class == "C_Plane_Civil_01_racing_F"):
{
_vehicle addWeaponTurret ["gatling_20mm", [-1]];
if (_brandNew) then
{
_vehicle addMagazineTurret ["1000Rnd_20mm_shells", [-1]];
};
};

No extra mags now eh?

Anyway when my storeconfig is:
Code: [Select]
planesArray = compileFinal str
[
["Caesar BTT", "C_Plane_Civil_01_F", 3000, "vehicle"],
["Caesar BTT Armed", "C_Plane_Civil_01_racing_F", 15000, "vehicle"],

Then your code does not give me guns. Mine does.

Just waiting for that you suck and your code suck post now.

  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2287

Re: Armed Caesar BTT?

« Reply #9 posted: Feb 04, 2017, 01:12 AM »
> "your code suck"
> runs A3W server


Re: Armed Caesar BTT?

« Reply #10 posted: Feb 05, 2017, 10:38 PM »
So. I am confused is the correct way to do this in the Vehicle Setup or in Vehicle Loadout. I tried the vehicle loadout and I could not get it working.

Ive been setting up a wasteland server and these forums have been invaluable the last few days.
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2287

Re: Armed Caesar BTT?

« Reply #11 posted: Feb 06, 2017, 02:23 PM »

Re: Armed Caesar BTT?

« Reply #12 posted: Feb 09, 2017, 04:15 PM »
You guys are fantastic thanks

Honestly Rev. I wonder if Bohemia knows just how much money you guys make them. No one buys Arma for the Singleplayer.

Re: Armed Caesar BTT?

« Reply #13 posted: Feb 20, 2017, 08:29 PM »
Thanks AgentRev, this works great.


I assumed this thread was dead and I come back after taking a break from Arma in the new year and AgentRev has a better solution. I actually looked the addWeaponTurret method and I can't remember why but I concluded it wasn't going to work for my purposes. I can't recall exactly why.

The getwrecked solution had the advantage of positioning props, but its definitely worth the sacrifice to go with this simpler solution. It's too bad I coded a lot of the implementation based on my original idea, just throw away code now.