shadowwulf Posted August 5, 2008 Author Share Posted August 5, 2008 So i hear you can use a script compoletely inside an ini?I assume you would need to use an #include or something at the top of the main.I would just like a better understanding of how it works.Can anyone explain it?I would like to keep my scripts in seperate .ini files to make it easier to sort out what is where and how it all interacts.Are there any major pro's or con's to this? such as lag or confusion if you have like 2937 custom script inis? Link to comment Share on other sites More sharing options...
balliztik1 Posted August 5, 2008 Share Posted August 5, 2008 Other .txt files actually. There would be no difference in speed, though. All the scripts are loaded into a script control when you boot up the server or refresh the scripts, so it may take a tiny bit longer when you do that, but it won't affect script execution in any way, because it all runs from one object when it's all said and done anyway.Ah, I forgot pros and cons.PROS:Easy script sharing - just tell people to download the .txt file and add the appropriate #include in their main.txt.Organized - No searching through the whole main.txt to find one scriptCONS:Harder Debugging - It may take longer to find an error if you have to search a ton of files.Unorganized - Contradictory, maybe, but you may have certain subs separate, so you may be switching back and forth a lot, making it less organized in a sense. Link to comment Share on other sites More sharing options...
brutal Posted August 5, 2008 Share Posted August 5, 2008 I think Balliztik did a nice job of the pros/cons. And he is also correct about it not lagging the server. Link to comment Share on other sites More sharing options...
shadowwulf Posted August 5, 2008 Author Share Posted August 5, 2008 so i could have a file called playerdeveloment.txt.in it could be sub PlayerDevelopment(index, Stat1, Stat2)in the main all i need to do is have #include PlayerDevelopment(index, Stat1, Stat2) at the top andI can call it normally later in the body of the main? Link to comment Share on other sites More sharing options...
balliztik1 Posted August 5, 2008 Share Posted August 5, 2008 Not quite like that. You don't use #include with the sub name, but with the .txt file name.```#include ```Then, after adding that, you could call any sub from that .txt file in your main.txt. Link to comment Share on other sites More sharing options...
shadowwulf Posted August 6, 2008 Author Share Posted August 6, 2008 ok so im trying this out.here is what is inside PlayerDevelopment.txt```Sub PlayerDevelopment(index) Call Playermsg(index, "test PD", 13)End Sub```this file is located in Scripts\Playerdevelopment so i added the following line to the top of my main:```#include ```Now i added the following line just inside the OnAttack sub:```Call PlayerDevelopment(index)```it breaks the on attack. i see animation and hear the sound but nothing happens.I comment out the Call PlayerDevelopment(index) and it works normal again.Is there something im not doing right or not understanding about how this should work?NVM fixed it. no scripts needed in include statement Link to comment Share on other sites More sharing options...
balliztik1 Posted August 6, 2008 Share Posted August 6, 2008 Oops. I think that needs to be in quotations.```#include <"Scripts\PlayerDevelopment\PlayerDevelopment.txt">``` Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now