Author Topic: Can anyone help me understand why this mod is not running  (Read 1762 times)

loudent

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Can anyone help me understand why this mod is not running
« on: April 19, 2015, 01:26:09 pm »
Hey All,

Creating a new thread here although it is a culmination of a lot of help requests here. I have a mod who's sole purpose is to verify the script is being loaded when run in a server. I've put it in the right location and used the "check" function in the server to verify the script is being loaded and is valid. It's in the modconfig.xml and in the correct mod directory

It's extremely simple. All it does is, OnInit() call console.PrintError to output as message that the function has initialized

However, when I start the server the message does not appear in the console so I can only assume it's not being loaded. Can anyone advise.

The mod is posted here:
https://www.dropbox.com/s/sx03m6laqynukkl/testserverload.zip?dl=0


MenschMaschine

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: Can anyone help me understand why this mod is not running
« Reply #1 on: April 19, 2015, 01:59:19 pm »
Let me refer you to a different topic, which might help you: http://forums.atomictorch.com/index.php?topic=679.0
No Berries!

loudent

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: Can anyone help me understand why this mod is not running
« Reply #2 on: April 19, 2015, 02:06:06 pm »
Ok, here's what I learned.

1)For some reason the scripts will only run if there are in the global directory.
2) If you call PrintError instead of Print to the console then the game will think there is an error and it won't load.

So I have it working now. Although I thought you could put your script anywhere. Guess not.

MenschMaschine

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: Can anyone help me understand why this mod is not running
« Reply #3 on: April 19, 2015, 02:18:25 pm »
Regarding #1:
My guess is that there is some form of catalogue, which tells the game where to expect the files
that came with the game and how they are supposed to be named.
However, any files that the game does not -know- of, new scripts as an example, have to be put into the GLOBAL folder.

About #2:
That's also why i have shown you that thread about the Game.SendNotification-method ;)
No Berries!

loudent

  • Full Member
  • ***
  • Posts: 141
    • View Profile
Re: Can anyone help me understand why this mod is not running
« Reply #4 on: April 19, 2015, 02:21:16 pm »
Yeah, I missed your replay because I was testing the PrintError vs Print theory

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1094
    • View Profile
Re: Can anyone help me understand why this mod is not running
« Reply #5 on: April 20, 2015, 02:45:43 am »
We've updated the wiki to mention that the OnInit() is invoked only for Global and Internal scripts.
Sorry we didn't make it clear before.
Regards!