Community Forum

Debugger in Editor 9.0.3

Forum Overview >> Editor

CategoryEditor
Created17.10.2022 23:59


Lena Cody (trenidor) 17.10.2022 23:59
Am I doing something wrong or is it normal for the console on the editor to throw "attempt to index" errors over everything that's supposedly part of the API?

I went ahead and made a simple script that I think should work, yet it's throwing that error over everything in the LuaDOC FS22 provided...

Here's my script:

test = {}

function test:loadMap()
g_messageCenter:subscribe(MessageType.HOUR_CHANGED, self.rTest, self)
print("Testing this Script is loaded with the map")
end

function hayToStraw:rTest()
if g_server ~= nil and g_currentMission.environment.currentHour == 10 then
print("Testing that the current hour triggers this script")
end
end
addModEventListener(test)
test.loadMap()

---------------------
Also, if I just zip it up with a modicon and a modDesc.xml file and throw it in my mods, it doesn't appear to work within the game either. Sorry, I'm new to modding could someone tell me what I'm doing wrong?

Here's my XML file:

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="64">
<author>Trenidor</author>
<version>1.0.0.0</version>
<iconFilename>modIcon.dds</iconFilename>
<multiplayer supported="false"/>
<category>misc</category>

<title>
<en>Test for Modding</en>
</title>

<description>
<en>
Just a mod that tests whether I can load my lua scripts into the game.
</en>
</description>
<extraSourceFiles>
<sourceFile name="test" filename="test.lua" />
</extraSourceFiles>
</modDesc>

Lena Cody (trenidor) 18.10.2022 00:05
It's throwing the Attempt to index error for g_messageCenter, g_currentMission, and addModEventListener btw...


Note: Log in to post. Create a new account here.