### May 2017

MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
293031

Calendar

# What does parameters of the object in SF?

lockie
TSF Member

Posts : 3482
Join date : 2014-07-24
Age : 50
Location : Ukraine, Kyiv
This is a very interesting topic! Coz in spite the request: we need more new tanks - this request does nothing. And u know why. To make new battle with new tanks we need new polygon, i.e. for the Africa mission or Europe campaign. It does that new polygon BADLY needs new objects (houses, fences, courtyard ones, etc ...)!
Or for each new mission we've to use what we already have. And to provide more atmosphere of the mission, each time to start the mission we must close our left/right eye and imagine that we take place in the Western Europe or in Africa (Khm-m, du they know it's an acid?)
Suppose, there are enough questions, let's start what the parameters of the SF objects does
First of all I'd like to pay attention to the "flag". In our case term "flag" does feature of the object.
Usually, there are four flags to be used:
...\data\k42\loc_rus\levels\levels\obj_cfg\objects\builds:
//0x01 - take the shadow: suppose it does to operate with shadow calculating
//0x02 - take the track: suppose it does to have tracks print on the object or go along the bridge without damaging
//0x04 - it's easy one - does object is transparency for AI
//0x08 - means object has no collisions for the infantry
//0х20 - for beauty, means does nothing

I'll continue on with flags, but let's see how to add one flag to other.
This is 16hex calculation. Means we may calculate to "9", then start ridiculous for us human things, but not for the PC
I.e 10 means A, 11 means B
12 - C
13 - D
14 - E
15 - F
It's enough, give PC calculator a job

So, we want to make barrage, i.e. "sand bag". It must has the next features:
- no collisions for the infantry  (flag 0x08)
- take the track (flag 0x02)
It does: 08+02=10 in hex 0xa
And infantry will go through our "sand bag" without problem. BUT it won't be fun! let's make each soldier jump over the fence/barrage.
In this case our flag is equivalent to 0x0e. It does "14", means: 8+4+2=14.
There are some common flags:

0x10 - house
0x28 - bush_sp1 flora
0x2c - bushn1 flora
0x1b - part of bridge
0x0a - concrete block
0x0b - bridge
0x0c - wire barrage

Let's have a look on the building "tent".
...data\k42\loc_rus\levels\LEVELS\obj_cfg\objects\builds.engcfg

//object type for map
type = %OT_BUILDING%;

//model name, located here: ...data\k42\loc_rus\go\builds\
mesh = tent01;

//object name, located here: ...data\k42\loc_rus\text\STA_units.text
name = txt_ob_tent;

//LOD's quantity, could be "0" means there is only one LOD, i.e. for grass or simple object like stick
mesh_lods = 3;

//weight, "-" means how long object will fly
wei = -10;

//material, unfortunately there was no cotton, so I used wood
material = wood;

//solidity (impulse). How easy object could be destroyed under hit of shell or tank pushing. Usually for the houses the values are "30 000".
imp = 5000;//tank pushing
imp_dem = 4500;//shell hit

//fire probability, for the house the value is 0.15
flame_p = 0.10;

//collision type
flags = 0x10;

//shared net, I've no idea what it does. Leave as it is.
shared = true;

//destruction name. this variables consis of many parts, which which will appear after building will be
//destroyed. Located here:
//data\k42\loc_rus\levels\LEVELS\common\common_res.engcfg
//Entry:
Code:
tent_d,obj_cfg\objs.engcfg,01_d_fund_pl,dust_br,1,5,0,0,0,0,0,false;tent_d,obj_cfg\objs.engcfg,02_d_rama_pl,dust_br,1,0.145,2.227,1.066,15,,,true;`
destr_desc = tent_d;

To be continued.

Current date/time is Sun May 28, 2017 4:02 am