I am looking at the .lua files and I want to see where the functions are called. There must be a code where these scripts are called. Is it hidden?
I am looking at the .lua files and I want to see where the functions are called. There must be a code where these scripts are called. Is it hidden?
The functions in the lua files aren't explicitly called, they are all executed when the game loads the lua file.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
Hmmm.. How about the functions about battle manager? Say, battle manager unit watch, distance-type etc calculator?
There seems to be a VAST amount of potential for modding if we can make use of those. We might even tweak how AI manages the battles itself. Am I flying high here?
I don't know about Battle Manager, I haven't started working with scripts in S2 yet. As far as battle scripts go for NTW, I never touched them. They are far to complex (not in understanding, just in practical useage) for any changes to be worthwhile.
There is a massive amount of things that can be done with scripting if you apply yourself, though I really recommend you stick with campaign scripts. For an example of what can be done, look at EiC for NTW (in my sig). I've scripted a disease mechanism, a feature that ties diplomacy into buildings and another one that allows recruitment of units from allied nations. And then I've got loads of smaller scripts working that do stuff like stopping the allied backstabbing - eg if you and an ally are at war with France (as that is really the setting of NTW) the ally won't declare war with you. But obviously it can if you are not at war with France.
So what's your understanding of Lua like? If you are good with it I can get you some information on scripting I've gathered.
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell
I don't know if I am good, but I am capable of going through complex stuff and I am quite willing.
In MTW2, there was ways to check out certain parameters during the battle. And there was this battle script thing. If we can utilize fundamental coding techniques like 'if-else-then', 'do-while', for-next etc., it would be awesome.
I wouldn't mind going through your information. Are they directly applicable to Shogun 2?
And, what is CA's take on these efforts? Do they just sit at the sideline and laugh, or support and give some info?
Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
My Tools, Tutorials and Resources
The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell