DC's AH64 into vanilla 42 (cd version)

Ask questions, discuss ideas, get answers
Post Reply
Theoryus
Posts: 7
Joined: Mon Jun 30, 2014 4:02 pm

DC's AH64 into vanilla 42 (cd version)

Post by Theoryus »

I don't know if anyone is still here but I could use a hand if possible. I've managed to bring the apache into the original bf1942. That being said I'm struggling with figuring out how to add a repair spot for it. Whenever I add a repair point it works fine for other air vehicles like SBD and the Corsair but not the Apache.

I'm just doing this for fun/learning. I'm not a coder or anything but most of the .con files do make some sense to me.

Also on a side note I'm using BF:MDT and BGA and I'm having an issue repacking map rfa's. I'm not sure I'm packing the right directories or if the base path is correct.

Appreciate any help thx.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: DC's AH64 into vanilla 42 (cd version)

Post by freddy »

Every supplydepot have there vehicles listed together with some numbers (how fast they repair)

Look for example in Objects/Buildings/Common for Hangar1 and then in that Objects.con, its easy to see where you need to add your own vehicle

Code: Select all

ObjectTemplate.create SupplyDepot AirplaneRepairpoint
ObjectTemplate.radius 30
ObjectTemplate.team 0
rem ObjectTemplate.addVehicleType tiger -1 2 0
rem ObjectTemplate.addVehicleType Panzeriv -1 2 0
rem ObjectTemplate.addVehicleType hanomag -1 2 0
rem ObjectTemplate.addVehicleType wespe -1 2 0
rem ObjectTemplate.addVehicleType kubelwagen -1 2 0
rem ObjectTemplate.addVehicleType sherman -1 2 0
rem ObjectTemplate.addVehicleType m3a1 -1 2 0
rem ObjectTemplate.addVehicleType priest -1 2 0
rem ObjectTemplate.addVehicleType willy -1 2 0
rem ObjectTemplate.addVehicleType m10 -1 2 0
rem ObjectTemplate.addVehicleType chi-ha -1 2 0
rem ObjectTemplate.addVehicleType T34 -1 2 0
rem ObjectTemplate.addVehicleType T34-84 -1 2 0
ObjectTemplate.addVehicleType B17 -1 10 0
ObjectTemplate.addVehicleType corsair -1 15 0
ObjectTemplate.addVehicleType sbd -1 15 0
ObjectTemplate.addVehicleType sbd-t -1 15 0
rem ObjectTemplate.addVehicleType mustang -1 15 0
ObjectTemplate.addVehicleType spitfire -1 15 0
ObjectTemplate.addVehicleType bf109 -1 15 0
rem ObjectTemplate.addVehicleType stuka -1 15 0
ObjectTemplate.addVehicleType aichival -1 15 0
ObjectTemplate.addVehicleType aichival-t -1 15 0
rem ObjectTemplate.addVehicleType Ilyushin -1 15 0
ObjectTemplate.addVehicleType zero -1 15 0
ObjectTemplate.addVehicleType yak9 -1 5 0
ObjectTemplate.addVehicleType KettenKrad -1 15 0
rem ObjectTemplate.addVehicleType Sturmgeschutz -1 4 0
rem ObjectTemplate.addVehicleType M3GMC -1 4 0
rem ObjectTemplate.addVehicleType M3Grant -1 4 0
rem ObjectTemplate.addVehicleType m11-39 -1 4 0
ObjectTemplate.addVehicleType BF110 -1 4 0
ObjectTemplate.addVehicleType Mosquito -1 4 0

ObjectTemplate.addAmmoType 7 -1 8 0
ObjectTemplate.addAmmoType 8 -1 180 0

ObjectTemplate.addAmmoType 9 -1 8 0
ObjectTemplate.addAmmoType 10 -1 180 0
ObjectTemplate.workOnVehicles 1
ObjectTemplate.workOnSoldiers 0
Map based code if you only need it in a certain map or two

Code: Select all

ObjectTemplate.Active AirplaneRepairpoint
ObjectTemplate.addVehicleType Name_of_Chopper -1 4 0
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: DC's AH64 into vanilla 42 (cd version)

Post by Swaffy »

Image
Last edited by Swaffy on Wed Jul 09, 2014 2:50 pm, edited 3 times in total.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Theoryus
Posts: 7
Joined: Mon Jun 30, 2014 4:02 pm

Re: DC's AH64 into vanilla 42 (cd version)

Post by Theoryus »

Thanks for the reply. I wasn't sure if a mod was going to approve my post. I'm pretty sure I gave that a try already swapping out the corsair for AH64. I'll go back thru and give it another go. maybe I missed something. That being said I was reading another site that says "Since this is a custom plane made after BF was released, the standard repair object won't work on it. It needs it's own custom one." about 3/4 the way down the page here. http://home.earthlink.net/~dweller_bent ... adding.htm . I tried giving that a go but replacing their names with AH64 in all the files and folder names.

Do you happen to know if that is a server necessity only or if the client would need the map file as well for the map only code?
Theoryus
Posts: 7
Joined: Mon Jun 30, 2014 4:02 pm

Re: DC's AH64 into vanilla 42 (cd version)

Post by Theoryus »

Swaffy wrote:Mind if I try out the Apache when you get done? Or at least show me a thorough video. :3 I just like to appreciate other people's work, maybe learn from them too.
Hey Swaffy I'm not really creating a "Mod" per say to upload or share. I basically just made an exact copy of the game folder and renamed it to test server to try this. Getting the Apache itself into vanilla 42 is pretty easy. It's the lil details that were a pain so far. You guys around here familiar with modding could probably do it in under an hour. Basically what I did was create 2 folders on my desktop. One called 1942 and one DC. Using winRFA I unpacked the Animations, Object, Sound, Menu, Texture, standardMesh and Game RFAs from the DC mod into my new DC folder and the same for 1942. I copied everything pertaining to the Apache from DC to 1942. I edited a handful of files and repacked them. Replaced an SBD spawner in the map file with the name AH64 and there it was.

The tricky part is a few files that need editing and figuring out the sound and effects files the apache uses. I'd be glad to give ya a hand with it but I don't make videos and what not.

most of this i figured out reading through these forums for similar ideas and their backup serversidemodding pages they have here.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: DC's AH64 into vanilla 42 (cd version)

Post by Swaffy »

Woops I'm sorry. I thought someone was making one from scratch with a whole new model, code, etc. :?

Think about it like this. You can't have two separate objects in the game with the same type (Player Control Object in this case) and the same name. But it's okay to have different type objects (StaticObject, StandardMesh, Geometry, PCO, etc) with the same name. Also keep in mind that the only reason your AH-64 isn't being repaired is because the object's name wasn't added to the list for those SupplyDepot object. Try out the idea freddy put up. If you need specific help as to where this code is, please ask.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Theoryus
Posts: 7
Joined: Mon Jun 30, 2014 4:02 pm

Re: DC's AH64 into vanilla 42 (cd version)

Post by Theoryus »

Basically what I am trying to do is add repair points along the entire length of the deck of the Enterprise aircraft carrier. Making it so that if you fly slowly (SBD in this case) just a couple feet above the deck for the entire length you could repair a fair amount of damage. In addition to adding that ability for the Apache. I was able to get it to work (sloppily for the SBD) by adding code 11 times with 11 different x/z/y locations. I know there is a simpler way to create a template and then just call it somehow rather than writing the whole code 11 times but I haven't made it that far in my learning yet.

Digging around on various threads the last couple weeks here and the SSM page for How To Add Repair Points this is what I came up with.
I put this in objects/vehicles/sea/Enterprise/objectspawns.con file 11 times. Since I was crashing when a second client connected I had removed the code.

Code: Select all

rem --------- Enterprise Repair -------------
rem ----------------------------------------- 
rem ---  airplanerepairpoint 1  ---
rem -----------------------------------------
Object.create AirplaneRepairpoint
Object.absolutePosition 1527.33/96.32/1942.33
ObjectTemplate.radius 30
ObjectTemplate.team 0
ObjectTemplate.addAmmoType 0 -1 30 0
ObjectTemplate.workOnVehicles 1
ObjectTemplate.workOnSoldiers 0
Ultimately I think what i need to do is figure out how to get it in there like this

Code: Select all

ObjectTemplate.addTemplate Ammobox
ObjectTemplate.setPosition 11.7/18.605/-118.999
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/-100
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/-70
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/-40
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/-10
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/20
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/50
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/70
ObjectTemplate.addTemplate EnterpriseAirplaneSupplyDepot
ObjectTemplate.setPosition 0/15/100
As far as freddy's map based code. Where would I put that and how would I set the positions?
Appreciate the help!!

update: editing the hangar file worked for the apache! /facepalm Apparently the original change I made was to the game's default directory instead of my test server's directory.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: DC's AH64 into vanilla 42 (cd version)

Post by Swaffy »

You are on the right track. For now, I'd use a visible object to act as a marker for the position, that way you can see where it is in-game and move it to the correct spot. Center this visible object on the carrier's deck, then just code the rest of the objects frontward and backward from the original object. That way you can get the height correct and the right/left and front/back coordinates correct.

Then just replace the visible objects with the SupplyDepot objects.

addTemplate.setPosition (Left|Right)/(Up|Down)/(Front|Back)

So you'd begin by setting the beginning objects in the middle,
  • objectTemplate.addTemplate objectName
    objectTemplate.setPosition -3/10/0
    objectTemplate.addTemplate objectName
    objectTemplate.setPosition 3/10/0
Then just copy/paste the other objects and change the third value from 0 to whatever. That way you can have two "lines" of SupplyDepots going down the runway, for better repairing.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: DC's AH64 into vanilla 42 (cd version)

Post by freddy »

Theoryus wrote:Basically what I am trying to do is add repair points along the entire length of the deck of the Enterprise aircraft carrier.
Well thats easy enough, you can use the carriers supply depots, they are already placed along the deck. Go to the Enterprise files in objects.con, find the EnterpriseAirplaneSupplyDepot

You make the radius bigger so it can reach the plane/chopper when they fly over the deck

Code: Select all

rem *** ShokakuAirplaneSupplyDepot ***
ObjectTemplate.create SupplyDepot EnterpriseAirplaneSupplyDepot
rem --  some value change --
rem ObjectTemplate.radius 20
ObjectTemplate.radius 35
rem ObjectTemplate.team 0
ObjectTemplate.team 2
rem ObjectTemplate.setHealth 0 0 0
ObjectTemplate.setHealth -1 4 0
rem -- adding vehicle to heal --
ObjectTemplate.addVehicleType corsair -1 10 0
ObjectTemplate.addVehicleType SBD -1 10 0
ObjectTemplate.addAmmoType 10 -1 20 0
ObjectTemplate.addAmmoType 9 -1 2 0
ObjectTemplate.workOnVehicles 1
ObjectTemplate.workOnSoldiers 0
you have to change the team value to 2 (ObjectTemplate.team 2) otherwise the enemy keep getting healed if they steal a plane/chopper

edit: mapbased the code would look something like this

Code: Select all

ObjectTemplate.Active EnterpriseAirplaneSupplyDepot
ObjectTemplate.radius 35
ObjectTemplate.team 2
ObjectTemplate.setHealth -1 4 0
ObjectTemplate.addVehicleType Name_of_Chopper -1 4 0
And this works fine when you use it in a server, the players can not see the repair symbol when they fly over the Enterprise if they dont have the same patch file, but they still gets repaired.
Theoryus
Posts: 7
Joined: Mon Jun 30, 2014 4:02 pm

Re: DC's AH64 into vanilla 42 (cd version)

Post by Theoryus »

I haven't had a chance to try out the last two reply's yet but thank you both for help'n out!!
Post Reply