Technology without prerequisite

S3rgeus

Emperor
Joined
Apr 10, 2011
Messages
1,270
Location
London, United Kingdom
Is it possible to have a technology that has no prerequisites but can only be researched after reaching a specific era? More specifically, if I assign a tech to the industrial era, place it in the appropriate place on the tech tree (though that's only a UI edit not functionality) but set no prereqs, will a player have to wait until the industrial era to research it? Basically what I'm thinking is making a kind of separate branching tech tree that integrates with the main one as it goes along but starts later in the game.
 
Is it possible to have a technology that has no prerequisites but can only be researched after reaching a specific era?

Not directly, no. Any tech that has no prerequisites will be researchable in the ancient era, regardless of where you put it in the tree, unless it has the <Disable> flag. And having that flag means you can NEVER research it; it also prevents you from using "free tech" wonders and policies, Great Scientists, Research Agreements. (However, once a player does have it, city-states and barbarians have a chance of stealing it from you each turn, through their secondary tech mechanism. Go figure.)

HOWEVER, there are ways around this. For instance, take my own mod (Crazy Spatz's Alpha Centauri). The tech that kicks off the future eras is Centauri Ecology. While it has no prerequisite, I award that tech to anyone who completes a spaceship, and I award it to everyone else through an event that happens ~20 turns after the first spaceship is launched. This allows people to progress along the tech tree as normal. So you CAN do what you're describing, as long as you can implement a trigger for it.

If you want a later tech that unlocks a new tech tree, just Disable it, and then find some other way to award the tech through Lua. You could easily just look for whether they started the turn in the Industrial Era or later, and trigger it that way, or maybe you want them to complete a Project first to unlock it. The only headache might be that the trigger wouldn't happen until the following turn, because of how the events work, but that's not really a big deal to most players. (At least, the hundreds who've played my mod haven't complained.)

Graphical note: Disabled techs show up with a red box in the tech tree instead of the usual blue. Once you've received them some other way, they're indistinguishable from normal techs. Disabled techs CAN have prerequisites, in which case they'll have the usual arrows, but for obvious reasons those prerequisites are basically meaningless. (The only thing they'd impact is whether a city-state or barbarian faction can steal the tech; they'd need to have the prereq first.) Disabled techs with no prereq will have a small "no" symbol (red circle with slash through it) on the left side of the box, where the prereq arrows would normally connect.
If you don't like this, there are two ways around it:
1> Don't draw the tech at all. Give it a negative GridY value, and the game won't put it on the tree. It also won't draw any arrows to whatever techs depend on it, but they WILL have the "available" color instead of the normal one so it's not so bad.
2> Hide it underneath another tech. So if A is the tech to start the new tree, and only leads to tech B, then hide A under B (same X and Y values). B's color will be a bit more purplish than blue as a result, but it's still an improvement over seeing A.
Either way, the tech shouldn't have any actual benefits beyond the techs it unlocks, so there's no reason to keep it where people can see it.
 
Awesome, that is a great way of getting around that. I've created a new tech which is a prereq of my new tree and placed it at position -1 so it doesn't show up on the techtree screen and disabled it. I'm pretty much done the lua script to gift the disabled, invisible tech but whenever I use the Team:SetHasTech() function I get the research popup saying I've just finished a given research. There should be a way to stop that popup from coming up in this case, right? (Since the lua console's tech adding buttons don't actually cause the popups.)
 
I got it, I had to use the TeamTechs object to avoid the research popup.

Yes, TeamTechs is useful for a lot of that stuff. Note that many of the TeamTechs functions have just (in last week's patch) been duplicated into the Players structure, like the GetResearchProgress function. I noticed this when I was updating TopPanel.lua in my mod to be compatible with the new patch; they replaced a lot of the calls to TeamTechs with simpler ones to Players. So it looks like they're trying to make it a bit more user-friendly, where you no longer have to go Players->Teams->TeamTechs just to get anything done.

In my mod's case, I wanted that tech popup for Centauri Ecology, since it gives actual bonuses (like revealing a new strategic resource). Even if it gives nothing, you can use the popup as just another notification for whatever triggering event you use, so it's still kinda handy. But yes, if you don't want the popup there are other options.
 
Back
Top Bottom