The Touhou Mod Development Thread

Now this is just a loose idea I came up with while playing a different game entirely, but here's what I came up with for Reimu:

UA: Obviously it'd be called Fantasy Nature, since that's her "ultimate" ability/card. No making settlers or annexing cities. Can buy with gold and faith in puppets. -5 or 10% Food and Gold. All units get a unique promotion that gives gold when attacking cities or killing units. Even more if it's a barb camp. (Less for actual barbs though, no gold farming.)

UU: Hakurei Shrine Maiden, General replacement. Takes longer to generate but ignores terrain and provides slightly more of a combat bonus. (Or perhaps does something else entirely separate from combat. Like stationing them in cities gives a buff to yields?)

UB: Donation Box: provides extra gold based on amount of puppeted cities, can only be built in the capital. (Maybe as a replacement for the EIC if that's possible?)

Some of that's probably unreasonable, but as I said it's a loose idea.
 
Hmm, I always thought her final attack was "Fantasy Heaven"... but according to the wiki, at least, you appear to be right! Although I'm halfway tempted to use "Fantasy Seal", because her civ is somewhat "sealed"... :P

The ideas you've got sound pretty good, though! I know I'd tossed around the idea of a "donation box" UB before, but since I hadn't thought of going OCC before it was a bit odd. There's no issue with replacing a National Wonder with a UB version, so making an EIC UB should be find. It'd be amusing if it also gave a bonus to trade routes... need those people making donations! :P

The Shrine Maiden UU sounds fine... could easily give it an ability where it provides a buff while stationed in a city, as I know several other UUs do it.

As for the UA, I'm not entirely sure it needs a base penalty -- isn't being an OCC challenging enough? :P The additional unit ability would be easy (I imagine it'd use a dummy promotion using something like Honor's finisher). Gold farming from barbs doesn't actually sound too bad, as Gensokyo's mikos have a reputation for going out and beating up random youkai, don't they?

Uuuuugh... I gotta get some of my mods finished! Tanuki just need final testing, because I don't know if I cleaned up all of the last set of bugs yet. Makai is almost there, gotta tweak the demon spawning rates. If I can get those two out, I can focus attention on all the new civs I want to make -- Mima's progressing nicely, I still want to make a Yumemi civ, got some ideas for Miko, and now Reimu as well... :P

Not sure how Huitzil is feeling these days -- last report I heard was that the AI simply couldn't use Yuuka's abilities, which left him pretty bummed out.
 
Two things.

1. If you're making a Touhou Civ, feel free to hit me up with any Lua coding questions, or even direct requests for Lua code. Making things work with Lua is actually my favorite part of making new Civs, so I'm looking to help people out with their Civs while I work on my Madoka modpack a little at a time.


2.
Spoiler :
wich 2hu wud u DoF?
 
If you're making a Touhou Civ, feel free to hit me up with any Lua coding questions, or even direct requests for Lua code. Making things work with Lua is actually my favorite part of making new Civs, so I'm looking to help people out with their Civs while I work on my Madoka modpack a little at a time.

Hey Vicevirtuoso! I've noticed all of the work you've been putting in in the Lua requests thread... so many helpful pieces of code there! Currently most of my civs are either at the "code almost complete, needs refinement" stage, or "still brainstorming, need more ideas" stage. I'm not sure how familiar you are with Touhou, so whether or not you could help with brainstorming... :P

That said, there's a couple of things I'm working through I could use some input assistance on.

a) With my Mima civilization, I'm using your button code once again for a summoning effect. The effect itself I'm confident I can pull off, but I'm wondering how to keep the ability limited to "once per turn". I know with the Tanuki I had a promotion the unit lost once the "once per game" effect was used. Would it be most efficient to do something similar, with a promotion I could assign to the units at the start of the game turn?

Also, I'm trying to remember how you let a unit move after using the ability... I know there's a line of code you need to use, but can't remember what it was.

b) I want to update my Moriya civilization with a passive effect that gives a city +1 Science and +1 Faith for each mountain in their city radius. A pretty simple effect, I think, in which you loop through each city, loop through their tiles, count the number of Mountains, and spawn dummy buildings accordingly. (I think you wrote similar code for the Boers and their farms?) Something I've been meaning to do myself, but just haven't had time. If you'd be willing to put the code together, I could easily put out an update for the Moriya Shrine with it. :D (I'd still have to make the requisite dummy buildings in XML but that'd be easy.)

Thanks for the offer of help!
 
Hmm, I always thought her final attack was "Fantasy Heaven"... but according to the wiki, at least, you appear to be right! Although I'm halfway tempted to use "Fantasy Seal", because her civ is somewhat "sealed"... :P

Fantasy Seal is certainly a valid alternative, I just felt that Reimu's UA should be her biggest spellcard. (Or at least, her most OP one according to Marisa.)


The ideas you've got sound pretty good, though! I know I'd tossed around the idea of a "donation box" UB before, but since I hadn't thought of going OCC before it was a bit odd. There's no issue with replacing a National Wonder with a UB version, so making an EIC UB should be find. It'd be amusing if it also gave a bonus to trade routes... need those people making donations! :P

Yeah the donation box UB idea I had only really makes sense as a OCC civ, otherwise it's just a bank or EIC or whatever, but when it's tied right to the gameplay style of the civ and its semi-unorthodox expansion it makes more sense. Gotta make sure the new "donators" pay their dues. I figured that making it a national wonder would be the best move to make sure it's built in the capital instead of one of your puppets building it. A trade bonus internally (although not to the extent of Yuuka of course) would make sense as well.

As for the UA, I'm not entirely sure it needs a base penalty -- isn't being an OCC challenging enough? :P The additional unit ability would be easy (I imagine it'd use a dummy promotion using something like Honor's finisher). Gold farming from barbs doesn't actually sound too bad, as Gensokyo's mikos have a reputation for going out and beating up random youkai, don't they?

I admit the food/gold penalty was mostly just a "Reimu is poor and hungry" joke, it's certainly not required. (It's also not really supported by canon.) Although, assuming it's low enough to cancel out, the gold penalty could encourage the use of the other aspects, ie the promotion and donation box. Food might be unfair, it's not like civs that are't Eientei can just ignore farms normally and with a penalty it would be even worse. (Not to mention the fact that OCC civs tend to be and want to be very tall in the capital.) The thing about gold farming is sort of that I was concerned about just sitting outside a barb camp killing them when they spawn and not actually clearing the camp, which seems like improper behavior for the whole "youkai hunting" angle you could put on barb hunting. Clearing the camp is like solving an incident, you don't just sit outside it for 500 years.

Maybe as a compromise on the "poor miko" thing, she gets some sort of tourism penalty? Her shrine not getting visitors is pretty heavily supported by the source material. That said, given what you've said before about Shinki, I gather that modifying tourism can be difficult.


On a related note to the youkai/barb hunting thing, I could suggest that Keine's Youkai Hunter UU could perhaps get some small bonus against barbs?
 
Aaaaah! Did anyone see this post yet? Someone's been working on a Reimu model!

attachment.php


It looks so goooood... I wonder what they're planning to do with it?
 
Hmm, I always thought her final attack was "Fantasy Heaven"... but according to the wiki, at least, you appear to be right! Although I'm halfway tempted to use "Fantasy Seal", because her civ is somewhat "sealed"... :P

Yeah, it used to be "Fantasy Heaven" for a very long time. Well, until it was deemed inaccurate due to omission, so now it's "Fantasy Nature".

2.
Spoiler :
wich 2hu wud u DoF?
Ha ha ha. But seriously, thanks for the Madoka mods.

Fantasy Seal is certainly a valid alternative, I just felt that Reimu's UA should be her biggest spellcard. (Or at least, her most OP one according to Marisa.)
Well, "Fantasy Seal" is Reimu's trademark spell card, much like Marisa's "Master Spark". Using spell card names as abilities does convey a combat-type ability sense though. Something more general would be "Hakurei Bloodline", "Barrier Maiden", etc.

Aaaaah! Did anyone see this post yet? Someone's been working on a Reimu model!

I do have some reservations with that. Since the thread is about converting Civ4 models to Civ5, I'm inclined to believe that the models were borrowed from Touhou Epic. If they were, I'd have to consult with Souha (provided he is still active) about borrowed use.

At the very least, if anyone does intend on using those models, I ask that you contact me in advance so that I know what's happening, and if possible, for me to draft a credits/copyrights guideline.
 
I do have some reservations with that. Since the thread is about converting Civ4 models to Civ5, I'm inclined to believe that the models were borrowed from Touhou Epic. If they were, I'd have to consult with Souha (provided he is still active) about borrowed use.

At the very least, if anyone does intend on using those models, I ask that you contact me in advance so that I know what's happening, and if possible, for me to draft a credits/copyrights guideline.

Ahhh, yes, that's a good point! Sorry... for some reason it slipped my mind for a moment. @__@

EDIT: Urgh... man, this has been bothering me all night, now. I know the subject of Touhou Epic, and the request not to use its assets without permission, came up earlier in this thread... so the fact that it slipped my mind and I got excited about assets that were likely taken from Touhou Epic has left me feeling rather guilty. Bleah.

Anyone got any other Touhou-related topics I can think about to get my mind off of things?
 
Ahhh, yes, that's a good point! Sorry... for some reason it slipped my mind for a moment. @__@

EDIT: Urgh... man, this has been bothering me all night, now. I know the subject of Touhou Epic, and the request not to use its assets without permission, came up earlier in this thread... so the fact that it slipped my mind and I got excited about assets that were likely taken from Touhou Epic has left me feeling rather guilty. Bleah.

Anyone got any other Touhou-related topics I can think about to get my mind off of things?

Well, now that we do know that it's possible to import the entirety of Touhou Epic graphics to Civ5, it's one major hurdle cleared, that's for sure.
 
a) With my Mima civilization, I'm using your button code once again for a summoning effect. The effect itself I'm confident I can pull off, but I'm wondering how to keep the ability limited to "once per turn". I know with the Tanuki I had a promotion the unit lost once the "once per game" effect was used. Would it be most efficient to do something similar, with a promotion I could assign to the units at the start of the game turn?

Also, I'm trying to remember how you let a unit move after using the ability... I know there's a line of code you need to use, but can't remember what it was.

Yeah, refreshing the promotion which enables the button each turn and removing it upon use sounds like the best way to go about it.

It should actually allow the unit to move by default. In fact, what you have to specifically code in is the case in which you do not want them to move after use, by using pUnit:SetMoves(0).

b) I want to update my Moriya civilization with a passive effect that gives a city +1 Science and +1 Faith for each mountain in their city radius. A pretty simple effect, I think, in which you loop through each city, loop through their tiles, count the number of Mountains, and spawn dummy buildings accordingly. (I think you wrote similar code for the Boers and their farms?) Something I've been meaning to do myself, but just haven't had time. If you'd be willing to put the code together, I could easily put out an update for the Moriya Shrine with it. :D (I'd still have to make the requisite dummy buildings in XML but that'd be easy.)

Thanks for the offer of help!

This code should be pretty much universal with only minor edits, mostly to the variables and the line starting with "if pPlot". I used variants for both Nagisa and the Boers.

Code:
iCiv = GameInfoTypes.CIVILIZATION_YOURCIV
iDummy = GameInfoTypes.BUILDING_YOURDUMMYBUILDING
iFeature = GameInfoTypes.FEATURE_MOUNTAIN

function YieldFromFeature(iPlayer)
	if iPlayer < GameDefines.MAX_MAJOR_CIVS then
		local pPlayer = Players[iPlayer]
		if pPlayer:GetCivilizationType() == iCiv then
			for pCity in pPlayer:Cities() do
				local iNumPlots = pCity:GetNumCityPlots();
				local iNumBuildings = 0;
				for iPlot = 0, iNumPlots - 1 do
					local pPlot = pCity:GetCityIndexPlot(iPlot)
					if pPlot and pPlot:GetOwner() == iPlayer and pPlot:GetFeatureType() == iFeature then
						iNumBuildings = iNumBuildings + 1
					end
				end
				pCity:SetNumRealBuilding(iDummy, iNumBuildings)
			end
		end
	end
end

GameEvents.PlayerDoTurn.Add(YieldFromFeature)
 
Two things.

1. If you're making a Touhou Civ, feel free to hit me up with any Lua coding questions, or even direct requests for Lua code. Making things work with Lua is actually my favorite part of making new Civs, so I'm looking to help people out with their Civs while I work on my Madoka modpack a little at a time.
Couple of non-urgent questions, then:

1: "One additional Quest active from each City State at a given time. +50% (100, whatever arbitrary number) Influence from quests." Doable, and if so, how?

2: "Gain an additional Founder belief from any religion you found; double yields from Founder beliefs." (My original idea for Moriya, maybe can be used for something else.) Doable, and if so, how?

3: bouncymischa was right, it appears that AI Yuuka just has no idea how to use her abilities. She never builds Sunflower Fields because, as far as I can tell, the AI only looks at "will THIS TILE have a better yield if I build THIS improvement here", and not "will THESE X TILES have better yields if I build THESE improvements here" -- it can't see "I need a bunch of these together to make it worthwhile". And the AI flavors for trade only modify how likely it is to build Caravans, Granaries, Harbors, etc -- it can't tell the AI where to point those routes! So, how do I get her to use them / cheat on her behalf to either get her to use them, or approximate their use by a human player?


2.
Spoiler :
wich 2hu wud u DoF?
Team 9 for life! We ride together, we PICHUUN together!
 
1: "One additional Quest active from each City State at a given time. +50% (100, whatever arbitrary number) Influence from quests." Doable, and if so, how?

The Tropico civilization done by Leugi has part of this benefit -- it gets increased Influence from completing city state quests. I was hoping this meant there was some Lua code you could use to tie things to completing city state quests, but apparently I think it just uses a dummy policy to gain the effect. Still, it is possible to get increased influence that way.

Were you thinking of doing the Miko civ? After seeing the Tropico civ, I started brainstorming ideas for it, but I haven't gone too far. I've still got Mima to finish and I'm more interested in working on Yumemi after that, so Miko's a bit on the back burner for me...
 
1: "One additional Quest active from each City State at a given time. +50% (100, whatever arbitrary number) Influence from quests." Doable, and if so, how?

This will likely require a DLL edit, which is outside of the scope of things I've worked on. I found the Lua function AddMinorCivQuestIfAble, but I haven't tested it. The key word in that function is "IfAble," which leads me to believe that if the Civ already has the maximum number of available quests, it will fail. As far as the influence per quest, I found nothing in Lua, I'm afraid.

2: "Gain an additional Founder belief from any religion you found; double yields from Founder beliefs." (My original idea for Moriya, maybe can be used for something else.) Doable, and if so, how?

I haven't looked into something like this, but I think it may be possible. It won't be easy, though, and I wouldn't recommend it to those who aren't comfortable working with Lua yet. You'll want to:

  • Make a dummy copy of each Pantheon belief, and make them unselectable normally. Upon adopting a Pantheon, use Lua to grant the duplicate belief to the Civ. Add these in via SQL triggers so that if another mod adds/alters Pantheon beliefs, it will automatically update the dummies.
  • Write a new UI popup to allow the player to select a second Pantheon belief, and then also use Lua to grant its dummy duplicate. But then again, maybe you could just call up the regular Pantheon selection screen in some way. I'm currently learning just how the UI works myself...
  • Edit ReligionOverview.lua to enable seeing the extra pantheon belief (ideally, you can just edit the Byzantium bonus belief field to instead show the extra Pantheon belief if your Civ is being played at the time)

3: bouncymischa was right, it appears that AI Yuuka just has no idea how to use her abilities. She never builds Sunflower Fields because, as far as I can tell, the AI only looks at "will THIS TILE have a better yield if I build THIS improvement here", and not "will THESE X TILES have better yields if I build THESE improvements here" -- it can't see "I need a bunch of these together to make it worthwhile". And the AI flavors for trade only modify how likely it is to build Caravans, Granaries, Harbors, etc -- it can't tell the AI where to point those routes! So, how do I get her to use them / cheat on her behalf to either get her to use them, or approximate their use by a human player?

I ran into a pretty similar issue with my new Lord Recluse Civ. Its UI can only be built on post-Renaissance Strategic Resources, and can provide +3P/+3S after Ecology alongside its +50% Defense and adjacent border capture. The recommended improvement to be built, however, is always the Mine or Well. Even when the UI is strictly better than the Mine or Well; i.e. Mines provide +3P and the UI provides +3P/+3S.

Bizarrely, Miku and her Spring Onion Farms don't run across this issue.

To be honest, this is probably seated deep within the AI's (il)logic and may also require a DLL edit, unless you just make the improvement a lot better in an attempt to get her to use it. I've noticed that the AI logic mostly tends to value Food to a high degree in the early game, and Gold in the late game, with all other yields being secondary. So if your UI provides neither of those, it's very poorly valued by the AI. Perhaps try adding a minor Gold yield (gate it by a Technology if you want) and see how it works then.

Team 9 for life! We ride together, we PICHUUN together!

Liking worst 2hu? More like "The Bad Taste Development Thread," right? :nono:

I kid, I kid. Man shan't be judged for his taste in Touhous in my presence.
 
This will likely require a DLL edit, which is outside of the scope of things I've worked on. I found the Lua function AddMinorCivQuestIfAble, but I haven't tested it. The key word in that function is "IfAble," which leads me to believe that if the Civ already has the maximum number of available quests, it will fail. As far as the influence per quest, I found nothing in Lua, I'm afraid.
Well, apparently, there's a never-used Policy benefit that modifies Influence from quests, <MinorQuestFriendshipMod>. So I could use a dummy policy for that. And "get to max quests faster" could work instead of "one more quest".



I ran into a pretty similar issue with my new Lord Recluse Civ. Its UI can only be built on post-Renaissance Strategic Resources, and can provide +3P/+3S after Ecology alongside its +50% Defense and adjacent border capture. The recommended improvement to be built, however, is always the Mine or Well. Even when the UI is strictly better than the Mine or Well; i.e. Mines provide +3P and the UI provides +3P/+3S.

Bizarrely, Miku and her Spring Onion Farms don't run across this issue.

To be honest, this is probably seated deep within the AI's (il)logic and may also require a DLL edit, unless you just make the improvement a lot better in an attempt to get her to use it. I've noticed that the AI logic mostly tends to value Food to a high degree in the early game, and Gold in the late game, with all other yields being secondary. So if your UI provides neither of those, it's very poorly valued by the AI. Perhaps try adding a minor Gold yield (gate it by a Technology if you want) and see how it works then.
I meant, like, how do I use the LUA to make the UI better when used by an AI player? I know you did an AI cheat for the Madoka civs, since they could never know how to use the Incubators, I was asking along those lines -- how to do it and what ought it be.
 
Well, apparently, there's a never-used Policy benefit that modifies Influence from quests, <MinorQuestFriendshipMod>. So I could use a dummy policy for that. And "get to max quests faster" could work instead of "one more quest".

Never noticed that one. Thanks for letting me know it's there!



I meant, like, how do I use the LUA to make the UI better when used by an AI player? I know you did an AI cheat for the Madoka civs, since they could never know how to use the Incubators, I was asking along those lines -- how to do it and what ought it be.

Unfortunately, it may not be that easy since there is no Building_ImprovementYieldChanges table. If that existed, you could just add that to a dummy building which is provided only to AIs.

You could, however, try this:

  • Create a copy of the UI with enhanced yields, but do not add its Build action to the Worker's Build table
  • Make a Worker replacement identical to the regular Worker, with the only difference being the ability to Build the enhanced version of the UI
  • Use Lua to replace regular Workers with the new Workers, but only for the AI (by checking for pPlayer:IsHuman() to be false)


As a note, the reason easy cheats could be used for the Incubator is because there is no logic in the DLL at all for Lua custom missions. If you were to try, say, forcing the AI to build a UI via Lua, you would have to constantly contend with the AI attempting to construct something else over your UI due to its Worker AI logic.
 
Oh, bouncymischa, a quick question regarding the Tanuki bonus: do spies as diplomats provide the bonus as well? I'd assume so since they're active spies but they're not really active AS spies at the same time. And perhaps a better question is, SHOULD they give the bonus?

Also, I only just figured it out seeing the steam release, but the version of them that I reported as being squashed by Eientei was v1, who had the bookstore and the pikeman replacement that was weaker in groups. You probably had changed over to the newer scout at the point I mentioned it. That's what I was referring to when I noted that they might have issues using the UU.
 
Oh, bouncymischa, a quick question regarding the Tanuki bonus: do spies as diplomats provide the bonus as well? I'd assume so since they're active spies but they're not really active AS spies at the same time. And perhaps a better question is, SHOULD they give the bonus?

Also, I only just figured it out seeing the steam release, but the version of them that I reported as being squashed by Eientei was v1, who had the bookstore and the pikeman replacement that was weaker in groups. You probably had changed over to the newer scout at the point I mentioned it. That's what I was referring to when I noted that they might have issues using the UU.

Ahhh... yeah, I made a lot of changes to them that didn't really get posted on the version uploaded here. Sorry about that!

As for the diplomats/spies issue... yes, they'll generate the money bonus as diplomats. Part of it is because I wasn't entirely sure how to differentiate diplomats from spies -- I think you can do it, since I think I've seen a civ where diplomats can still steal technology, but at the time it was adding more complexity to something that felt it was already becoming too complex. (The UA text is near the limits of how long UA text can get... :P)

The other part is that there are stories of tanuki like Danzaburou-danuki who would create illusions of living in splendid estates in what were really just holes in the ground. So it seemed like the kind of thing a diplomat-tanuki would do -- use their illusions to scam wealthy members of the populace out of their wealth and finery while schmoozing them for diplomatic purposes. :P
 
Unfortunately, it may not be that easy since there is no Building_ImprovementYieldChanges table. If that existed, you could just add that to a dummy building which is provided only to AIs.

You could, however, try this:

  • Create a copy of the UI with enhanced yields, but do not add its Build action to the Worker's Build table
  • Make a Worker replacement identical to the regular Worker, with the only difference being the ability to Build the enhanced version of the UI
  • Use Lua to replace regular Workers with the new Workers, but only for the AI (by checking for pPlayer:IsHuman() to be false)


As a note, the reason easy cheats could be used for the Incubator is because there is no logic in the DLL at all for Lua custom missions. If you were to try, say, forcing the AI to build a UI via Lua, you would have to constantly contend with the AI attempting to construct something else over your UI due to its Worker AI logic.

Well, the problem there is that if a human player captures one of Yuuka's cities, now you have a bunch of super-overdrive sunflower fields. Is it possible to use LUA to give out civ abilities? I know those can have improvement modifiers.

Also, how should I get the AI to use its actual "bonus from internal trade routes" UA, or how do I cheat to emulate its use?
 
This code should be pretty much universal with only minor edits, mostly to the variables and the line starting with "if pPlot". I used variants for both Nagisa and the Boers.

Hey Vicevirtuoso -- I added the code to my Moriya civ, and it almost worked. I finally figured out that the issue is that Mountains are neither features nor terrain (despite having a value in the Terrain types...). In order to figure out if a tile is a mountain, you need to use "pPlot:IsMountain()" instead of "pPlot:GetFeatureType() == iFeature". Figured it'd be helpful to know!
 
Back
Top Bottom