SSM - Ambient helicopter

Lots of cool and useful tips to mod either serverside or clientside
Post Reply
Darkstef
Posts: 30
Joined: Wed Oct 21, 2009 4:49 pm

SSM - Ambient helicopter

Post by Darkstef »

Hello all, I'm Darkstef ( or Darky ).
I want to explain to you how create helico as that
Image

So for the mh53, we have to active :

Code: Select all

ObjectTemplate.active MH-53
Add the engine :

Code: Select all

ObjectTemplate.addTemplate MH53DummyEngine
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate MH53HoverEngine1
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate MH53HoverEngine2
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate MH53HoverEngine3
ObjectTemplate.setPosition 0/0/0
And modify engines...

Code: Select all

ObjectTemplate.active MH53DummyEngine
ObjectTemplate.setMinRotation 300/0/300
ObjectTemplate.setMaxRotation 300/0/300
ObjectTemplate.setMaxSpeed 300/0/300
ObjectTemplate.setAcceleration 100/100/100
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 0
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque 100
ObjectTemplate.setDifferential .1
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150
ObjectTemplate.timetoliveafterdeath 1

ObjectTemplate.active MH53HoverEngine1
ObjectTemplate.setMinRotation 300/-130/300
ObjectTemplate.setMaxRotation 300/0/300
ObjectTemplate.setMaxSpeed 50/50/70
ObjectTemplate.setAcceleration 50/50/100
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque 9
ObjectTemplate.setDifferential 6
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150
ObjectTemplate.timetoliveafterdeath 1

ObjectTemplate.active MH53HoverEngine2
ObjectTemplate.setMinRotation 300/-130/300
ObjectTemplate.setMaxRotation 300/0/300
ObjectTemplate.setMaxSpeed 50/50/70
ObjectTemplate.setAcceleration 50/50/100
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque 9
ObjectTemplate.setDifferential 6
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150
ObjectTemplate.timetoliveafterdeath 1

ObjectTemplate.active MH53HoverEngine3
ObjectTemplate.setMinRotation 300/-130/300
ObjectTemplate.setMaxRotation 300/0/300
ObjectTemplate.setMaxSpeed 50/50/70
ObjectTemplate.setAcceleration 50/50/100
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque 9
ObjectTemplate.setDifferential 6
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150
ObjectTemplate.timetoliveafterdeath 1
after that disable entry and spawn

Code: Select all

ObjectTemplate.Active MH53SoldierSpawn
ObjectTemplate.SetEnterOnSpawn 0

ObjectTemplate.Active MH53PassEntry
ObjectTemplate.setEntryRadius 0

ObjectTemplate.Active MH53PilotEntry
ObjectTemplate.setEntryRadius 0

ObjectTemplate.active MH53SoldierSpawn
ObjectTemplate.setSpawnRotation 0/0/0
ObjectTemplate.setSpawnPositionOffset 0/0/0
ObjectTemplate.setSpawnPreventionDelay 0
ObjectTemplate.setSpawnId 0
ObjectTemplate.setGroup 79
ObjectTemplate.setEnterOnSpawn 0
ObjectTemplate.setAIEnterOnSpawn 0
ObjectTemplate.setSpawnAsParaTroper 0
and add it on the map

for berlin

Code: Select all

Object.absolutePosition 1687.70/65/1823.98
Object.rotation 90/20/0
Object.setOSId 4
Object.setTeam 1
Object.rotation 90/>>>>>20<<<<</0
we must to incline, if not helicotper will crash on the ground...

for mi8 :

Code: Select all

ObjectTemplate.active Mi8

ObjectTemplate.addTemplate Mi8DummyEngine
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate Mi8DummyRearEngine
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate Mi8HoverEngine1
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate Mi8HoverEngine2
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate Mi8HoverEngine3
ObjectTemplate.setPosition 0/0/0

ObjectTemplate.active Mi8DummyEngine
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.setNetworkableInfo Mi8_engine_info
ObjectTemplate.addTemplate lodMi8Propeller
ObjectTemplate.setMinRotation 0/0/500
ObjectTemplate.setMaxRotation 0/0/500
ObjectTemplate.setMaxSpeed 0/0/5
ObjectTemplate.setAcceleration 50/50/100
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 0
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque .1
ObjectTemplate.setDifferential .1
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150

ObjectTemplate.active Mi8DummyRearEngine
ObjectTemplate.setNetworkableInfo Mi8_engine_info
ObjectTemplate.addTemplate lodMi8RearPropeller
ObjectTemplate.setRotation -90/0/0
ObjectTemplate.setMinRotation 0/0/500
ObjectTemplate.setMaxRotation 0/0/500
ObjectTemplate.setMaxSpeed 0/0/1
ObjectTemplate.setAcceleration 0/0/100
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 0
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque .1
ObjectTemplate.setDifferential .1
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150

ObjectTemplate.active Mi8HoverEngine1
ObjectTemplate.setNetworkableInfo Mi8_engine_info
ObjectTemplate.loadSoundScript Sounds/Mi8_Engine.ssc
ObjectTemplate.setMinRotation 5000/5000/5000
ObjectTemplate.setMaxRotation 5000/5000/5000
ObjectTemplate.setMaxSpeed 50/50/9500
ObjectTemplate.setAcceleration 50/50/5000
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque 13
ObjectTemplate.setDifferential 3.2
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150

ObjectTemplate.active Mi8HoverEngine2
ObjectTemplate.setNetworkableInfo Mi8_engine_info
ObjectTemplate.setMinRotation 5000/5000/5000
ObjectTemplate.setMaxRotation 5000/5000/5000
ObjectTemplate.setMaxSpeed 50/50/9500
ObjectTemplate.setAcceleration 50/50/5000
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque 13
ObjectTemplate.setDifferential 3.2
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150

ObjectTemplate.active Mi8HoverEngine3
ObjectTemplate.setNetworkableInfo Mi8_engine_info
ObjectTemplate.setMinRotation 5000/5000/5000
ObjectTemplate.setMaxRotation 5000/5000/5000
ObjectTemplate.setMaxSpeed 50/50/9500
ObjectTemplate.setAcceleration 50/50/5000
ObjectTemplate.setInputToRoll c_PIThrottle
ObjectTemplate.setAutomaticReset 1
ObjectTemplate.setEngineType c_ETRocket
ObjectTemplate.setTorque 13
ObjectTemplate.setDifferential 3.2
ObjectTemplate.setGearUp 0.7
ObjectTemplate.setGearDown 0.3
ObjectTemplate.setNoPropellerEffectAtSpeed 150

ObjectTemplate.Active Mi8SoldierSpawn
ObjectTemplate.SetEnterOnSpawn 0

ObjectTemplate.Active Mi8Entry
ObjectTemplate.setEntryRadius 0

Code: Select all

Object.absolutePosition 1797/75/1958
Object.rotation -180/20/0
Object.setOSId 4
if you want my map : http://www.megaupload.com/?d=2KRRLQ5Q
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: SSM - Ambient helicopter

Post by fo0k »

just seen this! heheh.. very nice..
mrpopupx
Posts: 2
Joined: Wed Aug 04, 2010 10:31 pm

Re: SSM - Ambient helicopter

Post by mrpopupx »

Love the idea, however, using your exact code won't work for me. I've tried tweaking it, but no luck. Using the original code, you can see what happens when I try to make some heli's go from south to north. any suggestions?
Attachments
1.png
1.png (140.19 KiB) Viewed 12156 times
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: SSM - Ambient helicopter

Post by fo0k »

He's not been online for a while so might be worth pinging him a pm to respond :)
mrpopupx
Posts: 2
Joined: Wed Aug 04, 2010 10:31 pm

Re: SSM - Ambient helicopter

Post by mrpopupx »

Well that question is more to anyone who can answer it. I know it was done in DCX paintball. Also,this is totally fine if its a CSM.
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: SSM - Ambient helicopter

Post by Senshi »

The solution of Darkstef is okay, but it only works for the specific helicopter he used. We had this discussed at length on the old ssm.com website, so I searched and copied the relevant part:
Up to now I figure the FH guys made it work like this: The necessary floater code is:

Code:
ObjectTemplate.create FloatingBundle RemoteB17Floater
ObjectTemplate.setHullHeight 500000 (put any insanely large number here ;) )
ObjectTemplate.setFloatMaxLift 4.91
ObjectTemplate.setFloatMinLift 4.91


Attach this floater to the plane twice, spread a bit along the x-axis to increase stability (e.g. 4/0/0 and -4/0/0). This way the object won't hit ever the Hullheight limit, but the floater contradicts gravity as it is placed twice. As the Lift Force would decrease/shut off once the object hits the "ceiling/bottom" of the HullHeight value, this balance would be destroyed. Of course the floater would become active again ASAP, but the object has gained a bit of kinetic momentum downwards, so the floaters effort to push up with a max of the gravitational force would never suffice to bring the plane back to correct level.

Surprisingly, this is simplest physics. (4,91*2 results in 9,82, a value only a VERY slight tid above the international gravitation norm value based on Zurich, 9,81). Apparently, BF42 internally uses the correct calculation basis for gravitations based on this norm, of course without the alterations that would theoretically be required dependant of the theatre the map plays in, as these alterations won't matter much in an arcade combat simulation .

Now you just have to make sure you have disabled all active Wing- and Flaplifts and ObjectTemplate.drag 0 so no friction forces can bring the plane out of track.

For any manoeuvering (slow left turn) you then can mess with the engines all you want. I think I'll upload a very basic demo code when I'm done.

EDIT: Only way to stop planes from exploding when OOB is to set ObjectTemplate.hasArmor 0, but i don't know if that's SSM (doubt it), making the object virtually invincible. Problem is the plane now NEVER is destroyed, thus it won't respawn. You'd need to timeout the object so it kills itself after a certain time...Or increase MaxNbrofObjectsspawned to say how many respawns you want. But I think that would cause severe serve lag if there are many respawns, as the old objects are still not killed...

Well, I made them harder to kill than normal as it looks weird if they get killed: their wreck stays floating along the trajectory path, so if they are shot down in flight their wrecks keep traveling on...don't want that to happen. And it happens rarely that people down 1000HP before the planes leave the area of battle.
In order for the above to work, you need to remove all wings and floaters that are already existing (flaps and wings) by setting their "force" to 0, rendering them ineffective. Then just add a basic invisible rocket engine to 'em so they are propelled forward/upward/wherever you want. Also, disable/remove all engines that exist. This basically just makes the object ignore gravitation physics for sure as well as rotation momentum etc. .
Post Reply