Battlefield Modding

The Official Modding Resource for Battlefield 1942 and the Battlefield Series
It is currently Mon Oct 19, 2009 5:30 pm


Getting Started
Getting Started
Prepping Your Files
  Testing Methods
Auto-Start Map
True Testing Enviroment
General How-To's
Stop Base Camping
Removing Out Of Bounds
Stop Base Camping 2
Disabling Parachutes
Add Repair Points
Add Spawn Points
Paradrops
Main Base Swapping
Modifying the Point System
Conquest Ticket System
Making CTF Versions of Maps
Vehicle How-To's
Replace/Add Vehicles
Lock Vehicles
Partially Disabling Vehicles
Totally Disabling Vehicles
Making a Carbomb
Adding Nitrous
Making Amphibious
Performance Tweaking
Adding Healing Supply
Adding/Changing/Removing Carrier Vehicles
Weapon How-To's
Spawn Weapon Kits
Change the Weapon Kits of Soldiers
Modifying Weapon Attributes
Disabling Weapons
Modifying the Damage System
Disabling Overheating
 
 
 
Fix Wall Hacks
How to Fix Wall/Floor Hacks
Basrah's Edge
Lost Village
Stalingrad
Al Khafji Docks
El Alamein
Other Fixes
Leaning F16 Fix
Glass Humvee
Oil Fields Exploding A-10
Operation Bragg Fixes
 
 
References
Object List
Weapon Kits List
Global Object Spawners
Global Soldier Spawns
Projectile Material Numbers
 

How to Make Vehicles Immobile and Unusable

So you can add a vehicles and change vehicles. What if you want to add a HIP (Mi8) as a spawn point, but you don't want anyone to be able to fly it?

Well, the Battlefield 1942 scripting engine provides a way to reopen the definition for an object by using "ObjectTemplate.Active name" where name is the name of the object.

First, one important thing, DO NOT EDIT THE OBJECTS.RFA FILE!!! We just want to look at it.

Now lets look at the Mi8's object definition. Open up the Objects.rfa file for desertcombat (in the Archives folder). Then open up OBJECTS\vehicles\air\Mi-8\objects.con

The first line:

ObjectTemplate.create PlayerControlObject Mi8

Starts the definition for the "Mi8". Notice there are attributes for mass, drag, hitpoints, etc. I've played around with changing these with varying success. Read on to see how to do this.

We're not going to change anything for the Mi8 object because all we want to do is make it so you can't enter the Mi8, and we also want to make it so that when you spawn in the Mi8, your not sitting in it, you'll spawn outside it. There are other "sub objects" you can call them further in the file.

Go down to a line that looks like this:

rem *** Mi8Entry ***
ObjectTemplate.create EntryPoint Mi8Entry
ObjectTemplate.setEntryRadius 4

This is the definition for the Mi8Entry object. Notice the radius is 4, which means anyone within a distance of 4 can press 'E', and enter the Mi8. We are going to change this to 0, BUT NOT HERE. What you need to do is remember these two lines, because we will use them later.

Now go down to the lines that look like this:

rem *** Mi8SoldierSpawn ***
ObjectTemplate.create SpawnPoint Mi8SoldierSpawn
ObjectTemplate.setSpawnRotation 0/0/0
ObjectTemplate.setSpawnPositionOffset 0/0/0
ObjectTemplate.setSpawnPreventionDelay 0
ObjectTemplate.setSpawnId 0
ObjectTemplate.setGroup 65
ObjectTemplate.setEnterOnSpawn 1
ObjectTemplate.setAIEnterOnSpawn 1
ObjectTemplate.setSpawnAsParaTroper 0

This is the definition of the spawn point inside the Mi8. The value we are going to want to change is

ObjectTemplate.setEnterOnSpawn 1
Once again, DO NOT CHANGE THESE HERE. Remember the Mi8SoilderSpawn, and the ObjectTemplate.setEnterOnSpawn.

Now, close the Objects.rfa. Lets add the Mi8 to El Alamein. Use the procedures described in "Adding a Vehicle" to change one of the vehicles to the Mi8. Howevewr, before you save your changes in the ObjectSpawnTemplates.con, go to the end of that file and add the following lines:

ObjectTemplate.Active Mi8SoldierSpawn
ObjectTemplate.SetEnterOnSpawn 0

ObjectTemplate.Active Mi8Entry
ObjectTemplate.setEntryRadius 0

Notice we are reopening the objects defined in objects.rfa and changing some configs on them.

If you wanted to do this to the MH53, you'll notice there are two entry objects, a PilotEntry and a PassEntry. Don't forget to set them both.

Here are my configs for the MH53:

ObjectTemplate.Active MH53SoldierSpawn
ObjectTemplate.SetEnterOnSpawn 0

ObjectTemplate.Active MH53PassEntry
ObjectTemplate.setEntryRadius 0

ObjectTemplate.Active MH53PilotEntry
ObjectTemplate.setEntryRadius 0

ObjectsTemplate.Active is a powerful tool to really change some serverside settings. Be carefull though, I've changed som things on the Mi8 (like i set ObjectTemplate.HasResponsePhysics to 0, and the map would crash after loading). But then others did some interresting things (I changed ObjectTemplate.HasMobilePhysics to 0, and the HIP would float straight into the air *lol*)

cron

©2009
No materials may be duplicated under any circumstances.