• 📚 A new project from the admin: Check out PictureBooks.io, an AI storyteller that lets you create personalized picture books for kids in seconds. Give it a try and let me know what you think!

Temporary Resources?

jefmart1

Prince
Joined
Aug 16, 2005
Messages
463
Is it possible to make resources temporary? I only want the civ to have a resource for 10 turns or so.

Lets say I had a unit like a Fuel Tanker that went to a city and it could make a "building" I guess or somehow grant the civ the resource of oil for a limited number of turns. Or oil could be bought from an International market (like the one in Broken Star), but the amount purchased limited the use to 10 turns.

Could this be done and how would you do it?
 
I had a thought on this:

An item could be used (via a spell) to trigger an event that gives the resource as a bonus, with a timed additional event that removes it. The item would be used up by the spell like a healing salve is in FFH2.

Am I correct in this?
 
Yes, in python.

The only issue is what plot the resource would go in. Each plot can only have 1. With a building it would be simpler.

In rfre.py look at endSocialWar. This is how to add a building to all of your civ's cities. As for removing this after X turns, look at all the lines with iTurnsToNextTech in them. Note the onLoadGame and onBeginPlayerTurn event overrides.

Also there would have to be something on how to get the whole thing started.. some sort of unit action override? The only way I know of (not saying much) is to have a repeatable tech. Then you can trade the tech and trigger it off of onTechAcquired.

That makes it:
1. trade tech
2. give buildings, forget tech, start doomsday counter
3. when counter expires remove buildings
 
Back
Top Bottom