Editing Custom Techs

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Editing Custom Techs

beelee
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?
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

panguitch
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.

Greyhawk Wars
TripleA in the original Dungeons & Dragons world

Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

Veqryn
Administrator
use "User Actions" for this.  there are plenty of ways to do it with user actions, and you do not necessarily need a 'choice tech' to do it.


also, for anyone using custom techs, please stay away from "shipyards" tech, and turn shipyards tech off in the game options.
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

beelee
In reply to this post by panguitch
HI panguitch
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:

RDs 1-3
super subs
war bonds
increased factory
conscription
improved artillery
improved mech infantry

RDs4-6
radar
long range air
paratroopers
sonar
choice
shipyard

RDs7-11
choice1
choice2
heavy bomber
rockets
jet power
heavy tank

A-Bomb1
choice3
choice4
choice5
A-Bomb
A-Bomb
A-Bomb

ICBM1
ICBM
ICBM
ICBM
ICBM
ICBM
ICBM

Improved mech Infantries
improved mech
improved mech
improved mech
improved mech
improved mech
improved mech

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?

Thanks a Bunch panguitch!

Cool I'll give it a shot. Thanks Veqryn!
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

panguitch
OK, they get the choice tech by roll or start with it. Condition to verify they have it:

                        <attatchment name="conditionAttatchmentPlayerX_Has_Choice" attatchTo="PlayerX" javaClass="games.strategy.triplea.attatchments.RulesAttachment" type="player">
                                        <option name="techs" value="choice" count="1"/>
                        </attatchment>

Then create a series of user actions and the triggers they flip:

                        <attatchment name="triggerAttachmentPlayerX_Chooses_TechY" attatchTo="PlayerX" javaClass="games.strategy.triplea.attatchments.TriggerAttachment" type="player">
                                <option name="tech" value="TechY"/>
                                <option name="tech" value="-choice"/>
                        </attatchment>               

                        <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>       

Repeat for every tech they can choose from. When they choose a tech, they get it, and lose the choice tech, so the other options disappear.

Greyhawk Wars
TripleA in the original Dungeons & Dragons world

Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

beelee
Cool Beans!

Time to start typing! Thanks again panguitch!
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

beelee
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 :)

ww2global40_2nd_edition_A-Bomb_Ship.xml
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

panguitch
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.

Greyhawk Wars
TripleA in the original Dungeons & Dragons world

Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

beelee
This post was updated on .
So if I had already rolled and got a tech then got choice could I make it so it would still work even though it already had one of the techs?

If I did

<attatchment name="conditionAttatchmentPlayerX_Has_Choice" attatchTo="PlayerX" javaClass="games.strategy.triplea.attatchments.RulesAttachment" type="player">
                                        <option name="techs" value="choice" count="1"/>
                        </attatchment

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"/>
                             
                        </attatchment>   
 
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.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

panguitch
It's a separate user action for each option.

Create inverted conditions to verify that the player doesn't already have the techs. The user actions are available if the choice condition AND the inverted other tech conditions are met.

Once one of the other techs is gained, the group of conditions is no longer fully met and all the remaining user actions disappear.

But yeah if it's possible the player has already obtained one of the techs, then that messes it all up.

Greyhawk Wars
TripleA in the original Dungeons & Dragons world

Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

beelee
well... I guess it's back to the drawing board :)

I got the user action to pop up though and it selected the tech. That was pretty cool!
Thanks again man!
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

Navalland
what is conscription ?
Reply | Threaded
Open this post in threaded view
|

Re: Editing Custom Techs

beelee
just a custom tech that gives you 2 free infantry in your capital every turn