Skip to content

Commit

Permalink
Release: M2TWEOP-3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnTW committed Jun 9, 2024
1 parent 4a5d412 commit 1f7ee17
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 5 deletions.
2 changes: 1 addition & 1 deletion M2TWEOP Code/M2TWEOP Common/m2tweopConstData.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
namespace eopConstData
{
const char eopVersionName[] = "M2TWEOP-3.2.0";
const char eopVersionName[] = "M2TWEOP-3.3.0";
}
16 changes: 16 additions & 0 deletions M2TWEOP-luaPlugin/luaPlugin/gameHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ namespace gameHelpers
return region->forts[index];
}

campaignDb* getCampaignDb()
{
DWORD offset = 0x0161E7E4;
if (m2tweopHelpers::getGameVersion() == 1)
offset = 0x16666BC;
return reinterpret_cast<campaignDb*>(offset);
}

campaignDbExtra* getCampaignDbExtra()
{
DWORD offset = 0x0186170C;
if (m2tweopHelpers::getGameVersion() == 1)
offset = 0x18AA87C;
return reinterpret_cast<campaignDbExtra*>(offset);
}

watchTowerStruct* gameHelpers::getWatchtower(const regionStruct* region, const int index)
{
return region->watchtowers[index];
Expand Down
2 changes: 2 additions & 0 deletions M2TWEOP-luaPlugin/luaPlugin/gameHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ namespace gameHelpers
coordPair* convertTileCoords(DWORD arrayIndex);
int getTileX(const oneTile* tile);
int getTileY(const oneTile* tile);
campaignDbExtra* getCampaignDbExtra();
campaignDb* getCampaignDb();
seaConnectedRegion* getSeaConnectedRegion(const regionStruct* region, const int index);
seaConnectedRegion* getSeaImportRegion(const regionStruct* region, const int index);
oneTile* getRegionSeaEdge(const regionStruct* region, const int index);
Expand Down
18 changes: 18 additions & 0 deletions M2TWEOP-luaPlugin/luaPlugin/luaP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ sol::state* luaP::init(std::string& luaFilePath, std::string& modPath)
@tfield setConversionLvlFromCity setConversionLvlFromCity
@tfield loadGame loadGame
@tfield logGame logGame
@tfield getCampaignDb getCampaignDb
@tfield getCampaignDbExtra getCampaignDbExtra
@table M2TWEOP
*/

Expand Down Expand Up @@ -680,6 +682,22 @@ sol::state* luaP::init(std::string& luaFilePath, std::string& modPath)
*/
tables.M2TWEOPTable.set_function("getCampaignDifficulty2", &m2tweopHelpers::getCampaignDifficulty2);
/***
Get the campaign options.
@function M2TWEOP.getCampaignDb
@treturn campaignDb options
@usage
local options = M2TWEOP.getCampaignDb();
*/
tables.M2TWEOPTable.set_function("getCampaignDb", &gameHelpers::getCampaignDb);
/***
Get the campaign options.
@function M2TWEOP.getCampaignDbExtra
@treturn campaignDbExtra options
@usage
local options = M2TWEOP.getCampaignDbExtra();
*/
tables.M2TWEOPTable.set_function("getCampaignDbExtra", &gameHelpers::getCampaignDbExtra);
/***
Check game condition.
@function M2TWEOP.condition
@tparam string condition
Expand Down
55 changes: 51 additions & 4 deletions documentationGenerator/releaseInfo/releaseDescription.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,70 @@
[![Build Status](https://img.shields.io/github/v/release/youneuoy/M2TWEOP-library?label=Download&style=for-the-badge)](#download)

## **Release Notes**
***NOTE : NOT SAVEGAME COMPATIBLE!!!!***

<!-- ### **Launcher** -->

<!-- ### **Library** -->

(all changes by Fynn)
### **Library**
- Increased culture limit to 31. NOTE: the 8th culture (index 7) is NOT valid and you need to place a dummy culture there you won't actually use.
- Do not use cultures over limit in offmap_models file, event_bodies and sound files.
- Added ability to use EOP units in custom battle.
- Added ability to use EOP units in game files like export_descr_buildings, descr_strat, descr_rebel_factions etc
- Can spawn EOP units by name instead of index. (Both this and using in game files only works for file-added EOP units)
- EOP unit type names need to be unique now.
- Fixed maintain option for siegeSettlement/siegeFort.
- Fixed "random_name" in spawnArmy
- Fixed armies not attacking in sieges with Elephants in their army.
- Fixed elephant artillery not attacking gates.
- Fixed crashes relating to EOP mercenaries.


### **Lua Plugin**
- [Added new `mapImage` struct](https://youneuoy.github.io/M2TWEOP-library/_static/LuaLib/index.html#mapImage)
- Enables users to render their own versions of the campaign strategy map
- Includes options for filling certain tiles and regions with color and blurring options for smoothing out jagged lines
- Expanded `coords` to `xCoord` and `yCoord` in the `tileStruct`
- Added all the unit actions that were possible to execute in campaign_script, and expanded the unit struct.
- Added get unit by label
- Added 2 extra unit functions: Attack building and collect engine.
- Added unit groups, getting group by label, defining groups, and every script function relating to groups.
- Added siegeEngine struct and ability to get all engines in battle or get the engine a unit is carrying.
- Fixed checking if unit/eduEntry has an attribute.
- Added creating watchtowers.
- Added all character stratmap actions, diplomacy, spying, assassination, blockading, sabotage etc
- Added ability to split armies, disembark and embark on ships.
- Added ability to merge by movement instead of by teleportation.
- Added new functions to switch a characters or fort faction, and added option to convert the settlement garrison when switching a settlement's faction.
- Added loading saves.
- Added function to log something to game log (flushes log immediately).
- Expanded EDU entry struct, and added ability to get localized name, description.
- CreateFortXY does not cost money any more, and both fort construction functions now will always work even if you have buildable forts off.
- Expanded `coords` to `xCoord` and `yCoord` in the `tileStruct` and added many new fields.
- Added `aiFaction` to `factionStruct`
- Fixed `battleBuilding:getBuilding()` returning the wrong thing
- Fixed a bug where right clicking an EOP unit in the building description would do nothing
- Added ability to get the character/settlement/fort the cursor is hovering over.
- Added getting merc pool by name.
- Added global roads db to campaign struct.
- Fixed setting diplomatic stances and getting them.
- Added sending characters off map through lua.
- Added ability to get various info on the battlemap, like height at any point, street deployment positions, hill positions, terrain lines, zones etc.
- Added get culture/climate id by name, and getting their name by id.
- Added recruitment queue info
- Added ability to check all the available construction/recruitment items in a settlement and add them to the queue.
- Added ability to see which unit/building is being looked at in the info scroll.
- Added all the options from the campaign DB.
- Many new fields in many structs.


### **ImGUI**
- Added all the drawList functions to draw stuff on the screen.
- Added optional extra parameters to image to draw only parts of it.

<!--### **ImGUI** -->
NOT SAVEGAME COMPATIBLE!!!!

### **Documentation**
<!--### **Documentation**-->

### **Links**
- [Known Bugs](https://github.com/youneuoy/M2TWEOP-library/issues/71)
Expand Down

0 comments on commit 1f7ee17

Please # to comment.