Jump to content

Published game fails to load map


Go to solution Solved by Josh,

Recommended Posts

Posted

Maybe .. just maybe this might help -

Here's the first few lines of code in the main.lua

require("consolepad")

--Load FreeImage plugin (optional)
local fiplugin = LoadPlugin("Plugins/FITextureLoader")

--Get the displays
local displays = GetDisplays()


Now if I put a Notify("blah blah") at the very top of the code - 

Notify("blah blah") 
require("consolepad")

--Load FreeImage plugin (optional)
local fiplugin = LoadPlugin("Plugins/FITextureLoader")

--Get the displays
local displays = GetDisplays()

The notification box pops up when I run the compile.

So I moved it below the require file,  these are the first two lines in the entire project mind you.

require("consolepad")
Notify("blah blah")

--Load FreeImage plugin (optional)
local fiplugin = LoadPlugin("Plugins/FITextureLoader")

--Get the displays
local displays = GetDisplays()

This fails.

So I opened the require file and put this at the very very top of it.

Notify("blah blah")
ConsolePadVersion      = "2.0"
ConsolePadynStatusBars = false

This fails, no box pops up and app never takes off.

Seems to be a problem with require("")  >>

Hope this helps some !

Posted

This is the error:

So I guess the problem is that require() doesn't work with Zip packages.

Also, in the next build, the indexes for GetMaterialLayers() will be one-based. If you see an error that says "Index out of range" this is the cause.

Loading package "data.zip"
Running script "Source/System/ErrorHandler.lua"
Running script "Source/System/ComponentSystem.lua"
Running script "Source/Components/AH-ArcherController/ArcherController.lua"
Running script "Source/Components/AH_UltraFootStepSFX/UltraFootStepSFX.lua"
Running script "Source/Components/AI/Monster.lua"
Running script "Source/Components/Appearance/ChangeEmission.lua"
Running script "Source/Components/Appearance/ChangeVisibility.lua"
Running script "Source/Components/Logic/Relay.lua"
Running script "Source/Components/Motion/Mover.lua"
Running script "Source/Components/Motion/SlidingDoor.lua"
Running script "Source/Components/myUtilities/ObjectPool.lua"
Running script "Source/Components/Physics/Impulse.lua"
Running script "Source/Components/Physics/SlidingDoor.lua"
Running script "Source/Components/Physics/SwingingDoor.lua"
Running script "Source/Components/Player/CameraControls.lua"
Running script "Source/Components/Player/FirstPersonControls.lua"
Running script "Source/Components/Player/FPSPlayer.lua"
Running script "Source/Components/Player/ThirdPersonControls.lua"
Running script "Source/Components/Player/VRPlayer.lua"
Running script "Source/Components/Sound/AmbientNoise.lua"
Running script "Source/Components/Sound/ImpactNoise.lua"
Running script "Source/Components/Triggers/CollisionTrigger.lua"
Running script "Source/Components/Triggers/DoorTrigger.lua"
Running script "Source/Components/Triggers/PushButton.lua"
Running script "Source/Components/UAGC/Console.lua"
Running script "Source/Components/UAGC/EcoSystem.lua"
Running script "Source/Components/UAGC/Pickup.lua"
Running script "Source/Components/UAGC/Poi.lua"
Running script "Source/Components/UAGC/Punchingbag.lua"
Running script "Source/Components/UAGC/Rope.lua"
Running script "Source/Components/UAGC/UAGController.lua"
[sol2] An error occurred and has been passed to an error handler: sol: runtime error: [string "source\components\uagc\uagcontroller.lua"]:1: module 'Components/UAGC/Utilities/General' not found:
        no field package.preload['Components/UAGC/Utilities/General']
        no file 'Source/Components/UAGC/Utilities/General.lua'
        no file 'Modules/Components/UAGC/Utilities/General.dll'
stack traceback:
        [C]: in function 'base.require'
        [string "source\components\uagc\uagcontroller.lua"]:1: in main chunk
sol: runtime error: [string "source\components\uagc\uagcontroller.lua"]:1: module 'Components/UAGC/Utilities/General' not found:
        no field package.preload['Components/UAGC/Utilities/General']
        no file 'Source/Components/UAGC/Utilities/General.lua'
        no file 'Modules/Components/UAGC/Utilities/General.dll'
stack traceback:
        [C]: in function 'base.require'
        [string "source\components\uagc\uagcontroller.lua"]:1: in main chunk
[string "source\components\uagc\uagcontroller.lua"]:1: in main chunk

 

Let's build cool stuff and have fun. :)

  • Solution
Posted

I am adding a command for Lua:

import("Source/file.lua")

This acts like require, but only works with .lua files, not DLLs. It will return whatever single value the script returns, if any. It will only get run once if it is called multiple times. It will also work with packages.

Do this:

import ("Source/Components/UAGC/Utilities/General.lua")
import ("Source/Components/UAGC/Utilities/HandtoHand.lua")
import ("Source/Components/UAGC/Utilities/RangedCombat.lua")
import ("Source/Components/UAGC/Utilities/MeleeCombat.lua")
import ("Source/Components/UAGC/Utilities/ItemsDbase.lua")
import ("Source/Components/UAGC/Utilities/SoundManager.lua")
import ("Source/Components/myUtilities/ObjectPool.lua")

You still have some errors because some sound files are not being included in the package, but that is another matter.

  • Thanks 1

Let's build cool stuff and have fun. :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...