Use these as you like. I'm not confident enough in my programming abilities to commit them to Stratagus so I'll spam the forums instead.
Patch name: checkdependencies.txt
Description:
Check if dependencies are met. Returns true if they are and false if not.
Usage:
CheckDependency(player, object)
Example:
CheckDependency(AiPlayer(), "upgrade-dwarves-level2")
Patch name: formations.txt
Description:
The functionality to change what commands do, a.k.a. the formation system. I've included a full example of its usage in the documentation. Also includes the function GetSelection() which creates a table with the ID's of units we have selected. For multiple formations, you are also going to need the patch buttonluacall.txt.
Usage:
See the documentation.
Example:
See the documentation.
Patch name: buttonluacall.txt
Description:
Call a LUA function when a button is pressed.
Usage:
In DefineButton,
Action = "call-function", Value = "LuaFunctionToBeCalled",
Example:
function FormationBoxFormation ()
formation = 1
end
DefineButton( { Pos = 11, Level = 0, Icon = "boxformation",
Action = "call-function", Value = "FormationBoxFormation",
Key = "c", Hint = _("BOX FORMATION"),
ForUnit = {"*"} } )
Patches for Stratagus 2.2.7
- Mikko Merikivi
- Posts: 18
- Joined: Fri Sep 13, 2013 9:04 pm
Patches for Stratagus 2.2.7
- Attachments
-
checkdependencies.txt
- Check if dependencies are met. Returns true if they are and false if not.
- (2.47 KiB) Downloaded 704 times
-
formations.txt
- The formations patch for Stratagus 2.2.7
- (19.48 KiB) Downloaded 667 times
-
buttonluacall.txt
- Call a LUA function when a button is pressed.
- (3.15 KiB) Downloaded 668 times
Last edited by Mikko Merikivi on Sat Oct 19, 2013 4:42 pm, edited 4 times in total.
Re: Patches for Stratagus 2.2.7
applied (with some modification) the dependencies patch in rev.8832
You better to add them into launchpad next time, they risk to be lost in the forum...
thanks, by the way
You better to add them into launchpad next time, they risk to be lost in the forum...
thanks, by the way
- Mikko Merikivi
- Posts: 18
- Joined: Fri Sep 13, 2013 9:04 pm
Re: Patches for Stratagus 2.2.7
Is there a "patches" tab somewhere or are you suggesting I commit them directly to the version control system? Because I wouldn't trust my code to be any good.jarod42 wrote:applied (with some modification) the dependencies patch in rev.8832
You better to add them into launchpad next time, they risk to be lost in the forum...
thanks, by the way
Also, the buttonluacall patch was added. It's hastily coded since as was told in the Customizable button functions thread, a functionality to do so already exists in the trunk version of Stratagus. However, in my opinion the solution sounded like a very convoluted way of calling a function when a button is pressed so I made this patch nevertheless. If it becomes redundant in the future versions of Stratagus, it won't be a big deal to me that way.
Re: Patches for Stratagus 2.2.7
Have faith, Jarod!
04:27 jim4 why haven't you added wc1 support? this project sucks. i'm only going to use freecraft
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
05:06 jim4 finished wc1 support yet? i've been waiting for 6 years
05:10 jim4 new things scare me
Re: Patches for Stratagus 2.2.7
The functionality to change what commands do, a.k.a. the formation system. I've included a full example of its usage in the documentation. Also includes the function GetSelection() which creates a table with the ID's of units we have selected. For multiple formations, you are also going to need the patch buttonluacall.txt.