Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Scripting using INIs


shadowwulf
 Share

Recommended Posts

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

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 script

CONS:
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

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 and
I can call it normally later in the body of the main?
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...