Making RISK within TripleA - Help Requested
-
@thedog Thank you. I did find another example of this in "Pact of Steel" and applied it as desired. (I still need to confirm it's working, but based on what you posted it should work.)
-
@TheDog I'm struggling to get the victory notifications to work. I'm not sure what I'm doing wrong.
-
I think you might have to post an extract of the code
Use the </> button to encapsulate the text to make it code. -
@thedog Here's the GitHub repository. The branch I'm working on is "0.1.0".
https://github.com/SlendyMcTendies/ww2_risk_of_defeat/tree/0.1.0
You're going to see a lot of different "Victory" Condition/Notification code commented out because I was trying everything I could think of.
-
Remove the comments from 6220-6224 as that is required for any trigger code.
Line 6258 needs to be trueLine 6236 might need to be true depending on the code you use
Try that for now.
To get the code working around 6229-6234 you need to remove the comments that are required to make it work at line 1364 to 1378, but I think you have worked that out.
-
@thedog Yup. That worked. Idk how I didn't put that together. Thank you very much!
-
I want to limit the number of times players can perform Political Actions per turn. I've noticed that people can offer alliances, then immediately turn around on those alliances, as well as every other Political Action.
The solution I have in mind is adding a new resource, which I'm calling "Influence Tokens", but I only want the players to have a specific number Influence they can use each turn. Right now I'm thinking 3, and I only want players to have 3 Influence Tokens to use each turn, regardless of how many they used on the previous turn.
How would I implement this?
I looked through the reference material everyone has suggested to me very hard, but I still can't quite find a solution.
-
@slendymctendies Hmm ... yea I don't really know, but you might look at using "chance" with a condition that requires the "token" to be present in a certain territory
-
@slendymctendies
It is human nature to spend something that is free, Influence, especially when is given free every turn.In the Shogun I choose for some Political actions to cost 5pu, this is the cost of the cheapest unit, so maybe you could consider the same.
As in life the wealthier you are, the more influence you can try to exert by spending/giving it.
.
But, to answer your question.
Create a Resource called Influence under <resourceList> heading
<resourceList>
<resource name="PUs"/>
<resource name="Influence"/>Also need an icon called Influence.png 20x20px in \resources folder
Remove unspent Influence at the end of the turn, this will be a Trigger before:endRoundStep for each player.
Make the player to spend Influence for each Political action like
<option name="costResources" value="1:Influence"/>
see The Shogun for something similar. -
@beelee Managed to get something like I wanted working. Should be good enough:
<attachment name="conditionAttachment_GermansExist" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <!--Do Germans Exits?--> <option name="directOwnershipTerritories" count="0-+"/> </attachment> <attachment name="triggerAttachment_InfluenceRegenerate_Germans" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="trigger" value="conditionAttachment_GermansExist"/> <option name="when" value="after:germansPlace"/> <!--fire when Placement Phase ends--> <option name="resource" value="Influence"/> <!--What resource to modify?--> <option name="resourceCount" value="1"/> <!--How many given?--> </attachment>
This essentially a "dummy" condition which will always be true, and will therefore always fire the trigger.
On a separate note, I see a property tag called "Honorable Surrender". What does it do?
I ask partially because after playing a few test games with my friends, I've noticed that there isn't an option to "surrender" or otherwise leave a game without making everyone go to the pre-game screen. Is there a way for people to leave the game without it doing that?
-
@thedog I don't know how I didn't see your post sooner, but yes I ultimately came to this conclusion and accomplished it like so:
<attachment name="conditionAttachment_GermansExist" attachTo="Germans" javaClass="games.strategy.triplea.attachments.RulesAttachment" type="player"> <option name="directOwnershipTerritories" count="0-+"/> <option name="rounds" value="2-+"/> <!--Wait until after the first turn--> </attachment> <attachment name="triggerAttachment_InfluenceReset_Germans" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="trigger" value="conditionAttachment_GermansExist"/> <option name="when" value="after:germansPurchase"/> <!--fire after Purchase Phase, which is just in time for the Politics phase--> <option name="resource" value="Influence"/> <!--Target Influence Resource--> <option name="resourceCount" value="3"/> <!--Give 3 Influence--> </attachment> <attachment name="triggerAttachment_InfluenceDrain_Germans" attachTo="Germans" javaClass="games.strategy.triplea.attachments.TriggerAttachment" type="player"> <option name="trigger" value="conditionAttachment_GermansExist"/> <option name="when" value="after:germansPlace"/> <!--fire after Place Phase, which is effectively the end of the turn--> <option name="resource" value="Influence"/> <!--Target Influence Resource--> <option name="resourceCount" value="-3"/> <!--Remove 3 Influence (total Influence value cannot be negative, therefore it will always become 0)--> </attachment>
I set War Declarations to cost 1 Influence, offering Ceasefires (only available when at war) cost 2 Influence, and Offering an Alliance or Breaking an Alliance costs 3 Influence.
The thought process behind these costs is "War is easy, Peace is not". Plus, it makes people think harder about who they ally with since you can only make one offer per turn, and you can't go straight into War with someone you were just Allied with.
-
Interesting, I like it and your logic.
-
@SlendyMcTendies I am not on much anymore but good luck. I would recommend you ask @LaFayette and @Cernel about previous work they have done in the past on a map from a few years ago.
-
@prastle Thank you! I've actually gotten the map to the point where it's near complete. The only thing left is playtesting for bugs and errors I've missed and general balancing. I just recently made a post sharing the github link to the map/game.
-
@slendymctendies said in Making RISK within TripleA - Help Requested:
On a separate note, I see a property tag called "Honorable Surrender". What does it do?
I ask partially because after playing a few test games with my friends, I've noticed that there isn't an option to "surrender" or otherwise leave a game without making everyone go to the pre-game screen. Is there a way for people to leave the game without it doing that?So you want some players able to surrender and allow others to keep playing ?
There's probably a better way to do it, but maybe just set the surrendered player to neutral ?
-
@beelee Well that's the thing, I don't know how to have a player actually "surrender". The only option we can find is simply leaving the game which kicks everyone to the pre-game lobby. That's why I'm asking what the "Honorable Surrender" property does and how it's supposed to work.
<property name="Honorable Surrender" value="false" editable="false"> <boolean/> </property>
Yes, I know it's set to "false" in this example but it doesn't do anything even when it's "true". Do I have to write a surrender system for this to work?
-
@slendymctendies Honorable surrender reflects the number of VC cities that need to be held before the game is considered completed. There are other 'surrender' levels that require more VC cities to be captured.
To have a player legitimately surrender would need to be a new feature. Converting all units to neutral would probably be straight forward, a bit more complicated to think of the mixed unit cases where the surrendering player had units in a shared territory.
-
@lafayette Hmm. Ok. I already have an automated "Victory" system which seems to accomplish the same thing.
I'll probably write a surrender system into the game. I have a few ideas on how it could be accomplished.