Play
Multi-Player
Coins
Community
Settings
Help
Community   Maps   Forum   Mail   Ladders   Clans   Recent Games
Sign In | Sign Up
<< Back to Programming Forum   

Posts 1 - 23 of 23   
Mods v0.04 are live! This is the big one!: 4/16/2017 03:44:10

Fizzer 
Level 58

WarLight Creator
Report
A new version of the mod framework is now live! This one adds hooks that allow mods to hook into the advance-turn algorithm.

This the big update we've all been waiting for that enables mods to do all sorts of fancy things with the game as it plays out. Mods now have full control over which players own what territories and how many armies are on them throughout the entire game. They can also modify or skip player's orders as the turn plays out, like modify how many attackers/defenders died in each attack, or whether not or each attack was successful, etc.

Some examples of what you can do:


  • Limited multi-attack
  • One way connections
  • Attacking/Defending from territory A to B deals more damage than the other way around.
  • Different kill rates in different regions on the map
  • The list is endless! But this list ends here.


To kick it off, I've made a mod I call the Safe Start mod that prevents players from attacking each other at the start of the game (10 turns is the default but it's configurable.) Here's the juicy bits, with comments:


function Server_AdvanceTurn_Order(game, order, result, skipThisOrder, addNewOrder)
	

    if (game.Game.NumberOfTurns < Mod.Settings.NumTurns  -- are we at the start of the game, within our defined range?  (without this check, we'd affect the entire game, not just the start)
		and order.proxyType == 'GameOrderAttackTransfer'  --is this an attack/transfer order?  (without this check, we'd stop deployments or cards)
		and result.IsAttack  --is it an attack? (without this check, transfers wouldn't be allowed within your own territory or to teammates)
		and not IsDestinationNeutral(game, order)) --is the destination owned by neutral? (without this check we'd stop people from attacking neutrals)
	then 

		skipThisOrder(WL.ModOrderControl.Skip); --skip it

	end

end

function IsDestinationNeutral(game, order)
	local terrID = order.To; --The order has "To" and "From" which are territory IDs
	local terrOwner = game.ServerGame.LatestTurnStanding.Territories[terrID].OwnerPlayerID; --LatestTurnStanding always shows the current state of the game.
	return terrOwner == WL.PlayerID.Neutral;
end



Full code is here: https://github.com/FizzerWL/ExampleMods/tree/master/SafeStartMod
Documentation for new hooks: https://www.warlight.net/wiki/Mod_Hooks
Documentation for mods, if you haven't been following their development: https://www.warlight.net/wiki/Mods

Let me know if you try it out!
Mods v0.04 are live! This is the big one!: 4/16/2017 03:48:16


TBest 
Level 59
Report
!Yes!

Let the awesomeness begin!
Mods v0.04 are live! This is the big one!: 4/16/2017 04:01:48


knyte 
Level 58
Report
:O So diplomacy mods are almost possible now.
Mods v0.04 are live! This is the big one!: 4/16/2017 04:12:21

Fizzer 
Level 58

WarLight Creator
Report
diplomacy mods are almost possible now.

We'll get there! But there are a few things missing, for example it's not yet possible for mods to save data from turn to turn, which you would need to remember who is allied with who. We also need mods to be able to present UI to allow you to propose and accept alliances.

But we're making progress towards all that stuff. The hardest parts are done.

Edited 4/16/2017 04:12:44
Mods v0.04 are live! This is the big one!: 4/16/2017 04:14:04


Clint Eastwood 
Level 59
Report
But are nuclear cards possible yet? And in-game currency? Those can both drastically help improve the fun of diplos, and they sound a lot simpler to me. But then again, I know nothing about programming.

Edited 4/16/2017 04:16:00
Mods v0.04 are live! This is the big one!: 4/16/2017 04:17:25


TBest 
Level 59
Report
^ " for example it's not yet possible for mods to save data from turn to turn, which you would need to remember "

@Clint
Mods v0.04 are live! This is the big one!: 4/16/2017 04:18:50


Clint Eastwood 
Level 59
Report
True. I guess that rules out the currency part of it.
Mods v0.04 are live! This is the big one!: 4/16/2017 04:26:45

Fizzer 
Level 58

WarLight Creator
Report
But are nuclear cards possible yet?

With the current implementation, you could re-purpose an existing card, like say the reconnaissance card, as a nuke card. The mod could detect wherever a recon card was played and damage armies there instead (and surrounding territories as well or whatever.)

Some day hopefully we'll have custom cards so re-purposing an existing card isn't necessary. Just taking things one step at a time.
Mods v0.04 are live! This is the big one!: 4/16/2017 07:39:39


Zephyrum 
Level 60
Report
This is glorious. A lot more is coming out of the hardcoded features than I even expected. Amazing work, Fizzer!
Mods v0.04 are live! This is the big one!: 4/16/2017 09:22:06


muddleszoom
Level 58
Report
Some day hopefully we'll have custom cards so re-purposing an existing card isn't necessary.

doesn't that mean as a non-member i could create a bomb card(as the bomb card is member only)

Edited 4/16/2017 09:22:38
Mods v0.04 are live! This is the big one!: 4/16/2017 09:32:07


muddleszoom
Level 58
Report
also could i create a mod that changes the in game settings mid game

Edited 4/16/2017 09:32:57
Mods v0.04 are live! This is the big one!: 4/16/2017 09:35:38

dabo1 
Level 55
Report
creating a mod that changes the settings mid game is already possible and very easy

Edit: Changing Settings once the game is started isn't possible tried it.

Edited 4/16/2017 11:40:13
Mods v0.04 are live! This is the big one!: 4/16/2017 10:14:45

melwei [PG] 
Level 56
Report
doesn't that mean as a non-member i could create a bomb card


Of course. But in the moment you can't include a mod into a game without being Premium Member - so a "Bomb Card Mod" is pretty useless...
Mods v0.04 are live! This is the big one!: 4/16/2017 10:36:39


muddleszoom
Level 58
Report
@melwi i only thinking forward for when non members can
Mods v0.04 are live! This is the big one!: 4/16/2017 12:03:45

dabo1 
Level 55
Report
the version has a fatal error, if you try to change the settings with a mod, a singleplayer game gets a multiplayer game. And singleplayer games aren't made to be multiplayer games which leads to many error.

Edit: The bug happens also if you don't change the settings but have a Server_Created hook

Edited 4/16/2017 12:11:10
Mods v0.04 are live! This is the big one!: 4/16/2017 18:02:29

dabo1 
Level 55
Report
I created now one of the suggested Mods: Limited Multiattacks, but I need a tester for it.

Description: Allows to limit the maximum number of attacks per multiattack
GameID: 13309830
GithubUrl: https://github.com/dabo123148/WarlightMod/tree/master/LimitedMultiattack
If the game is already in progress but you also want to try the mod, just mail me.

Edit: As I know now from the last stream, this Mod only works in Singelplayer

Edit2: Bug is fixed mod works fine

Edited 4/17/2017 12:33:45
Mods v0.04 are live! This is the big one!: 4/21/2017 21:09:06


ViralGoat 
Level 58
Report
the mods that I see in the list, are they all in development mode, or are they promoted mods? I think I am seeing all mods in development.

Do you guys see the same list? the one named "a" is one that I am playing with, doesn't do anything right now.



Edited 4/21/2017 21:09:36
Mods v0.04 are live! This is the big one!: 4/21/2017 21:11:06

Fizzer 
Level 58

WarLight Creator
Report
The mods page shows you all promoted mods + your mods. So if you didn't make it and you see it, it means it's promoted.
Mods v0.04 are live! This is the big one!: 4/27/2017 14:37:00

Domass 
Level 58
Report
:
We'll get there! But there are a few things missing, for example it's not yet possible for mods to save data from turn to turn, which you would need to remember who is allied with who. We also need mods to be able to present UI to allow you to propose and accept alliances.


Maybe I am misunderstanding you, but if UI cannot remember data from turn to turn, how does the sanctions and diplomacy card work?

Edited 4/27/2017 14:37:09
Mods v0.04 are live! This is the big one!: 4/27/2017 14:39:55


ViralGoat 
Level 58
Report
there is already in place a UI that show cards active and what player is diploed with you.
Mods v0.04 are live! This is the big one!: 4/27/2017 14:43:31


MightySpeck (a Koala) 
Level 58
Report
I think Fizzer got Uservoice bingo.
Mods v0.04 are live! This is the big one!: 4/27/2017 15:12:58


ps 
Level 60
Report
couple mod ideas that i'm wondering if they are now possible with this update:
- fogged neutrals have a more grey'ed out value of it's starting value (so you can spot wastelands without having to go back to first round in history)
- estimate visually where your opponent could be, to help you calculate their income, being able to click on a fogged territory and assign the player and estimated value, have those values remembered on history.
Mods v0.04 are live! This is the big one!: 4/27/2017 16:26:08


{Canidae} Kretoma
Level 57
Report
"Different kill rates in different regions on the map"

Fizzer, i am considering bying membership now.
Posts 1 - 23 of 23   

Contact | About WarLight | Play Risk Online | Multiplayer Strategy Game | Challenge Friends, Win Money | Skill Game | Terms of Service