Page 1 of 1
Technology Prerequisites
Posted: Wed Aug 19, 2015 3:29 am
by TheSAguy
Is it possible to have a Technology Prerequisites be something besides another tech?
Like a prerequisites Evolution Factor or prerequisites must first kill x aliens or spawners?
Same for entities?
Thanks.
Re: Technology Prerequisites
Posted: Fri Aug 21, 2015 7:15 pm
by SirRichie
There is no direct support for this, because the prerequisites property of a technology is a table of Lua/Technology (so nothing else). But I think it can be easily emulated [untested]:
Define your technology normally, then when the game inits/loads, disable that technology (.enabled = false).
When your prerequisite is met (which you obviously have to detect), then just set enabled = true. If the other technology prerequisites are met, it can then be researched.
Entities can be made to work like this if you use the same trick on the recipies.
Re: Technology Prerequisites
Posted: Fri Aug 21, 2015 7:50 pm
by Rseding91
SirRichie wrote:There is no direct support for this, because the prerequisites property of a technology is a table of Lua/Technology (so nothing else). But I think it can be easily emulated [untested]:
Define your technology normally, then when the game inits/loads, disable that technology (.enabled = false).
When your prerequisite is met (which you obviously have to detect), then just set enabled = true. If the other technology prerequisites are met, it can then be researched.
Entities can be made to work like this if you use the same trick on the recipies.
You'd want to just define the technology so it's not enabled by default: enabled = false in the prototype.
Re: Technology Prerequisites
Posted: Fri Aug 21, 2015 10:32 pm
by TheSAguy
Hmmm, anyway you guy's could share some code examples showing this?
Thanks for the feedback!