Logo Platform
logo amplifiers simplified

Problems with tech screen tooltip for creating new tech & improvements

Reply
Copied to clipboard!
9 years ago
Sep 20, 2015, 10:35:50 PM
Hey Everyone,



Ok so I'm trying to create a new technology that does a double unlock of two new city improvements.



I can get everything to work except having the tooltip in the research tech screen to match.



How do I get the tooltip to show BOTH city improvement info?

How do I get the building costs to show up on the tooltips?



Basically just trying to make my new technology (double unlock improvements) tooltip in technology the same as all the other technologies tooltips in the game.



Anyone understand how the tech screen tooltip works? A Pikou response is also always welcome!!!
0Send private message
9 years ago
Sep 20, 2015, 11:48:51 PM
In my experience the tooltip system just works, and usually it just works via some kind of black magic. It really is an amazing thing. Sometimes things have 'tooltip override' written in them, but it's commented out. You can also suppress tooltips with a modifier, like was done with the dual-wield ability.



I've scoured through the GUI files, and I can't find any tooltip overrides that would affect technologies like Geomic labs. Have you tested the technology to see that it works and actually does unlock both improvements?



Posting up your mod thus-far might help.
0Send private message
9 years ago
Sep 21, 2015, 12:36:24 PM
The tooltip of a double unlock should present automatically both description + effects of the city improvements it is linked too.

Maybe your technology is lacking the link telling it that it should unlock the 2nd city improvement.



If you still cannot find a solution I concur with ZenTractor, a look at your mod in its current state will be the most efficient way to help you smiley: smile
0Send private message
9 years ago
Sep 22, 2015, 7:03:04 AM
Really love the support and speedy responses Zen and Pikou.



Oh man this is gonna be a long post...

....bear with me. I'll keep the short and sweet part at the top and my life story about the modding of this game closer to the bottom (so you can skip it if you get bored)



Short and simple first: The basic problem is the tooltip in the research screen for a technology that a modder creates that unlocks an improvement does NOT display the "cost" category AT ALL. Also obviously if you do a double unlock it won't display both improvements (cost or effect of 2nd improvement) like the normal double unlock techs already do in the game. I think the "cost" section in the tooltip is somewhere else (possibly hard coded - but oh god I hope not)



My 1st goal is to see if I can get the "cost" to display on any technology tooltip a modder creates for a new city improvement.

My 2nd goal would be to get the double unlock for 2 city improvements working correctly.



My response to Pikou is: I don't think there really IS anything (in the XML files anyways) that links a technology to an improvement besides the prerequisite in the improvement's definition requiring the technology to unlock the improvement. In most of the files they seem completely separate.



The closest I've come to linking them is in the following file: Simulation/DepartmentOfScience+Constructibles[Era1Tecnology].xml:



[CODE]









$Property(EmpireTypeMajor/ClassResearch:TechnologyCost)* $Property(EmpireTypeMajor/ClassResearch:Era1CostMultiplier)

EmpireTypeMajor/ClassResearch,TechnologyEra1

[/CODE]



When I added the line "SimulationDescriptorReference CityImprovementMilitaryNumber1" it added it's effects in the effects window part of the tech tooltip but that's it... no cost smiley: frown



I've attached a .zip file of my mod. Well it's not really my actual mod. It's a bare bones example of what I'm trying to do. And I disabled the second improvement I had in the files. It's still in the files but just not currently active since I was just trying to get the "cost" category to show up first.



Ok now here's my life story...



My actual mod is massive, I'm only about 30% done with it and it's not working right now because I've been playing around with so many variables that it broke and I'm gonna have to figure out how to fix it and I JUST found out about the "temporary files" folder to figure this out. Shout out to Zen (your other post with Pikou was very enlightening about that.) Plus my mod has a bunch of other files included for other changes made in the game so i figure the attached mod is much better at being simple to understand.



So...my actual goal is to simply change up some of the improvements that are already in the game. I don't intend to add new improvements (well I want to make new improvements but only use the original game art assets.) When trying to do this I noticed that if I modified the simulation descriptor of an improvement it automatically updated the "effects" window in the technology screen. However what I found was the "cost" category did not update even if I changed the cost of the improvement. It WILL update for the tooltip of the actual improvement (so when you go to build the improvement in the city queue it will show the proper cost) BUT in the technology screen the tooltip will only show what was originally programmed. And also if I tried to change the improvement from a "one in each empire" to a "one in every city" it still would display the "one in each empire" message in the "effects" window. And I would like to move some of the improvements techs to other techs and thereby create new "double unlocks" for some of the other original "single techs." To test what I wanted to do I created the attached mod to start from scratch and see how modding a new tech and attaching a improvement would work. When I did so, the same issues came up. So that's when I went to the boards. It may seem like a small thing but if I actually finish this mod I want to make sure that it feels polished... and broken tooltips make the whole thing feel like your not playing the actual game just some hacked imitation.



PS. Most of the improvements changes I want to make involve beefing up militia to make defense a little better of an option and make sure attacking empires actually suffer loses when they wage wars.



...Is anyone still there?... seriously I know that was long. A big thumbs up for anyone who actually read the whole thing and is still interested in helping.



Cheers!
TechandImprovement.zip
0Send private message
9 years ago
Sep 22, 2015, 9:59:59 AM
Tricky. I've only given this a cursory look-over so far.



I did find this: [code] [/code] in your technology definition. I'm pretty sure that it's not meant to be there. that means that your technology -is- also a city improvement, which is odd.



Bear with me, I'm spelling out the following partly for my own understanding here.



The heirachy of things should be as follows:

- The DepartmentOfScience+Constructibles[Era#Technology] entry defines the technology. This is what the simulation 'spends' science points on, and what checks for prerequisites. It has things as children within it in the following category that the game will use when the technology exists (is unlocked).

- The SimulationDescriptor[Technology] is usually blank, but is also used for technologies which have a direct effect on the simulation when they're unlocked. For example: increasing the max army size.



- The DepartmentOfIndustry+Constructibles[CityImprovement] entry is the building itself. This entry defines the cost and prerequisites for building the building. This is where your production gets 'spent' when you build something. It contains children of the following category, which affect the simulation when the building exists.

- The SimulationDescriptor[CityImprovement] entry exists on its own. This is what the improvement does in the simulation when it exists.



Each thing has a GUI element, but I'm ignoring those for now.



The link between technology and construction really is simple: it's the prerequisite check on the building, which determines whether or not it will show up in the available buildings list. Note the debug city improvement, which has no prerequisites other than the empire is tagged as "IAmCheater", and another one which doesn't let you build it twice.



I think what might be happening is that you've glitched out the tooltip system by giving the effects of the building to the technology. It's not applying to anything since your Technology can build no units (It has no production, nor even a production queue), and costs no upkeep to maintain.



Although now that I think about it, a technology which costs upkeep to maintain could be pretty cool...
0Send private message
9 years ago
Sep 22, 2015, 4:16:31 PM
Zen,



You are correct. I don't think that line of code is supposed to be in there either. Comparing it to the original game files none of them have that line.



Originally I didn't have it in there though and everything displayed the same except the "effects" entry was blank as well. So I don't think that entry is causing the problem. However what I noticed was putting that line in there made the "effects" of the improvement actually display on the technology tooltip. And I haven't done complete testing but I don't believe that entry actually creates the effect when the technology is researched (still need to test that but the upkeep didn't change when I finished research. The effect might have triggered... I don't know.) Actual research effects are listed elsewhere (simulation/SimulationDescriptor[Technology].xml) but who knows.



Reading through the modding tutorial manual I did find an entry on how to manually override the "effect" window of a technology so I can do that but I've been unable to find how to add entries such as "cost" or a 2nd improvement's sections.



And yes your understanding is my understanding of how technologies and improvements interact. Which is surprisingly little but makes sense from a game programming standpoint.
0Send private message
?

Click here to login

Reply
Comment