Statistics: Posted by Uveso — 22 May 2017, 05:50
url = "http://forums.faforever.com/viewtopic.php?f=41&t=13764"
Statistics: Posted by crispweed — 21 May 2017, 09:03
local OldToggleBuildMode = ToggleBuildMode
function ToggleBuildMode()
-- first execute the original function
OldToggleBuildMode()
-- now set shownormals depending on BuildMode
if trackingMasterControl != nil then
ConExecute("ren_shownormals true")
else
ConExecute("ren_shownormals false")
end
end
Uveso wrote:
Just a smal note: You should change your Mod-UID inside mod_info.lua if you change the version number.
Ths way its much clearer that we have a new mod (version)
Uveso wrote:
PS: i did not test it, but if you want to upload the mod into the vault you need to change the url inside your mod_info.lua: url = "upcoder.com"
Use something with http on start like this:
Statistics: Posted by crispweed — 21 May 2017, 08:50
local OldToggleBuildMode = ToggleBuildMode
function ToggleBuildMode()
-- first execute the original function
OldToggleBuildMode()
-- now set shownormals depending on BuildMode
if trackingMasterControl != nil then
ConExecute("ren_shownormals true")
else
ConExecute("ren_shownormals false")
end
end
url = "http://forums.faforever.com/viewtopic.php?f=41&t=13764"
Statistics: Posted by Uveso — 21 May 2017, 02:13
local wasInBuildMode = nil -- this makes no assumption about start state, but triggers one toggle at the start, regardless (which can be a problem when using toggling console functions)
--local wasInBuildMode = false -- assumes this is off at start, but then avoids an initial toggle at the start
local BuildMode = nil
local isInBuildMode = nil
function BeatFunction()
if BuildMode == nil then
BuildMode = import('/lua/ui/game/buildmode.lua')
end
isInBuildMode = BuildMode.IsInBuildMode()
if wasInBuildMode ~= isInBuildMode then
--ConExecute("ren_bloom " .. tostring(isInBuildMode))
ConExecute("ren_shownormals " .. tostring(isInBuildMode))
--ConExecute("ren_ShowSkeletons") -- this just toggles, it seems, regardless of any bool argument
end
wasInBuildMode = isInBuildMode
end
Statistics: Posted by Uveso — 21 May 2017, 01:42
Statistics: Posted by crispweed — 20 May 2017, 14:09
local originalCreateUI = CreateUI
function CreateUI(isReplay)
originalCreateUI(isReplay)
if not isReplay then
local modFolder = 'MakeBuildModeMoreVisible'
import('/mods/' .. modFolder .. '/modules/beat_function.lua').Init()
end
end
function Init()
local BeatThread = ForkThread(BeatFunction)
end
function BeatFunction()
local BuildMode = import('/lua/ui/game/buildmode.lua')
local wasInBuildMode = false -- we assume this is off at start, and this avoids an initial toggle of render settings
while true do
local isInBuildMode = BuildMode.IsInBuildMode()
if wasInBuildMode ~= isInBuildMode then
ConExecute("ren_bloom " .. tostring(isInBuildMode))
ConExecute("ren_shownormals " .. tostring(isInBuildMode))
--ConExecute("ren_ShowSkeletons") -- this just toggles, it seems, regardless of any bool argument
end
wasInBuildMode = isInBuildMode
WaitSeconds(0.5)
end
end
Statistics: Posted by Uveso — 20 May 2017, 11:24
local buildmode = import('/lua/ui/game/buildmode.lua')
Uveso wrote:
And copy this into Whatever.lua:
Code: Select all
function Init()
local buildmode = import('/lua/ui/game/buildmode.lua')
local value = buildmode.IsInBuildMode()
if value then
LOG("true")
else
LOG("false")
end
end
Statistics: Posted by crispweed — 20 May 2017, 08:29
import('/lua/ui/game/buildmode.lua')
local buildmode = import('/lua/ui/game/buildmode.lua')
local value = buildmode.IsInBuildMode()
do
-- when this script loads, get the original CreateUI function
local originalCreateUI = CreateUI
-- now we hook the CreateUI function
function CreateUI(isReplay)
-- call the original function first to set up the rest of the game UI
originalCreateUI(isReplay)
-- import the files, unless we're in a replay
if not isReplay then
import('/mods/RepeatImportProblem/Whatever.lua').Init()
end
end
end
/mods/RepeatImportProblem/Whatever.lua
function Init()
local buildmode = import('/lua/ui/game/buildmode.lua')
local value = buildmode.IsInBuildMode()
if value then
LOG("true")
else
LOG("false")
end
end
Statistics: Posted by Uveso — 20 May 2017, 04:31
Unhandled exception:
state->m_rootState == m_state
Program : C:\ProgramData\FAForever\bin\ForgedAlliance.exe
Cmd line arguments :
Callstack:
Unknown symbol (address 0x008d462c)
Last 100 lines of log...
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...a\faforever\gamedata\lua.nx2\lua\ui\game\economy.lua(16): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...forever\gamedata\lua.nx2\lua\ui\game\missiontext.lua(19): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
warning: [string "OnSync()"](1): in main chunk
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/gamemain.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...a\faforever\gamedata\lua.nx2\lua\ui\game\economy.lua(16): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...forever\gamedata\lua.nx2\lua\ui\game\missiontext.lua(19): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
warning: [string "OnSync()"](1): in main chunk
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/economy.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...forever\gamedata\lua.nx2\lua\ui\game\missiontext.lua(19): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
warning: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
warning: [string "OnSync()"](1): in main chunk
warning: Error running lua command: ...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): Error importing '/lua/ui/game/missiontext.lua'
stack traceback:
[C]: in function `error'
...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(127): in function <...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua:90>
...gramdata\faforever\gamedata\lua.nx2\lua\usersync.lua(383): in function `OnSync'
[string "OnSync()"](1): in main chunk
debug: Loading module '\000/lua/ui/game/gamemain.lua\000'
info: Hooked /lua/ui/game/gamemain.lua with /mods/ui-party/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/reminder/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/notify/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/supremeeconomy/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/simpleridleengineersandfactories/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/repeatimportproblem/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/autoharvest/hook/lua/ui/game/gamemain.lua
info: Hooked /lua/ui/game/gamemain.lua with /mods/common/hook/lua/ui/game/gamemain.lua
debug: Loading module '\000/lua/ui/game/buildmode.lua\000'
info: Hooked /lua/ui/game/buildmode.lua with /mods/makebuildmodemorevisible/hook/lua/ui/game/buildmode.lua
debug: Loading module '\000/lua/ui/game/construction.lua\000'
info: Hooked /lua/ui/game/construction.lua with /mods/ui-party/hook/lua/ui/game/construction.lua
info: Hooked /lua/ui/game/construction.lua with /mods/notify/hook/lua/ui/game/construction.lua
warning: ...orever\gamedata\lua.nx2\lua\ui\game\construction.lua(83): Attempt to set attribute 'HandleEvent' on nil
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\config.lua(12): in function <...alliance\gamedata\mohodata.scd\lua\system\config.lua:11>
warning: ...orever\gamedata\lua.nx2\lua\ui\game\construction.lua(83): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ... alliance\gamedata\lua.scd\lua\ui\game\buildmode.lua(13): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...\faforever\gamedata\lua.nx2\lua\ui\game\gamemain.lua(1212): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/construction.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ... alliance\gamedata\lua.scd\lua\ui\game\buildmode.lua(13): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...\faforever\gamedata\lua.nx2\lua\ui\game\gamemain.lua(1212): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): Error importing '/lua/ui/game/buildmode.lua'
warning: stack traceback:
warning: [C]: in function `error'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(37): in function `import'
warning: ...\faforever\gamedata\lua.nx2\lua\ui\game\gamemain.lua(1212): in main chunk
warning: [C]: in function `doscript'
warning: [C]: in function `pcall'
warning: ...alliance\gamedata\mohodata.scd\lua\system\import.lua(48): in function `import'
warning: Error importing /lua/ui/game/gamemain.lua:
Error importing '/lua/ui/game/gamemain.lua'
stack traceback:
[C]: in function `error'
...alliance\gamedata\mohodata.scd\lua\system\import.lua(52): in function `import'
warning: Error running '/lua/ui/game/gamemain.lua:OnBeat': attempt to index a nil value
stack traceback:
Statistics: Posted by crispweed — 19 May 2017, 16:40