Jump to content

Technologies for Captured Buildings


Recommended Posts

Hi guys. In my mod I make mercenary camps work. They are indestructible (a few bugs but that's different story), can be capture by all players, the right mercenary are available to the right player. So far so good.Everything wprk BEAUTIFULLY.

 

Now, I would like to have some mercenary camp technologies, some unique to different civs who capture them. I tried out two test technology. I put them in the merc camp building and capture the building.

{
	"genericName": "Test Romans",
	"specificName": "Teste Romani",
	"description": "Test tech for merc camps.",
	"cost": {"food": , "wood": , "stone": , "metal": 250},
	"requirements": {"all": [{"tech": "phase_town"}, {"civ": "rome"}]},
	"requirementsTooltip": "Unlocked in Town Phase.",
	"icon": "sibylline_books.png",
	"researchTime": 40,
	"tooltip": "All units +20% vision range.",
	"modifications": [{"value": "Vision/Range", "multiply": 1.25}],
	"affects": ["Unit"],
	"soundComplete": "interface/alarm/alarm_upgradearmory.xml"
}
{
	"genericName": "Test Athenians",
	"specificName": "Teste Graeci",
	"description": "Test tech for merc camps.",
	"cost": {"food": , "wood": , "stone": , "metal": 250},
	"requirements": {"all": [{"tech": "phase_town"}, {"civ": "athen"}]},
	"requirementsTooltip": "Unlocked in Town Phase.",
	"icon": "helmet_corinthian_crest_2.png",
	"researchTime": 40,
	"tooltip": "All units +20% vision range.",
	"modifications": [{"value": "Vision/Range", "multiply": 1.25}],
	"affects": ["Unit"],
	"soundComplete": "interface/alarm/alarm_upgradearmory.xml"
}

 

You can see one are to show up if the ROME civ or the ATHEN civ capture the mercenary camp, but they don't show up when captured by either player. Is something I to do to make this work? Thanks.

Edited by wowgetoffyourcellphone
  • Like 1
Link to comment
Share on other sites

4 minutes ago, fatherbushido said:

You didn't forget to add <Technologies datatype="tokens">your techs</Technologies> in the mercenary camp template ?

Haha no, I didn't forget that. :)

 

  <ProductionQueue>
	<BatchTimeModifier>0.8</BatchTimeModifier>
	<Entities datatype="tokens">
	  units/{civ}_merc_infantry_1
	  units/{civ}_merc_infantry_2
	  units/{civ}_merc_infantry_3
	  units/{civ}_merc_cavalry_1
	  units/{civ}_merc_cavalry_2
	  units/{civ}_merc_cavalry_3
	</Entities>
	<Technologies datatype="tokens">
	  mercenaries/test_romans
	  mercenaries/test_athen
	</Technologies>
  </ProductionQueue>

 

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

Just now, fatherbushido said:

When capturing a building, you don't have access to the techs (i tried with docks, blacksmith, dropsites).  Sanderd17 knows more about that.

Hmmm, I think player should have access if the techs requirements are like this: 

"requirements": {"all": [{"tech": "phase_town"}, {"civ": "athen"}]}

But yeah I think sanderd will tell me it is impossible.

Link to comment
Share on other sites

Using techs on a captured building isn't implemented yet, and when it's done, it should be done carefully (so we don't get unexpected stacking of almost similar techs).

What you propose (using the civ requirement) indeed seems like an option. Perhaps we should review all techs so they get a civ requirement, and then the technologies can just be enabled in the production queue.

This is the line that does the check: http://trac.wildfiregames.com/browser/ps/trunk/binaries/data/mods/public/simulation/components/ProductionQueue.js#L155 So if you check all techs in your mod, and you override that function in your mod with that check disabled, it should have all techs when a building is captured.

Link to comment
Share on other sites

http://trac.wildfiregames.com/changeset/18021

 

^This is a great improvement on this area, but I think instead of denying the tech (which take a lot of effort -- most of tech should be denied),I think there should be tag for civ only.

So, instead of for civ tag, for (this) civ only.

Your thoughts? Maybe I think about this backward -- I haven't trying modding with this yet so the implications may be foreign to me yet. Thanks for any reply.

Edited by wowgetoffyourcellphone
  • Like 1
Link to comment
Share on other sites

For instance, does not seem rightly to have tech available that boosts slinger if the capturing civ does not access to slinger. The tech should just not show up.

Same basically for merc camps, which I am most interested in having this feature for. The techs that show up in the merc camp for the capturing player should be different ford ifferent civ since the mercs for all the civ are different.

So, if a Macedonian player capture the merc camp the techs that show up are unique to the Macedonians. Shouldn't capture the merc camp and see techs that affect Persian mercs and also the other way around. Persian player should not see techs in merc camp that belong to Roman mercenaries and on and on. Is this possible? haha

 

I think if in the requirement it says {"civ": "athen"}, then the tech should only show up for the Athenians. This would make merc camps almost 100% complete feature. If it say {"civ": "rome"}, then tech should not show up for Athenian player at all. Right now, the tech is researchable with {"civ": "athen"} by the Athenian civ, which is great, but the Roman one still shows up, even if it is grayed out. For merc camps to work right and look riuht, the GUI can't have dozens of unresearchable grayed techs for all the other civs. They would not all fit even if it was desirable for them to remain (it is not).

 

If it has no civ requirement, it shows for all civs and is researchable by all civs. (Currently works like this already)

 

Then for capturing Temple and Civics Centers, Barracks, etc. we can use {"notciv": "brit"} to deny a tech to the Britons player (let's say, if its a hoplite tech or something like that culturally exclusive -- Britons don't have hoplites, but for sake of example all the other civs do, so we only need to deny it from the Britons). Again, it would not even show up in the UI.

 

Does this sound like something good? I think the only major thing to complete feature is to have unavailable tech removed from UI.

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

4 minutes ago, fatherbushido said:

Perhaps i m wrong, but it seems it's yet done (in svn) ?

(The unavailable techs from the civ point of view are currently greyed).

Yeah last part of my post ("notciv") is done. Need to have unavailable techs removed from GUI to complete feature I think.

Edited by wowgetoffyourcellphone
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...