<< Back to Programming Forum   Search

Posts 1 - 2 of 2   
Few questions about modding: 2022-04-25 20:41:13


Bring * back! ⌛sucks! 
Level 62
Report
I am trying to create new cards.

1) Is it possible to just add a custom card in the game? Not modify an existing one into doing something different.
-> if not, I want to create an order which happens at the end of the turn, is carried by player A, happens on territory B, has custom description and is visible to you if and only if you can see the territory. I would use this for example to inform opponents about failed attempt to build a fort.

2) I need a way how to safely store data in the mod. For example to copy player's orders. Is there a way how to store data in such a way that
a) Mod can read them from almost every function
b) No player can read them, even using inspect page or user script magic.

3a) Now the fun part. I need to pass data between mods. Is there a convenient global variable mods could read/ write into?
-> if not, is there a safe way how to pass data between mods (for example via modifying orders where mod A read all data about order created by mod B).
-> if yes, is the way safe (no player can read the data)?
-> if not, is there a way which is reasonably safe (for example in the planning stage, you can see only your orders, so you would see data about you, but data about opponents would be transferred in their orders making them invisible to you (if it is how it works))
3b) Do I have guaranteed, that the order of mods is consistent (every hook will be used by mods in non-changing order).

Edited 4/25/2022 20:42:45
Few questions about modding: 2022-04-25 21:06:53


JK_3 
Level 63
Report
1) You cant make a card like a WZ card, but you can do something with custom UI elements from the mod menu (Client_PresentMenuUI). You might have to use Client_GameRefresh to pop up a message to the players when they can use the card, otherwise they might not check the mod menu.

2) PrivateGameData object

3a) No, no way to pass data between mods. TBest and/or Dutchman probably already tried this, so you would have to ask them. So far the only way to do this, is by having each mod add CustomGameOrder, and having the mod on the other side parse all the orders

3b) Nope, make sure your mod is compatible with any combination of other mods enabled, or just accept that it crashes from time to time.

Edited 4/26/2022 21:44:24
Posts 1 - 2 of 2