Forged Alliance Forever Forged Alliance Forever Forums 2018-05-10T16:43:37+02:00 /feed.php?f=53&t=16123 2018-05-10T16:43:37+02:00 2018-05-10T16:43:37+02:00 /viewtopic.php?t=16123&p=163212#p163212 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
We also recently discovered, and patched this week, a bug that caused similar behavior on maps where player starts were random. If you can get the map to me, I'm happy to have a look at it.

Statistics: Posted by Sprouto — 10 May 2018, 16:43


]]>
2018-05-10T12:26:12+02:00 2018-05-10T12:26:12+02:00 /viewtopic.php?t=16123&p=163207#p163207 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]> @Sprouto
no error is reported.

this map was moved automaticly to the folder named 'maps.unsupported' after I switched configuration . It's ture that I can still play it in LOUD mode,but the AIs didn't work well. They just built one or two factories and several power generators, then turned to produce a huge army but never orgnize an attack . they would rather get more and more mass extractors than establish another base in one of the expansion areas. they seemed unwilling to build a navy factory though the 'navy area ' marker was just nearby.

Does it mean the markers added by the original map-editor can't work in LOUD? In other words, does it mean only the maps you have edited can be supported well?

Statistics: Posted by Ghoustaq — 10 May 2018, 12:26


]]>
2018-05-09T17:51:16+02:00 2018-05-09T17:51:16+02:00 /viewtopic.php?t=16123&p=163180#p163180 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]> Statistics: Posted by Sprouto — 09 May 2018, 17:51


]]>
2018-05-09T15:12:59+02:00 2018-05-09T15:12:59+02:00 /viewtopic.php?t=16123&p=163174#p163174 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
Sprouto wrote:
That will be coming from your WaitSeconds command.

The OnPopulate function has terminated before the Forked function did, leaving the forked thread in limbo with no place to return to when it's done.

@Sprouto

Hello!Sprouto:

I have placed mass of AI markers on my map, but it is still unsupported by LOUD. Do you know how to solve this problem?

Statistics: Posted by Ghoustaq — 09 May 2018, 15:12


]]>
2018-04-26T21:40:06+02:00 2018-04-26T21:40:06+02:00 /viewtopic.php?t=16123&p=162944#p162944 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
The OnPopulate function has terminated before the Forked function did, leaving the forked thread in limbo with no place to return to when it's done.

Statistics: Posted by Sprouto — 26 Apr 2018, 21:40


]]>
2018-04-26T18:59:06+02:00 2018-04-26T18:59:06+02:00 /viewtopic.php?t=16123&p=162937#p162937 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
Sprouto wrote:
The error is coming from your attempt to create a vision entity;

local vizEntity = VizMarker(spec)

Look carefully at what your putting into spec;

local spec = {
X = vizLocation[1],
Z = vizLocation[3],
Radius = vizRadius,
LifeTime = vizLifetime,
Army = vizArmy[1]:GetAIBrain(),
}

The error is telling you that some piece of data here is a table - look carefully at what your trying to pass along as Army...
You're not passing it's army index - but the entire brain that it belongs to. Try vizArmy[1]:GetAIBrain():GetArmyIndex()


Thanks, sprouto. Then anonther error occurs. I can't understand it


WARNING: Invalid args to yield(); expected tick count
stack traceback:

Statistics: Posted by Ghoustaq — 26 Apr 2018, 18:59


]]>
2018-04-25T21:57:34+02:00 2018-04-25T21:57:34+02:00 /viewtopic.php?t=16123&p=162917#p162917 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
local vizEntity = VizMarker(spec)

Look carefully at what your putting into spec;

local spec = {
X = vizLocation[1],
Z = vizLocation[3],
Radius = vizRadius,
LifeTime = vizLifetime,
Army = vizArmy[1]:GetAIBrain(),
}

The error is telling you that some piece of data here is a table - look carefully at what your trying to pass along as Army...
You're not passing it's army index - but the entire brain that it belongs to. Try vizArmy[1]:GetAIBrain():GetArmyIndex()

Statistics: Posted by Sprouto — 25 Apr 2018, 21:57


]]>
2018-04-25T19:01:40+02:00 2018-04-25T19:01:40+02:00 /viewtopic.php?t=16123&p=162904#p162904 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
Sprouto wrote:
Well...this code will only run once - right at the start of the game. If the units are there to begin with, it might work, but otherwise you need to find the right place in the main code to insert it. Running it during OnPopulate() will not work beyond the very beginning of a map.



Hello sprouto

do you know what it means?


WARNING: Error running lua script: attempt to use as integer a table value
stack traceback:
[C]: in function `_c_CreateEntity'
...ed alliance\gamedata\mohodata.scd\lua\sim\entity.lua(11): in function `__init'
...alliance\gamedata\mohodata.scd\lua\sim\vizmarker.lua(15): in function `initfn'
... alliance\gamedata\mohodata.scd\lua\system\class.lua(258): in function <... alliance\gamedata\mohodata.scd\lua\system\class.lua:246>
...me commander - forged alliance\maps\11\11_script.lua(41): in function <...me commander - forged alliance\maps\11\11_script.lua:24>



here's the code has been modified

Code:
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
local TriggerFile = import('scenariotriggers.lua')
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
local UnitUpgradeTemplates = import('/lua/upgradeTemplates.lua').UnitUpgradeTemplates
local ScenarioPlatoonAI = import('/lua/ScenarioPlatoonAI.lua')
local VizMarker = import('/lua/sim/VizMarker.lua').VizMarker
local SimCamera = import('/lua/SimCamera.lua').SimCamera
local Cinematics = import('/lua/cinematics.lua')
local SimUIVars = import('/lua/sim/SimUIState.lua')

function OnPopulate()
   ScenarioUtils.InitializeArmies()
        ForkThread(CreateVisibleAreaLocation)   
end
    local vizLocation
    local vizArmy
    local vizRadius
    local vizLifetime
    local X
    local Z
    local Radius
    local LifeTime
    local Army   
function CreateVisibleAreaLocation(vizRadius, vizLocation, vizLifetime, vizArmy)
    while true do
        for k = 1, 1 do
            vizLocation = ScenarioUtils.MarkerToPosition('vizLocation_' .. k)
            vizArmy = GetUnitsInRect( Rect(vizLocation[1]-5, vizLocation[3]-5, vizLocation[1]+5, vizLocation[3]+5) )
            if vizArmy then
               for _, instigator in vizArmy do
                   if VDist3(instigator:GetPosition(), vizLocation) <= 5 then
                      vizRadius = 20
                      vizLifetime = 0
                      local spec = {
                          X = vizLocation[1],
                          Z = vizLocation[3],
                          Radius = vizRadius,
                          LifeTime = vizLifetime,
                          Army = vizArmy[1]:GetAIBrain(),
                          }
                          local vizEntity = VizMarker(spec)

                          return vizEntity
                   end
               end   
            end
        end
        WaitSeconds(5)
    end
end     
function OnStart(self)
end

Statistics: Posted by Ghoustaq — 25 Apr 2018, 19:01


]]>
2018-04-24T19:56:01+02:00 2018-04-24T19:56:01+02:00 /viewtopic.php?t=16123&p=162894#p162894 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]> Statistics: Posted by Sprouto — 24 Apr 2018, 19:56


]]>
2018-04-24T19:25:13+02:00 2018-04-24T19:25:13+02:00 /viewtopic.php?t=16123&p=162893#p162893 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
Sprouto wrote:
The forkthread is not causing the error.

The error occurs because you're calling GetArmyIndex with a nil;

This means that vizArmy is nil, which means your code is not finding any units in the area you specified. Even worse, if it did find multiple units in the area, you would likely get a similar error, since GetArmyIndex will only function on a single entity.


Yes, you are right. there's no unit in this area at the begginning of the game. So I sent some mobile units to get there later, but the visible area wasn't activated still.

Statistics: Posted by Ghoustaq — 24 Apr 2018, 19:25


]]>
2018-04-24T18:49:23+02:00 2018-04-24T18:49:23+02:00 /viewtopic.php?t=16123&p=162888#p162888 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
The error occurs because you're calling GetArmyIndex with a nil;

This means that vizArmy is nil, which means your code is not finding any units in the area you specified. Even worse, if it did find multiple units in the area, you would likely get a similar error, since GetArmyIndex will only function on a single entity.

Statistics: Posted by Sprouto — 24 Apr 2018, 18:49


]]>
2018-04-24T18:12:40+02:00 2018-04-24T18:12:40+02:00 /viewtopic.php?t=16123&p=162887#p162887 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
speed2 wrote:
The only way to do this would be to set area triggers that will create visible areas (those are circles)

https://github.com/FAForever/fa/blob/develop/lua/ScenarioFramework.lua#L84-L91
https://github.com/FAForever/fa/blob/develop/lua/ScenarioFramework.lua#L1116-L1133


Thank you! Here's my code, I am not sure if it is necessary to forkthread this funciton.


local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
local TriggerFile = import('scenariotriggers.lua')
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
local UnitUpgradeTemplates = import('/lua/upgradeTemplates.lua').UnitUpgradeTemplates
local ScenarioPlatoonAI = import('/lua/ScenarioPlatoonAI.lua')
local VizMarker = import('/lua/sim/VizMarker.lua').VizMarker
local SimCamera = import('/lua/SimCamera.lua').SimCamera
local Cinematics = import('/lua/cinematics.lua')
local SimUIVars = import('/lua/sim/SimUIState.lua')

function OnPopulate()
ScenarioUtils.InitializeArmies()
ForkThread(CreateVisibleAreaLocation)
end
local vizLocation
local vizArmy
local vizRadius
local vizLifetime
local X
local Z
local Radius
local LifeTime
local Army
function CreateVisibleAreaLocation(vizRadius, vizLocation, vizLifetime, vizArmy)
if type(vizLocation) == 'string' then
vizLocation = ScenarioUtils.MarkerToPosition(vizLocation)
vizArmy = GetUnitsInRect( Rect(vizLocation[1]-5, vizLocation[3]-5, vizLocation[1]+5, vizLocation[3]+5) )
vizRadius = 20
vizLifetime = 0
end
local spec = {
X = vizLocation[1],
Z = vizLocation[3],
Radius = vizRadius,
LifeTime = vizLifetime,
Army = vizArmy:GetArmyIndex(),
}
local vizEntity = VizMarker(spec)

return vizEntity
end
function OnStart(self)
end



if I forkthread it, an error will occur


WARNING: Error running lua script: ...me commander - forged alliance\maps\11\11_script.lua(36): attempt to call method `GetArmyIndex' (a nil value)
stack traceback:
...me commander - forged alliance\maps\11\11_script.lua(36): in function <...me commander - forged alliance\maps\11\11_script.lua:24>


Can you fix it?

Statistics: Posted by Ghoustaq — 24 Apr 2018, 18:12


]]>
2018-04-22T07:25:42+02:00 2018-04-22T07:25:42+02:00 /viewtopic.php?t=16123&p=162830#p162830 <![CDATA[Re: Is there a command that can remove parts of War Fog?]]>
https://github.com/FAForever/fa/blob/develop/lua/ScenarioFramework.lua#L84-L91
https://github.com/FAForever/fa/blob/develop/lua/ScenarioFramework.lua#L1116-L1133

Statistics: Posted by speed2 — 22 Apr 2018, 07:25


]]>
2018-04-22T05:54:52+02:00 2018-04-22T05:54:52+02:00 /viewtopic.php?t=16123&p=162826#p162826 <![CDATA[Is there a command that can remove parts of War Fog?]]>

Statistics: Posted by Ghoustaq — 22 Apr 2018, 05:54


]]>