Results 1 to 6 of 6

Thread: Where are the function in .lua files called??

  1. #1

    Default Where are the function in .lua files called??

    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?

  2. #2

    Default Re: Where are the function in .lua files called??

    The functions in the lua files aren't explicitly called, they are all executed when the game loads the lua file.
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    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

  3. #3

    Default Re: Where are the function in .lua files called??

    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?

  4. #4

    Default Re: Where are the function in .lua files called??

    Quote Originally Posted by Seikales View Post
    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.
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    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

  5. #5

    Default Re: Where are the function in .lua files called??

    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?

  6. #6

    Default Re: Where are the function in .lua files called??

    Quote Originally Posted by Seikales View Post
    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?
    Look at the script-o-rama for NTW (in my sig) and see if you follow what is going on there. If it's to your liking I can get you more specific info

    As for CA, traditional radio silence
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •