<< Back to Programming Forum   Search

Posts 1 - 18 of 18   
Mods v0.05 are live!: 5/18/2017 00:57:57

Fizzer 
Level 64

Warzone Creator
Report
A new version of the mod framework was just released! This adds a bunch of new stuff mods can take advantage of:

1. Menu buttons. Mods can now subscribe to the Client_PresentMenuUI hook to get themselves a button on a game's menu. When the player clicks the button on the menu, the hook is invoked and a dialog can be shown on the screen.

2. New UI functions, UI.Alert and UI.PromptFromList let you show messages or ask questions of the player.

3. Mods can now read or write to the player's orders list on the client side. For example, a mod can create attacks or deploy orders or play cards for a player in their orders list. Of course, a player can always choose to delete, re-arrange, or otherwise manipulate those orders before committing. Mods can also read a game's entire history.

4. A new order, called GameOrderCustom, was added. By itself this order doesn't do anything, but mods can use it to send data up to the server. For example, client-side mod UI can create a custom order and place it the orders list, then the same mod can see that order server-side and take action.

5. Mods can now destroy UI they previously created by calling UI.Destroy() and passing a UI element.

I have written a new example mod to show off these new capabilities, the gift armies mod! This mod allows you to give armies to another player. You specify the territory you'd like to take armies from, who you want to give armies to, and when the turn advances it moves those armies to random territories belonging to the target player. Here's the code: https://github.com/FizzerWL/ExampleMods/tree/master/GiftArmiesMod


Here's the rest of the changelog for today's update:

- If a mod puts a special unit owned by one player onto a territory owned by another, it no longer gives errors and the information tooltip now shows the owner. It also won't show the special unit as movable in the attack/transfer dialog to the territory owner.
- The multi-player page's membership gift now advertises Unity+mods.
- Added the mod function UI.PromptFromList to allow mods to ask the player to select an item out of a list of choices.
- Added the mod function UI.Alert so that mods can pop up simple messages.
- Fixed a bug with mods that made GameOrderPlayCard instances not return card-specific data. Thanks to TBest for reporting this.
- Fixed a bug with mods that caused an error when a mod hooked StartGame and the game was started by the host removing a player.
- Fixed a bug with mods that made the Armies.Add and Armies.Subtract functions not callable.
- Fixed a bug that could cause an error in multi-attack games with commanders. Thanks to kevin#1 for reporting this.
- Fixed a bug that caused an error if a multi-player game advanced to the next turn just as you were loading it.
Mods v0.05 are live!: 5/18/2017 03:31:05


ViralGoat 
Level 60
Report
are diplo treaties possible with this update?
Mods v0.05 are live!: 5/18/2017 05:49:08


dabo1
Level 57
Report
Yes they are or at least they should.

Edit: not so sure any longer, I guess it isn't possible to open the history on server site.

Edited 5/18/2017 06:20:23
Mods v0.05 are live!: 5/18/2017 06:08:23


master of desaster 
Level 66
Report
So many cool things happening right now on warlight! Absolutely exciting
Mods v0.05 are live!: 5/18/2017 06:16:08


dabo1
Level 57
Report
I haven't found a way to get the older orders on the server. Is there no way or how does it work.
Mods v0.05 are live!: 5/18/2017 07:13:26


TBest 
Level 60
Report
are diplo treaties possible with this update?

YES! In fact I have alredy made one :) I was just waiting for this release (bugfix)
- Fixed a bug with mods that made GameOrderPlayCard instances not return card-specific data. Thanks to TBest for reporting this.


Since I use cards to store value over time/turns! This works similar to other current mods, where you do things by playing cards!

Not sure if I should look into menu etc. Or just release the first working diplo mod ;) Just going to test it a bit more, but things seems to be working perfectly!

Edited 5/18/2017 07:14:51
Mods v0.05 are live!: 5/18/2017 07:15:35


dabo1
Level 57
Report
Yes, I already saw your mod, but your mod has one disadvantage. War stops at some point cause the card stops.
Mods v0.05 are live!: 5/18/2017 07:19:50


TBest 
Level 60
Report
Indeed. I have a few easy fixes coming ;) Right now war is global too (one player declares war,everyone can attack that guy (at least in SP) xD)
Yes, I already saw your mod, but your mod has one disadvantage. War stops at some point cause the card stops.

I used the same 'check' that Fizzer has in his example mod. So the Mod has a cap until the game turns into an FFA, thus a game will never be stuck

Edited 5/18/2017 07:27:41
Mods v0.05 are live!: 5/18/2017 07:27:01


dabo1
Level 57
Report
has your mod an ally system(Don't want to read your code and search the features my own).

Edit: OK there is no ally system.

Edit: Is it actually possible to remove active cards. Else your system can't handle peace offers.

Edited 5/18/2017 07:30:50
Mods v0.05 are live!: 5/18/2017 07:29:21


TBest 
Level 60
Report
Nope. In short I took Fizzer's mod (safe start), and added a way to declare war by playing a spy card. I am working on the mod now, so hope to get in finalized soon :D

@Edit xD dabo1, it called simpleDiploMod for a reason ;) But no, you can't remove active cards. Hm, through I can see ways you can work around it. Like playing a diplo card. Hm, wait, I don't even know how diplo cards work with mods my mod :O

Well, give me the day and then see what I end up with :P But it is exciting times for sure!

Edited 5/18/2017 07:37:59
Mods v0.05 are live!: 5/18/2017 07:48:14


dabo1
Level 57
Report
Good luck.
Mods v0.05 are live!: 5/18/2017 08:18:41


dabo1
Level 57
Report
@Fizzer I guess you forgot to promote your Gift Armies Mod

@TBest the slider init isn't between the slider range.

Edited 5/18/2017 08:35:00
Mods v0.05 are live!: 5/18/2017 09:05:42


ps 
Level 61
Report
anyone do a mod to detect patterns of deployment and moving armies on local deployment games to auto-deploy and auto-transfer those for you on next turns? would bring new life to local deployment games, especially for large maps.

Edited 5/18/2017 09:09:56
Mods v0.05 are live!: 5/18/2017 09:31:58


dabo1
Level 57
Report
I guess that Auto Transfer would be to recource consuming. But something like copy the last orders would be possible.

Edited 5/18/2017 11:24:47
Mods v0.05 are live!: 5/18/2017 19:11:09

melwei [PG]
Level 57
Report
Wow! Finally Mods can create User Interface!
This opens a whole new world of possibilities...

anyone do a mod to detect patterns of deployment and moving armies on local deployment games to auto-deploy and auto-transfer those for you on next turns? would bring new life to local deployment games, especially for large maps.


I'm probably going to try this. I won't be able to create the Mod this weekend since I am on a workshop, but after this I will try to create such a Mod.
Mods v0.05 are live!: 5/20/2017 16:57:26


dabo1
Level 57
Report
Little question. Is there a way to see the current income a player has without letting a mod calculate it?
Mods v0.05 are live!: 5/20/2017 17:22:57

Fizzer 
Level 64

Warzone Creator
Report
Is there a way to see the current income a player has without letting a mod calculate it?

Not currently, but I'll add this in the next mods update.
Mods v0.05 are live!: 5/20/2017 17:40:08


dabo1
Level 57
Report
Not currently, but I'll add this in the next mods update.


Ok, then I better wait instead of implementing it myself.
Posts 1 - 18 of 18