Welcome, Guest. Please Login or Register.
07/29/10 at 19:27:16
News:

Pages: 1
Send Topic Print
Server Modding Info (Read 984 times)
Superfuzz
Global Moderator
Modder
DCON Staff
*****


New User!

Posts: 1
Server Modding Info
04/04/07 at 17:52:42
 
Ok first off all these mods have been done on DCon El Alamein 32 CTF. They have been tested on a dedicated server with over 20 people on it and they all work. Also this is a tutorial on how to do things. The values in this tutorial are not meant to be directly used (though you could, but I don't guarantee that will be anything worthy of being played with). So come up with your own values. (Most of you know I don't had out code for free. I won't make your mod for you, but I will explain to you how I did something).
 
I put the code in the GPO.con (GamePlayObjects.con), you might be able to put it elsewhere (say the init.con or some other file that is always executed).
 
First off is spawner templates. What I mean by a spawner template is this
 
Code:
rem [ObjectSpawnerTemplate: Coalition_Main__50cal]
ObjectTemplate.create ObjectSpawner Coalition_Main__50cal
ObjectTemplate.activeSafe ObjectSpawner Coalition_Main__50cal
ObjectTemplate.modifiedByUser "Superfuzz"
ObjectTemplate.isNotSaveable 1
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.setObjectTemplate 1 US_Sniper_heavy
ObjectTemplate.setObjectTemplate 2 US_Sniper_heavy 


 
A maps GPO.con will contain these. However, there a quite a few limitations in BF2 that were not present in BF42.
 
First off you cannot change the setObjectTemplate at all, even if the object already exists in the map.
 
Now you can change the following  
 
Code:
ObjectTemplate.MinSpawnDelay 30
ObjectTemplate.MaxSpawnDelay 60
ObjectTemplate.MaxNrOfObjectSpawned 2 


 
You can both add those lines to spawner templates without them and change existing values of spawner template that already have them. These are the only ones I have played with so far, but there might be a few others (I haven't thought of a need for isNoSavable or HasMobilePhysics so I didn't bother changing them).
 
Also from what I have tried, setObjectTemplate 3 object_here doesn't work, so none of the spawner template having 3 or more items spawned like in 42.
 
On to spawners. A spawner is this
 
Code:
   rem [ObjectSpawner: Coalition_Main__50cal]
   Object.create Coalition_Main__50cal
   Object.absolutePosition 664.578/75.3208/-219.605
   Object.rotation -90.000/0.000/0.000
   Object.setControlPointId 2
   Object.layer 1 


 
Now just like in 42 you can change the setControlPointID, rotation, and absolutePosition. ObjectTemplate.team did not seem to have any effect again relating the multi-team issue above.
 
Also like in 42 you can make copies of them:
 
Code:
   rem [ObjectSpawner: Coalition_Main__50cal]
   rem US Main #2
   Object.create Coalition_Main__50cal
   Object.absolutePosition 657.311/75.2996/-253.066
   Object.rotation 180.000/0.000/0.000
   Object.setControlPointId 2
   Object.layer 1

   rem [ObjectSpawner: Coalition_Main__50cal]
   rem US Main #3
   Object.create Coalition_Main__50cal
   Object.absolutePosition 655.342/75.2996/-255.519
   Object.rotation 180.000/0.000/0.000
   Object.setControlPointId 2
   Object.layer 1 


 
Notice how they are all copies of Coalition_Main__50cal. They use the same spawner template, but are different instances of the spawner. This is 42 style mapping. In BF2, there is trend to use only one spawner per template in BF2 maps, but it is not necessary. This allows for easy object multiplication, provided that the object is already in the map.
 
For the most part if an object is not in a map, it can't be added, however there are a few exceptions. The following is the Supply object code I used to make healing reloading DPV.
 
Code:
rem Soldier Healing
ObjectTemplate.activeSafe SupplyObject rep_pad1_n
ObjectTemplate.workOnSoldiers 1
ObjectTemplate.workOnVehicles 0
ObjectTemplate.healSpeed 4
ObjectTemplate.radius 2

rem Vehicle Healing
ObjectTemplate.activeSafe SupplyObject rep_pad2_n
ObjectTemplate.healSpeed 3
ObjectTemplate.radius 4

rem Soldier Ammo
ObjectTemplate.activeSafe SupplyObject rep_pad3_n
ObjectTemplate.workOnSoldiers 1
ObjectTemplate.workOnVehicles 0
ObjectTemplate.healSpeed 0
ObjectTemplate.refillAmmoSpeed 4
ObjectTemplate.radius 2

rem Vehcile Ammo
ObjectTemplate.activeSafe SupplyObject rep_pad4_n
ObjectTemplate.healSpeed 0
ObjectTemplate.refillAmmoSpeed 8
ObjectTemplate.radius 6 


 
As it turns out, in El Alamein one one repair pad type is used, leaving the other the cannibalized. Those 4 supply objects are off the repair_pad_neutral. All the items you see there are customized from the original. As you can see just about anything you would want to do to a supply object can be done.
 
Now for the NOS engine. The old method of simply addTemplating a second engine to the vehicle has some problems in BF2 and in most cases either simply wont work or will cause CTD's and/or rubber-banding. However, since BF2 introduced sprint and since Dice was so kind to use the same concept for the afterburners of the jets, we still have a way to make a NOS engine and not only that, a NOS engine with fuel (if desired).
 
Code:
rem Healing Reloading NOS DPV
ObjectTemplate.activeSafe PlayerControlObject dcon_dpv
ObjectTemplate.sprintRecoverTime 5
ObjectTemplate.sprintDissipationTime 10
ObjectTemplate.sprintLimit 0.2
ObjectTemplate.sprintFactor 2
ObjectTemplate.addTemplate rep_pad1_n
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate rep_pad2_n
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate rep_pad3_n
ObjectTemplate.setPosition 0/0/0
ObjectTemplate.addTemplate rep_pad4_n
ObjectTemplate.setPosition 0/0/0 


 
The first 2 lines are fuel related. SprintRecoverTime is the time it takes to “refuel”. This is the recharge line of the sprint and afterburners. SprintDissipationTime is the max length of the sprint use, ie the size of the fuel tank. Both are measured in seconds, so  recover time of 5 and dissipation time of 10 means you can use the nos engine for 10 seconds before running out of fuel and it will take 5 seconds to refuel.
 
I'm not entirely sure of what sprintLimit is. I think it's the minimum amount of sprint needed before the engine will engage. So if you have less than 0.2 sprint left, you can't sprint. However, as I said, I'm quite sure what it is. I do know its on all sprintables.
 
SprintFactor is how much the sprint will increase by. I think it's its own factor, ie not a multiplier of the base vehicle speed. Meaning, sprintFactor 2 is not 2 time the speed of the vehicle, its just 2 times faster than sprintFactor 1. I don't know the units of this attribute, but it does accept floats (0.376, 1.345, etc).
 
Now the addTemplate and setPosition lines are adding the repair and supply objects mentioned above.
 
For the most part the general restriction of 42 still apply. As always anything graphical will not show up (although some of the sprint bars show up, not sure why though). I didn't play with the control points, you probably can move them around and change of their attributes like spanwers, but I don't know the effects it will have. Again I didn't adjust the soldier spawns, but I assume similar rules apply to them as the rules that apply to the object spawners.
 
All content is subject to change if something is expanded upon or explained better. These mods may or may not work in BF2 or other mods/levels.
Back to top
 
 


I refuse to buy more garbage from EA. 2142 has crossed the line. If you are with me, copy this into your sig too.
View Profile WWW   IP Logged
MasterX=DCON=
System Administrator
DCON Staff
Energy Revolutions Research Dept.
*****


Desert Conflict
Coding Dept

Posts: 570
Gender: male
Re: Server Modding Info
Reply #1 - 04/05/07 at 01:43:44
 
your post is not entirely accurate!
 
[quote=Superfuzz]you cannot change the setObjectTemplate at all, even if the object already exists in the map. [/quote]
I been doing it for some time now......not using your execution method tho....using an execution method that me and kiff are currently making a python script to automate because it is kinda a back door.....
 
as it seems now, the execution method matters more than i thought, your method of adding it to the gpos will be broken if we do md5's in dcon, but this method works with/without md5's, and PB and content check couldnt care less about it.......
 
i will post the script once its fully tested and all the kinks are rubbed out!
Back to top
 
 

Ma§†er}{
BKC Squad Leader - Retired
Owner Graebtech Gaming Network
Email View Profile WWW MasterX=DCON= masterxbkc 265028259 brenttg2000   IP Logged
Pages: 1
Send Topic Print