I added some custom techs to the Global game. One of them is "choice" which does nothing. It's purpose is to allow the player to pick a tech using edit.
There are separate production frontiers for players so I customized the shipyards tech. If I edit a tech and then edit shipyard it works fine. If I roll for a tech and then edit the custom shipyard tech it doesn't work. I checked the other custom techs I made and the pre existing improved mech infantry tech and they all worked except the mech infantry which behaved the same as the shipyard tech.
I was thinking of making separate tech categories for both shipyard and improved mech in addition to where they normally are.
If a player got choice they would then have to save the game at the start of their turn and roll until they got the desired tech.
A little sloppy and probably won't be needed all the time, but has anyone encountered this and if so do you have a better solution?
Instead of edit, what about starting everyone with the choice tech? Then have a series of user actions, one for each tech they can choose. All those actions are available as long as a player has the choice tech. Once the player chooses one, it gives them that tech, and removes the choice tech, so the other choices no longer appear.
Not quite following that but I don't think that's quite what I'm trying to do. I want choice to be rolled for the same as the other techs. If you get it then you get to pick one. Also choice is listed more than once. The tech tree looks like this:
improved mech infantry
long range air
So if you got choice you could have that connected to all the other techs? And have choice connected to "a series of user actions" that would then activate it. I'm not quite sure how to go about connecting a tech to a user action. That sounds like it would work though.
I added the last category so yo could target it specifically if you got choice. It worked ok. Then I went to do it with the shipyard tech and it said it must be unique to the document and the tech name had to match the category. Don't why that is. Anyway your idea would be way better if I didn't have to use edit at all.
Could you give me an example on how I might word it?
I started with one player and gave them one tech however it says it can't find the "-choice" tech for the trigger it's in. I know when I had that problem with the boats it was because I didn't have the right capitalization. I double checked and everything seems ok.
Line 5322 is what I added if you don't mind taking a look. Also I threw the text into the politics properties and .button= Accept
I assume that makes it show up on the screen and then you would just click it to accept. Wasn't able to see if it worked.
Anyway appreciate your help. Hope I'm not bugg'in ya too much :)
Hmm, perhaps you can't remove a tech the way you can remove a support attachment or production rule. I guess it probably would be complicated given all the things techs are connected to.
So my original suggestion won't work, sorry.
But if you can't remove the Choice tech to disable the other options, you could set up negative conditions, so that you only get the options if you have the choice tech and don't have any of the free techs. Then when you pick one, it's negative condition is no longer true and the options all disappear.
By the way, it's not the politics file. You need to create a actionstext.properties file for user actions.
Then did one of these for each tech
<attatchment name="triggerAttachmentPlayerX_Chooses_TechY" attatchTo="PlayerX" javaClass="games.strategy.triplea.attatchments.TriggerAttachment" type="player"> <option name="tech" value="TechY"/>
Then did this again
<attatchment name="userActionAttachmentPlayerX_Chooses_TechY" attatchTo="PlayerX" javaClass="games.strategy.triplea.attatchments.UserActionAttachment" type="player"> <option name="conditions" value="conditionAttatchmentPlayerX_Has_Choice"/> <option name="activateTrigger" value="triggerAttachmentPlayerX_Chooses_TechY:1:false:false:false:false"/> <option name="text" value="PLAYERX_CHOOSES_TECHY"/> <option name="attemptsPerTurn" value="1"/> </attatchment>
When I got choice the text in the useractions would ask to accept for each one? Then if I accept the one I want and no to all the rest would that work?
It would probably keep asking me every turn though. I'm not sure if you can get rid of techs or not. The edit button doesn't work I know. Maybe I could have attemptsPerTurn set to uses at 1 and it would only ask me once?
Yea that didn't work. Just reread POS2 and uses won't work.
I guess, amongst other things, I don't know how to make it ignore a tech it already has and still work. Well I'll beat my head against it some more and see what happens.