[0.9] Require crash
[0.9] Require crash
Game crashes if I try to require file via console.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
- AlexPhoenix
- Fast Inserter
- Posts: 149
- Joined: Tue Feb 18, 2014 7:48 am
- Contact:
Re: [0.9] Require crash
Where file is placed?
and how exactly you requare file?
and how exactly you requare file?
Re: [0.9] Require crash
1)Right next to factorio.exeAlexPhoenix wrote:Where file is placed?
and how exactly you requare file?
filename test.lua
2)require "test"
Also. I just noticed I use 32 bit zip package (usb memory stick) in 64 bit Win 7. Seems to work fine overall.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: [0.9] Require crash
So I fixed it, it returns error message instead of the crash.
Re: [0.9] Require crash
I would like to add that remote calling this also cause a crash.
test.lua were in both, Win32 and mod's folder.
test.lua: creates local table, adds some functions to table and returns the table.
Code: Select all
remote.addinterface("console++",
{
test = function()
return require("test")
end
})
test.lua: creates local table, adds some functions to table and returns the table.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: [0.9] Require crash
Thanks for noticing. These corner cases are pretty annoying Do you know if this worked in 0.8.x?rk84 wrote:I would like to add that remote calling this also cause a crash.test.lua were in both, Win32 and mod's folder.Code: Select all
remote.addinterface("console++", { test = function() return require("test") end })
test.lua: creates local table, adds some functions to table and returns the table.
I have no idea what I'm talking about.
Re: [0.9] Require crash
I get console message in 0.8.8cube wrote:Do you know if this worked in 0.8.x?
Code: Select all
Cannot execute command. Error: attempt to index a string value
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: [0.9] Require crash
So I checked it now -- After kovarex's change the crash disappeared even with the remote.call scenario. On the other hand when remote.call was used from a mod, requires used in the interface would almost never work as intended. So I changed the error message and completely disabled requires in interfaces for 0.9.2
I have no idea what I'm talking about.
Re: [0.9] Require crash
This is starting to be more of interface bug report than require, but still I will continue here.
there is problem when returning function(s) in interface. I remote call these in console. Returning number or string or number/string in table works, but functions do not.
This gives error "attempt to index a string value"
This returns string "test"
there is problem when returning function(s) in interface. I remote call these in console. Returning number or string or number/string in table works, but functions do not.
This gives error "attempt to index a string value"
Code: Select all
test = function()
return {function() game.player.print("functest") end}
end
Code: Select all
test = function()
return function() game.player.print("functest") end
end
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
- AlexPhoenix
- Fast Inserter
- Posts: 149
- Joined: Tue Feb 18, 2014 7:48 am
- Contact:
Re: [0.9] Require crash
from https://forums.factorio.com/wiki/inde ... interfaces
The interface functions can take only primitive types and tables as variables. The same holds for return values. The reason for this is that the scripts are running in different lua states and there is no easy way of passing more elaborate data (functions, rich Factorio objects - Lua Entity, etc.) around. Passing simple function callbacks is very powerful mechanism and might be implemented in some way in the future.
Re: [0.9] Require crash
Ah I forgot that.
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela