Default map featuredefs
Moderator: Moderators
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Default map featuredefs
I know they are hardcoded into the engine, but someone pretty please post them up in an actual usable featuredef? I'm wanting to replace the model used, etc etc.
One for geovents would be nifty too. I want to try out some stuff and see if I can come up with some sweetsauce for everyone to use.
One for geovents would be nifty too. I want to try out some stuff and see if I can come up with some sweetsauce for everyone to use.
Re: Default map featuredefs
Trees (treetype) and geovent are defined here:
https://github.com/spring/spring/blob/d ... r.cpp#L177
the names used there are more or less the same as in http://springrts.com/wiki/Gamedev:FeatureDefs
https://github.com/spring/spring/blob/d ... r.cpp#L177
the names used there are more or less the same as in http://springrts.com/wiki/Gamedev:FeatureDefs
Re: Default map featuredefs
Pretty sure there was already one in Evo? Search forum I am positive it has come up before wrt the trees.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Default map featuredefs
It was a little unclear how to get the defs to actually accept normal models in their place.
Anyway, so here is what I was cooking up. You will need to either have your game calling spring features as a dependency, or include these features in your game/map, but here are all of the spring engine tree types split into individual defs and set up to render nice looking trees (They are all 0ad pines for maximum non-crappy-looking-ness).
http://pastebin.com/N9dReARh
For newbies, just save the file as treedefs.lua, and place it in Features/All Worlds/treedefs.lua (this goes for either map or game).
At the moment they are set to use multiple sizes of 3 different pine trees. You could easily replace these with whatever you like.


It was really easy to do, just a bit unclear as to how to do it. I don't know why no one ever bothered to do it before.
I'm also thinking of some cool things that might be possible with geovents, but more on that later.
Anyway, so here is what I was cooking up. You will need to either have your game calling spring features as a dependency, or include these features in your game/map, but here are all of the spring engine tree types split into individual defs and set up to render nice looking trees (They are all 0ad pines for maximum non-crappy-looking-ness).
http://pastebin.com/N9dReARh
For newbies, just save the file as treedefs.lua, and place it in Features/All Worlds/treedefs.lua (this goes for either map or game).
At the moment they are set to use multiple sizes of 3 different pine trees. You could easily replace these with whatever you like.


It was really easy to do, just a bit unclear as to how to do it. I don't know why no one ever bothered to do it before.
I'm also thinking of some cool things that might be possible with geovents, but more on that later.
Re: Default map featuredefs
http://pastebin.com/N9dReARh is bad, not recommded, especially not to newbies.
Those interessted in topic would better look at jK's orginal post from 3 years ago, where for example the loop actually made sense, instead of this copypaste nonsense that has evolved from it.
Those interessted in topic would better look at jK's orginal post from 3 years ago, where for example the loop actually made sense, instead of this copypaste nonsense that has evolved from it.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Default map featuredefs
Not recommended by you, perhaps. But then again, you aren't an actual gamedev (other than the dabbling), just mainly an ideaguy who happens to know lua.knorke wrote:http://pastebin.com/N9dReARh is bad, not recommded, especially not to newbies.
The purpose of this is to be able to use different models for all 20 of the default tree types. JK's original loop did not account for that and instead used DRAWTYPE.TREE which runs directly counter to the purpose of this.
Even you should be able to figure out that much on your own.
User warned for this post - Felony 1. Play nicely boys.
-- FLOZi
Re: Default map featuredefs
But all you change each time is the model, can be done much better:
Personally I would create a new dir with only the models I wanted and rename the files e.g. treetype1.s3o etc and then use VFS.DirList to automatically assign. But if you are attached to all features being in SpringFeatures I can understand why you wouldn't want to go that way for evo.
Code: Select all
local models = {"ad0_pine_1_xl.s3o", "ad0_pine_1_l.s3o" ...}
for i=0,20 do
CreateTreeDef(i)
treeDefs["treetype" .. i].object = "features/0ad/" .. models[i]
end

Personally I would create a new dir with only the models I wanted and rename the files e.g. treetype1.s3o etc and then use VFS.DirList to automatically assign. But if you are attached to all features being in SpringFeatures I can understand why you wouldn't want to go that way for evo.
Re: Default map featuredefs
lolForboding Angel wrote:Not recommended by you, perhaps. But then again, you aren't an actual gamedev (other than the dabbling), just mainly an ideaguy who happens to know lua.knorke wrote:http://pastebin.com/N9dReARh is bad, not recommded, especially not to newbies.
The purpose of this is to be able to use different models for all 20 of the default tree types. JK's original loop did not account for that and instead used DRAWTYPE.TREE which runs directly counter to the purpose of this.
Even you should be able to figure out that much on your own.
User warned for this post - Felony 2. Play nicely boys.
-- FLOZi
Re: Default map featuredefs
What else but "lol" could be the answer to all that?
Does it really need explaining whycallingCreateTreeDef() 20 times makes no sense if CreateTreeDef() contains all 20 defs anyway?
I think just pointing out that something is wrong with loop should be enough to see that, well if one bothers to look...But 500 same copypasted lines is really hard to overlook? And then tell newbies to use that..
Or that anyone can actually click that link and see that the original did use models and not "DRAWTYPE.TREE" as claimed?
Or why moderation ignores posts with personal attacks and non sense, until they are answered on?
Sadly making up non sense is way quicker than debunking it, so not every time it is worth the effort to write a detailed answer, link sources etc. However it would also be bad to just leave the non sense unanswered because then people start to believe it..
Or how useless it is to work on wiki or think out forum replies if some "actual" game developers will just contradict everything anyway? There is way too much respect for silly "titles" and nobody seems to care what is actually posted.
Thus to all the above the only answer is "lol".
Also acceptable might have been: "wat".
Does it really need explaining why
Code: Select all
for i=0,20 do
CreateTreeDef(i)
end
I think just pointing out that something is wrong with loop should be enough to see that, well if one bothers to look...But 500 same copypasted lines is really hard to overlook? And then tell newbies to use that..
Or that anyone can actually click that link and see that the original did use models and not "DRAWTYPE.TREE" as claimed?
Or why moderation ignores posts with personal attacks and non sense, until they are answered on?
Sadly making up non sense is way quicker than debunking it, so not every time it is worth the effort to write a detailed answer, link sources etc. However it would also be bad to just leave the non sense unanswered because then people start to believe it..
Or how useless it is to work on wiki or think out forum replies if some "actual" game developers will just contradict everything anyway? There is way too much respect for silly "titles" and nobody seems to care what is actually posted.
Thus to all the above the only answer is "lol".
Also acceptable might have been: "wat".
Re: Default map featuredefs
Actually knorke is:Forboding Angel wrote: But then again, you aren't an actual gamedev (other than the dabbling), just mainly an ideaguy who happens to know lua.
For xta as nominated by dnw.Owner
Occasional game devlopment assistant
Reserve repo admin
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Default map featuredefs
And yet, you assume that said user wants exactly the same stats for each feature.
Lol, k jools. Whatever you say.
Lol, k jools. Whatever you say.
Re: Default map featuredefs
1) lol.
2) The loop is still nonsense.
3) A few different stats per feature does not mean that one has to copypaste hundreds of identical lines.
4)This is a Lua problem. Do you even? No. So why discuss it.
2) The loop is still nonsense.
3) A few different stats per feature does not mean that one has to copypaste hundreds of identical lines.
4)This is a Lua problem. Do you even? No. So why discuss it.
Re: Default map featuredefs
It is possible that you can establish a table that is built in a way that each element in the table can have differing stats forb.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Default map featuredefs
Yet, no one has ever bothered to actually do it.
Re: Default map featuredefs
How can you insist that no one has ever done that when your copypastebin is edit of a post which did excactly this.Forboding Angel wrote:Yet, no one has ever bothered to actually do it.
In this thread Flozi posted a way again.
You do not "see" that denn es fehlt Basiswissen.
What it comes down to is creating tables and changing some entries: Read http://lua-users.org/wiki/TablesTutorial
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: Default map featuredefs
Forboding Angel wrote:Yet, no one has ever bothered to actually do it.
Re: Default map featuredefs
No reason. I could if you need me to but I don't think it is necessary. Unlike others I don't think that it needs it and all. Dunno, not a big deal was just trying to say it is doable
Re: Default map featuredefs
This post in and of itself is a better response than 'lol'.knorke wrote:What else but "lol" could be the answer to all that?
Does it really need explaining whycallingCreateTreeDef() 20 times makes no sense if CreateTreeDef() contains all 20 defs anyway?Code: Select all
for i=0,20 do CreateTreeDef(i) end
I think just pointing out that something is wrong with loop should be enough to see that, well if one bothers to look...But 500 same copypasted lines is really hard to overlook? And then tell newbies to use that..
Or that anyone can actually click that link and see that the original did use models and not "DRAWTYPE.TREE" as claimed?
Or why moderation ignores posts with personal attacks and non sense, until they are answered on?
Sadly making up non sense is way quicker than debunking it, so not every time it is worth the effort to write a detailed answer, link sources etc. However it would also be bad to just leave the non sense unanswered because then people start to believe it..
Or how useless it is to work on wiki or think out forum replies if some "actual" game developers will just contradict everything anyway? There is way too much respect for silly "titles" and nobody seems to care what is actually posted.
Thus to all the above the only answer is "lol".
Also acceptable might have been: "wat".
As for 'why moderation ignores...', we are not omnipresent.
