(map)features
Moderator: Moderators
(map)features
I want to make some features but I know nothing about them.
I tried just using a unitdef with isfeature=true but then the unit just dies/disappears on being spawned. (i was expecting it to be turned into a feature that uses the 3dmodel of the unit)
So how do they work?
Is there a documentation on all the possible tags? (or list at least)
Can the engines default trees be used for new featues? (like bigger trees?)
Can features have a deathexplosion?
(search says "yes, with featureplacer" <- does that just spawn a CEG on FeatureDestroyed callin?)
Trees fall over when knocked down. Is that possible with all features? (i have not seen it)
Appearently features have a teamID. (http://springrts.com/wiki/Lua_SyncedCtr ... e_Handling)
What is that used for? (like LOS or whatever else)
What does Spring.SetUnitToFeature ( boolean tofeature ) do?
(from name i was thinking it turns a unit into a feature but it does not take a unitID as parameter. seems to do nothing as far i could tell)
When a feature burns, how is defined what effect is used and where is it spawned? Can burntime+damage be controlled?
I tried just using a unitdef with isfeature=true but then the unit just dies/disappears on being spawned. (i was expecting it to be turned into a feature that uses the 3dmodel of the unit)
So how do they work?
Is there a documentation on all the possible tags? (or list at least)
Can the engines default trees be used for new featues? (like bigger trees?)
Can features have a deathexplosion?
(search says "yes, with featureplacer" <- does that just spawn a CEG on FeatureDestroyed callin?)
Trees fall over when knocked down. Is that possible with all features? (i have not seen it)
Appearently features have a teamID. (http://springrts.com/wiki/Lua_SyncedCtr ... e_Handling)
What is that used for? (like LOS or whatever else)
What does Spring.SetUnitToFeature ( boolean tofeature ) do?
(from name i was thinking it turns a unit into a feature but it does not take a unitID as parameter. seems to do nothing as far i could tell)
When a feature burns, how is defined what effect is used and where is it spawned? Can burntime+damage be controlled?
Re: (map)features
Nothing. Don't use it, it's likely to get removed in 0.83knorke wrote:What does Spring.SetUnitToFeature ( boolean tofeature ) do?
Re: (map)features
ok.
i saw it used
http://www.google.com/codesearch/p?hl=e ... y/main.lua here (line 358 & 1034) so thought maybe it does something.
Being able to transform units into features (with pieces remaining at current position) would be pretty nice for wrecks though.
i saw it used
http://www.google.com/codesearch/p?hl=e ... y/main.lua here (line 358 & 1034) so thought maybe it does something.
Being able to transform units into features (with pieces remaining at current position) would be pretty nice for wrecks though.
Re: (map)features
SetUnitToFeature is just an ugly global switch that can be used to block units turning into features when they finish being built (like *A DT's do, which have the isFeature tag).
Re: (map)features
Feature s3o center pos defines burn center, radius defines burn size.
Afaik features have teamID so you can leave teamcolor on wrecks.
Features being knocked over is currently only for engine trees, but we could work together to try and make jK's awesome shader system work with features - then it could be added easily.
Default engine trees cant be changed, as their display lists and lod levels are made on engine load.
Afaik features have teamID so you can leave teamcolor on wrecks.
Features being knocked over is currently only for engine trees, but we could work together to try and make jK's awesome shader system work with features - then it could be added easily.
Default engine trees cant be changed, as their display lists and lod levels are made on engine load.
Re: (map)features
Steal one of my features use it as a base.
Features are just objects on a map they have no scripts or behavior beyond dead/alive
Not that I know of I cannot offer to help docu because I am super busy right now.
The engine trees are hard coded. I once looked at extending them that all died with the community going aspie about my first patch
Yes they can with lua but anything with explosions in fp is a unit
Only engine trees
Features use teamid for team color on corpses
No idea, never used it
Only engine trees catch fire, if you lua it you can control burntime and damage
Please do a numbered lis in the future it makes phone based replies easier
Features are just objects on a map they have no scripts or behavior beyond dead/alive
Not that I know of I cannot offer to help docu because I am super busy right now.
The engine trees are hard coded. I once looked at extending them that all died with the community going aspie about my first patch
Yes they can with lua but anything with explosions in fp is a unit
Only engine trees
Features use teamid for team color on corpses
No idea, never used it
Only engine trees catch fire, if you lua it you can control burntime and damage
Please do a numbered lis in the future it makes phone based replies easier
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: (map)features
Not true, look at the evorts riverdale remake. Those trees catch fire.smoth wrote:Only engine trees catch fire, if you lua it you can control burntime and damage
Edit: I guess this question belongs here...
Is it even remotely possible to redirect the default "Tree on fire" effect to a ceg?
- CarRepairer
- Cursed Zero-K Developer
- Posts: 3359
- Joined: 07 Nov 2007, 21:48
Re: (map)features
No, all it does is make the unit die instantly. Give the unit a corpse with an object field that's the s3o you want (like objectname in the unitdef), you might need some other tags in there for it to work, not sure.knorke wrote:I tried just using a unitdef with isfeature=true but then the unit just dies/disappears on being spawned. (i was expecting it to be turned into a feature that uses the 3dmodel of the unit)
Re: (map)features
Code: Select all
struct FeatureDef
{
CR_DECLARE_STRUCT(FeatureDef);
FeatureDef()
: collisionVolume(NULL)
, id(-1)
, metal(0), energy(0), maxHealth(0), reclaimTime(0), mass(0),
upright(false), drawType(0), model(NULL),
resurrectable(false), smokeTime(0), destructable(false), reclaimable(true), autoreclaim(true), blocking(false),
burnable(false), floating(false), noSelect(false), geoThermal(false),
xsize(0), zsize(0) {}
S3DModel* LoadModel() const;
CollisionVolume* collisionVolume;
std::string myName;
std::string description;
std::string filename;
int id;
float metal;
float energy;
float maxHealth;
float reclaimTime;
/// used to see if the object can be overrun
float mass;
bool upright;
int drawType;
S3DModel* model;
std::string modelname;
/// -1 := only if it is the 1st wreckage of the unitdef (default), 0 := no it isn't, 1 := yes it is
int resurrectable;
int smokeTime;
bool destructable;
bool reclaimable;
bool autoreclaim;
bool blocking;
bool burnable;
bool floating;
bool noSelect;
bool geoThermal;
/// name of feature that this turn into when killed (not reclaimed)
std::string deathFeature;
/// each size is 8 units
int xsize;
/// each size is 8 units
int zsize;
std::map<std::string, std::string> customParams;
};
Re: (map)features
Personally I prefer https://github.com/spring/spring/blob/m ... andler.cpp as a resource
Re: (map)features
The teamID of feature is also used to know if they should be seen through fog of war, I think.
Feature are not units with isFeature. Feature use their distinct FeatureDef, stored in /Features/corpses/*.tdf or /Features/All Worlds/*.tdf. Also one feature TDF can contains the definition of more than one feature.
isFeature is for dragon teeth, or any other player-built feature. It makes a unit instantly die and turn into its 'corpse' when construction completed. So, when you are building a core dragon teeth, it is the 'live' unit CORDRAG from /Units/CORDRAG.FBI, and when done it becomes the 'dead' feature DragonsTeeth_core from /Features/All Worlds/DragonsTeeth.tdf.
The FeatureDef are kinda like UnitDef, but not with the same tags.
The UnitDef field 'corpse' can be used to point to a feature that the unit will turn into when killed.
The FeatureDef field 'featuredead' can be used to point to another feature that the feature will turn into when killed.
Also there's a field to make the feature turn into something else when reclaimed, but I forgot is this one is still supported by Spring.
Feature are not units with isFeature. Feature use their distinct FeatureDef, stored in /Features/corpses/*.tdf or /Features/All Worlds/*.tdf. Also one feature TDF can contains the definition of more than one feature.
isFeature is for dragon teeth, or any other player-built feature. It makes a unit instantly die and turn into its 'corpse' when construction completed. So, when you are building a core dragon teeth, it is the 'live' unit CORDRAG from /Units/CORDRAG.FBI, and when done it becomes the 'dead' feature DragonsTeeth_core from /Features/All Worlds/DragonsTeeth.tdf.
The FeatureDef are kinda like UnitDef, but not with the same tags.
The UnitDef field 'corpse' can be used to point to a feature that the unit will turn into when killed.
The FeatureDef field 'featuredead' can be used to point to another feature that the feature will turn into when killed.
Also there's a field to make the feature turn into something else when reclaimed, but I forgot is this one is still supported by Spring.
Re: (map)features
thanks, very helpfull answers.
http://www.google.com/codesearch/p?hl=e ... cd=1&ct=rc
but I did not see those in the source flozi posted so maybe removed/never existed.
I think ill quickly forgett about that "corpses"/"all worlds" folder and only use the corpse= tag, seems better.
(tried maxdamage=1 too, just to be sure)
engine source says:
adding the feature to armordefs does not change it.
http://springrts.com/phpbb/viewtopic.ph ... start=7617
(on its death, feature is replaced with a unit that plays a "fall over" animation)
Don't know how the shader system works so cant comment on that but for now its good enough for me :)
Btw /give featurename works, though featurename is not autocompleted on tab like for units. (thanks forb)
seems it was featurereclaimate or maybeseqnamereclamatea field to make the feature turn into something else when reclaimed
http://www.google.com/codesearch/p?hl=e ... cd=1&ct=rc
but I did not see those in the source flozi posted so maybe removed/never existed.
I think ill quickly forgett about that "corpses"/"all worlds" folder and only use the corpse= tag, seems better.
Yes, just noticed there is even an option in modrules.lua that uses it:The teamID of feature is also used to know if they should be seen through fog of war, I think.
Last thing that makes me wonder a bit why my feature takes multiple hits to be destroyed even though it has damage=1featureLOS = {
-- 0 - no default LOS for features
-- 1 - gaia features always visible
-- 2 - allyteam/gaia features always visible
-- 3 - all features always visible
-- default 3
featureVisibility = 1;
},
(tried maxdamage=1 too, just to be sure)
engine source says:
Code: Select all
fd->maxHealth = fdTable.GetFloat("damage", 0.0f);
Not sure if we talked in lobby already but did you see:Features being knocked over is currently only for engine trees, but we could work together to try and make jK's awesome shader system work with features - then it could be added easily.
http://springrts.com/phpbb/viewtopic.ph ... start=7617
(on its death, feature is replaced with a unit that plays a "fall over" animation)
Don't know how the shader system works so cant comment on that but for now its good enough for me :)
Btw /give featurename works, though featurename is not autocompleted on tab like for units. (thanks forb)