Page 4 of 4

Re: Extra vehicles server side mod tutorial

Posted: Sun Nov 30, 2014 8:07 pm
by al12rs
mouz wrote:If all conditions allow multiple vehicles on a spawn point, RespawnRange determines how far, in meters, can the first vehicle be away from the spawn point, in order to spawn a second one. SpawnAreaRadius is a circle that is, in this case, 2.5 meters in half-diameter, it specifies that in order to spawn a vehicle, no other vehicles can be in that radius. It basically says that it needs some space to spawn, so that it wouldn't spawn into another vehicle and cause damage when spawning, or some other bugs.

That really negates my hope of multiple spawn points. :cry:
I might try the client sided route since i'm playing with friends, but as you said it's quite complicated.
Thank you very much for the reply. :)

Re: Extra vehicles server side mod tutorial

Posted: Mon Dec 01, 2014 7:51 pm
by al12rs
Actually, after not giving up, i looked for a way to add a spawn for a vehicle already existing in the map whithout having to modify the client side. From what i understand you can't add a new spawn instance since it would desynk with the client. So i thought: "why don't i use an already existing instance?"
I took the "VehicleSpawnEntityData" of a tank in Heavy Metal and changed the vehicle reference from:

Code: Select all

<field ref="objects/vehicles/land/m1a2/m1a2/d892f1c3-91e7-4793-8bb4-39b686d37e1d" name="Vehicle" />

to:

Code: Select all

<field ref="objects/vehicles/land/cav/cav/207ecf50-42d9-4ea0-8c8c-baa0c62e451a" name="Vehicle" />

the one of a jeep (they are already present in Heavy Metal), and also made shure to change all settings so they would be compatible with the jeep (MaxVehicles, SpawnDelay, ApplyDamageToAbandondedVehicles, EnterRestriction etc...).
And to my surprise it worked!
This will shurely need further testing but this should mean a lot of new possibilities.
Keep in mind that mounted weapons (like AA, SMGs, TOWs etc...) count as vehicles and since some of them are rarely used it would be simple to substitute them into a helicopter or a quadbike and then change their coordinates to wherever you want.
Also now you could have multiple UAVs, something we weren't able to do before.
Please tell me if this works for you guys and if you find out problems or limitations of this method.
Also if you have in mind some other uses of it please share :) .
Happy modding :D !

Re: Extra vehicles server side mod tutorial

Posted: Mon Dec 01, 2014 8:33 pm
by mouz
Well I be damned, that works. Although earlier when I tested it caused my game to close. I learned something new.

al12rs do you know how to obtain player position? It's very useful for when creating vehicle spawns or moving spawn points, if you don't I could write you a tutorial here if there isn't already one

Re: Extra vehicles server side mod tutorial

Posted: Tue Dec 02, 2014 5:57 am
by Bruce Lee
mouz wrote:...do you know how to obtain player position? It's very useful for when creating vehicle spawns or moving spawn points, if you don't I could write you a tutorial here if there isn't already one.

Go for it, but don't limit yourself to that alone please. I am sure that you have a lot more things you could include. 8-)

Maybe you should start a new "How to mod BC2" thread though. What little modding info there is seems a little scattered imho.
I think people would be more likely to try modding BC2 if they could find everything they need in one convenient place.

Re: Extra vehicles server side mod tutorial

Posted: Tue Dec 02, 2014 6:20 am
by al12rs
mouz wrote: al12rs do you know how to obtain player position? It's very useful for when creating vehicle spawns or moving spawn points, if you don't I could write you a tutorial here if there isn't already one
I don't and it would be very useful since the only way i knew until now was to use an already existing position of an object an vary it slightly.
mouz wrote:Well I be damned, that works. Although earlier when I tested it caused my game to close. I learned something new.

The first time i tried it didn't work for me too but i think i messed up something and when i re-did it from scratch it worked.
Check if the settings are compatile with the new vehicle and if not change them. Also i would advise to change a vehicle of the area you want it in( US base, A flag etc...) since there is an index for each of them of all the spawns they contain( search the id of the spawn and you will find it) and im not shure if you can modify it without desynk.
Update: I have found out that you can't substitute a "Team1" vehilce with a "Team2"; probably because of that index (mentioned above) that also keeps track of the vehicles' Team. I will look for a work-around. Also i haven't been able to change any vehicle to AH64 (Apache)(i guess this counts also for the mi28) . For now i tried and got it to work for the jeeps, tanks and transport helis on heavy metal.
I don't have much time so my testing is limited.
Can you guys try and see how it works in other maps and vehicles (also if you can check the the above mentioned)?

Re: Extra vehicles server side mod tutorial

Posted: Mon Aug 17, 2015 1:46 pm
by al12rs
So after such a long time i'm finally able to return to bc2 modding. Now, I really want to keep it server sided since client modification renders the server very unaccessable. What i really would like to find out is what the cause of the client and server desync is and how it can be avoided. For exaple, we were able to determine that adding a vehicle caused desync. But if you were to substitute one with an other already on the map it would work in some cases and in some it wouldn't. This really bugs me. What is the cause of the desync? Some sort of check? In that case why are some things allowed?
I would like to ask you if any of you have some information on how the check happens and what is allowed by it.