Vanishing object

Ask questions, discuss ideas, get answers
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Vanishing object

Post by Senshi »

If you want to make clientside changes, things are way easier and can be approached differently than serverside moddings, that is why a clear tell what kind of mod it is is always helpful. A third, in-between type is "mapside modding" which defines clientside moddings that should only apply to a certain map (meaning you only want to share/spread a single map.rfa and not a whole mod).

I assume the latter is the case, right? If so, there's no need to work exclusively with the addTemplate/removeTemplate trick. You can simply add whole objects to your map :) .

How? Easy: Just take the objects.con of the vehicle you want to modify, and put it in your extracted map folder: MAP\objects\objectname [Actually it doesn't matter WHERE in the map you put it, but having things cleaned up is always good].
You only need to copy the parts of the object that you actually modify, so if no changes to the geometries.con or network.con are made, leave them be.
After that, modify your map's init.con and add the following at the very bottom:

run objects\objectname\objects.con [This tells the game that on loading the map, it also should load this specific file, applying any changes it finds in there to the vehicles on this map and this map only]

That's all. And this allows you to make all the changes you want to the objects.con .
You even can have mapside different geometry (standardmesh) and textures for vehicles, just put them in map\standardmesh and map\texture (NOT textures! There only are terrain textures here!), no need for any "run" commands for that.
You also can just check out Battle of Britain or Philippines, they are DICE maps that have mapside moddings (Ju88, radar tower, PT Boat).
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Vanishing object

Post by Psycho »

Ok I understand Senshi. But doesent that require changin certain path for sound an so in the con?
If I understand correctly this methode can be used for all the con's in the object folder?


And by the way, my map will be able to run on a dedicated server?
I want to live in a created universe. Virtual reality, here I come.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

Psycho wrote: doesent that require changin certain path for sound an so in the con?
If I understand correctly this methode can be used for all the con's in the object folder?
it works fine if the vehicle already is in the mod in the objects.con (bf42 is the "vannila" mod)

Psycho wrote:And by the way, my map will be able to run on a dedicated server?
that should work just fine.
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Vanishing object

Post by Psycho »

Seems that when adding things in ObjectSpawnTemplates.con increase the maps load time a lot. And some times some code that supposed to work doesent.

Example:

Code: Select all

ObjectTemplate.Active TigerGunBarrel
ObjectTemplate.velocity 400

ObjectTemplate.Active M10Cannon
ObjectTemplate.velocity 400

ObjectTemplate.Active Chi-ha_GunBarrel
ObjectTemplate.velocity 400

ObjectTemplate.Active T34GunBarrel
ObjectTemplate.velocity 400

Of some reason its only the Tiger that gets the change in velocity. So I will do it the other way.

Edit: had to put the airplane changes in object folder and the tanks in the ObjectSpawnTemplates.con then i got the velocity changes to all the tanks. When I had both planes and tanks changed in just one of the ways, only the tiger and the planes got the change. weird, but now it works.
Last edited by Psycho on Mon Sep 12, 2011 9:49 pm, edited 1 time in total.
I want to live in a created universe. Virtual reality, here I come.
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Vanishing object

Post by Senshi »

If you really do a lot of changes mapside, going for the objects.con solution usually is far quicker. Though the activetemplate shouldn't increase loading time THAT much. It does increase, as every "ActiveTemplate" forces BF to reopen an already loaded object and apply all subsequent changes to it and reload it with the new values.
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Vanishing object

Post by Psycho »

Senshi wrote:If you really do a lot of changes mapside, going for the objects.con solution usually is far quicker. Though the activetemplate shouldn't increase loading time THAT much. It does increase, as every "ActiveTemplate" forces BF to reopen an already loaded object and apply all subsequent changes to it and reload it with the new values.
I agree, but for example to just remove bombs, its easier to do that in the ObjectSpawnTemplates.con. Unfortunally I have a lot of changes to do, so your methode is of course better.

Ok going to next problem.
Seems I got a real bug now. I have a spitfire parked in a hangar. and some times when starting the map it missing tailwheel. That make it kindof hard to stear on ground hehe. I have checked the code and nothing att all is missing. It started when I begun to add those last changes to the planes.
Even before I even touched the spits stuff.

Edit: Found some double entrys in the con files. removed them and then the spitfire was ok again.

And a question: How do I increase the AA range? I have checked the weapons.con, and it differs a little from other weapons. So I don't really understand how to change the range. I have googled and searched around for a more exact description of the AA's coding, but can't quite find what I'm after.
I want to live in a created universe. Virtual reality, here I come.
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Vanishing object

Post by Senshi »

AA has time-fused projectiles, that defines the range.

Code: Select all

ObjectTemplate.create Projectile AA_Allies_Projectile
ObjectTemplate.geometry tracklight_M1
ObjectTemplate.timeToLive CRD_UNIFORM/0.8/1.4/0
The "timetolive" is the important part here. Short explanation of the parameters:
CRD_UNIFORM means a "Continuous Random Distribution", meaning that every projectile randomly picks a TimetoLive between the first two parameters: 0.8 and 1.4. The last parameter is ignored for UNIFORM. Check the MDT for more detail on the CRDs.

In order to increase range you have to increase the TTL so the projectiles have more time to fly. However, if using vanilla effects, an increased range will lead to the probably undesired side effect that the air flak explosion effect is culled out and not visible to the ground gunner. To increase the cull radius of the flak effect, you also have to add ObjectTemplate.cullRadiusScale 5 to every flak effect SpriteParticle (Check e_flakbig in Objects/effects). The Particles involved are:
ObjectTemplate.create SpriteParticle Fx_flak_Flash
ObjectTemplate.create SpriteParticle Fx_flak_Big
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Vanishing object

Post by Swaffy »

If I remember, if the third parameter is a "1," there is a chance that the outcome will be negative. Look at it as some kind of randomizer.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Vanishing object

Post by Psycho »

Thanks Senshi, that was simple enough.

Code: Select all

ObjectTemplate.Active AA_Allies_Projectile
ObjectTemplate.timeToLive CRD_UNIFORM/0.8/2.8/0
ObjectTemplate.Active Flak38_Projectile
ObjectTemplate.timeToLive CRD_UNIFORM/0.8/2.8/0
ObjectTemplate.Active e_FlakBig
ObjectTemplate.cullRadiusScale 5
ObjectTemplate.Active Fx_flak_Flash
ObjectTemplate.cullRadiusScale 5
I put it in ObjectSpawnTemplates.con, it was easiest.
I want to live in a created universe. Virtual reality, here I come.
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Vanishing object

Post by Senshi »

The third parameter is ignored for CRD_NONE and CRD_UNIFORM. In CRD_EXPONENTIAL and CRD_NOMRAL it does describe the symetry and thus can negate the value (-40 instead of 40 or vice versa) if set to 1. But all that is described in detail on the MDT.

Glad that the flak thing worked for you :), Pyscho.
Post Reply