jelloWorld
Chieftain
- Joined
- Apr 17, 2016
- Messages
- 3
Hi everyone,
I'm trying to get started with LUA mods but I can't seem to get a simple mod I made to work. Here is what I've done so far:
1. Used ModBuddy to create a new Project named My New Mod
2. Created a folder in the solution of My New Mod named lua
3. Created a file named "My New Mod.lua" in the lua folder of the solution
4. Changed solution>properties>content with the following addition:
Type: InGameUIAddin, Name: My New Mod.lua, Description: , File Name: lua/My New Mod.lua
5. Edited My New Mod.lua to contain the following simple code:
6. Saved the solution and built with ModBuddy
7. Ran a new game with My New Mod enabled
However, nothing happens when the game starts and the turns progress. My intention was to make a simple mod that set my gold to 3007 and faith to 1337 every turn; in my tests I would be the only human player involved. Eventually I planned to make a mod to do a lot more than that (which involved an actual use for cycling through every player), but I decided to start small.
I've used Firetuner to test its functionality, and running the code in a button on Firetuner successfully executed the code for one turn, but not for every turn as I intended.
Thanks for reading all of this, I appreciate any help I can get.
I'm trying to get started with LUA mods but I can't seem to get a simple mod I made to work. Here is what I've done so far:
1. Used ModBuddy to create a new Project named My New Mod
2. Created a folder in the solution of My New Mod named lua
3. Created a file named "My New Mod.lua" in the lua folder of the solution
4. Changed solution>properties>content with the following addition:
Type: InGameUIAddin, Name: My New Mod.lua, Description: , File Name: lua/My New Mod.lua
5. Edited My New Mod.lua to contain the following simple code:
Code:
GameEvents.PlayerDoTurn.Add(
function(iPlayer)
local pPlayer = Players[iPlayer];
if (pPlayer:IsAlive() and pPlayer:IsHuman()) then
print("Function call success for My new Mod");
pPlayer:SetGold(3007);
pPlayer:SetFaith(1337);
end
end
)
6. Saved the solution and built with ModBuddy
7. Ran a new game with My New Mod enabled
However, nothing happens when the game starts and the turns progress. My intention was to make a simple mod that set my gold to 3007 and faith to 1337 every turn; in my tests I would be the only human player involved. Eventually I planned to make a mod to do a lot more than that (which involved an actual use for cycling through every player), but I decided to start small.
I've used Firetuner to test its functionality, and running the code in a button on Firetuner successfully executed the code for one turn, but not for every turn as I intended.
Thanks for reading all of this, I appreciate any help I can get.