Nomads are broken?

General Discussions about The Nomads.

Moderators: pip, Softly, JJ173, Brute51, CookieNoob, Moritz

Re: Nomads are broken?

Postby RavenCurow » 05 Sep 2016, 03:48

Thanks a lot! This looks really useful. So far I seem to be see mostly issues where the scripts aren't hooking correctly. I'm trying to line them up with faf files they hook into to straighten them out.
RavenCurow
Avatar-of-War
 
Posts: 97
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Nomads are broken?

Postby Uveso » 05 Sep 2016, 06:47

Oh yes, this is the most work at first.
After all scripts are running, its time to check the units. :)
User avatar
Uveso
Evaluator
 
Posts: 810
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 29 times
Been liked: 118 times
FAF User Name: Uveso

Re: Nomads are broken?

Postby RavenCurow » 11 Sep 2016, 04:01

Okay, I've run into a problem that I can't seem to fix. I'm trying to line up the unitview_mini.lua files for the nomads. After doing some tweaking I find that one of the destroy methods is returning a nil value. I believe it has to do with the ninepatch in the faf version file as this is basically going over that. Not sure though. Here is my code.

Code: Select all
do


function SetLayout()
    local controls = import('/lua/ui/game/unitview.lua').controls
    controls.bg:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/build-over-back_bmp.dds'))
    LayoutHelpers.AtLeftIn(controls.bg, controls.parent)
    LayoutHelpers.AtBottomIn(controls.bg, controls.parent)
   
    controls.bracket:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/bracket-unit_bmp.dds'))
    LayoutHelpers.AtLeftTopIn(controls.bracket, controls.bg, -18, -2)
   
    if controls.bracketMid then
        controls.bracketMid:Destroy()
        controls.bracketMid = false
    end
    if controls.bracketMax then
        controls.bracketMax:Destroy()
        controls.bracketMax = false
    end
   
    LayoutHelpers.AtLeftTopIn(controls.name, controls.bg, 16, 14)
    LayoutHelpers.AtRightIn(controls.name, controls.bg, 16)
    controls.name:SetClipToWidth(true)
    controls.name:SetDropShadow(true)
   
    LayoutHelpers.AtLeftTopIn(controls.icon, controls.bg, 12, 34)
    controls.icon.Height:Set(48)
    controls.icon.Width:Set(48)
    LayoutHelpers.AtLeftTopIn(controls.stratIcon, controls.icon)
    LayoutHelpers.Below(controls.vetIcons[1], controls.icon, 5)
    LayoutHelpers.AtLeftIn(controls.vetIcons[1], controls.icon, -5)
    for index = 2, 5 do
        local i = index
        LayoutHelpers.RightOf(controls.vetIcons[i], controls.vetIcons[i-1], -3)
    end
    LayoutHelpers.AtLeftTopIn(controls.healthBar, controls.bg, 66, 35)
    controls.healthBar.Width:Set(188)
    controls.healthBar.Height:Set(16)
    controls.healthBar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_bg.dds'))
    controls.healthBar._bar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_green.dds'))
    LayoutHelpers.AtBottomIn(controls.shieldBar, controls.healthBar)
    LayoutHelpers.AtLeftIn(controls.shieldBar, controls.healthBar)
    controls.shieldBar.Width:Set(188)
    controls.shieldBar.Height:Set(2)
    controls.shieldBar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_bg.dds'))
    controls.shieldBar._bar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/shieldbar.dds'))
    LayoutHelpers.Below(controls.fuelBar, controls.shieldBar)
    controls.fuelBar.Width:Set(188)
    controls.fuelBar.Height:Set(2)
    controls.fuelBar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_bg.dds'))
    controls.fuelBar._bar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/fuelbar.dds'))
    LayoutHelpers.AtCenterIn(controls.health, controls.healthBar)
   controls.health:SetDropShadow(true)

    LayoutHelpers.Below(controls.capacitorBar, controls.fuelBar)
    controls.capacitorBar.Width:Set(188)
    controls.capacitorBar.Height:Set(2)
    controls.capacitorBar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_bg.dds'))
    controls.capacitorBar._bar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/capacitorbar.dds'))
    LayoutHelpers.AtCenterIn(controls.health, controls.healthBar)

   
    local iconPositions = {
        [1] = {Left = 70, Top = 60},
        [2] = {Left = 70, Top = 80},
        [3] = {Left = 190, Top = 60},
        [4] = {Left = 130, Top = 60},
        [5] = {Left = 130, Top = 80},
        [6] = {Left = 130, Top = 80},
        [7] = {Left = 190, Top = 80},
        [8] = {Left = 130, Top = 80} # position capacitor icon at shield position
    }
    local iconTextures = {
        UIUtil.UIFile('/game/unit_view_icons/mass.dds'),
        UIUtil.UIFile('/game/unit_view_icons/energy.dds'),
        UIUtil.UIFile('/game/unit_view_icons/kills.dds'),
      UIUtil.UIFile('/game/unit_view_icons/kills.dds'),
        UIUtil.UIFile('/game/unit_view_icons/missiles.dds'),
        UIUtil.UIFile('/game/unit_view_icons/shield.dds'),
        UIUtil.UIFile('/game/unit_view_icons/fuel.dds'),
        UIUtil.UIFile('/game/unit_view_icons/capacitor.dds'),
    }
    for index = 1, 7 do
        local i = index
        if iconPositions[i] then
            LayoutHelpers.AtLeftTopIn(controls.statGroups[i].icon, controls.bg, iconPositions[i].Left, iconPositions[i].Top)
        else
            LayoutHelpers.Below(controls.statGroups[i].icon, controls.statGroups[i-1].icon, 5)
        end
        controls.statGroups[i].icon:SetTexture(iconTextures[i])
        LayoutHelpers.RightOf(controls.statGroups[i].value, controls.statGroups[i].icon, 5)
        LayoutHelpers.AtVerticalCenterIn(controls.statGroups[i].value, controls.statGroups[i].icon)
        controls.statGroups[i].value:SetDropShadow(true)
    end
    LayoutHelpers.AtLeftTopIn(controls.actionIcon, controls.bg, 261, 34)
    controls.actionIcon.Height:Set(48)
    controls.actionIcon.Width:Set(48)
    LayoutHelpers.Below(controls.actionText, controls.actionIcon)
    LayoutHelpers.AtHorizontalCenterIn(controls.actionText, controls.actionIcon)
   
    controls.abilities.Left:Set(function() return controls.bg.Right() + 19 end)
    controls.abilities.Bottom:Set(function() return controls.bg.Bottom() - 50 end)
    controls.abilities.Height:Set(50)
    controls.abilities.Width:Set(200)

    if controls.abilityBG then controls.abilityBG:Destroy() end
    controls.abilityBG = NinePatch(controls.abilities,
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_m.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_ul.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_ur.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_ll.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_lr.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_vert_l.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_vert_r.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_horz_um.dds'),
        UIUtil.UIFile('/game/filter-ping-list-panel/panel_brd_lm.dds')
    )

    controls.abilityBG:Surround(controls.abilities, 3, 5)
    LayoutHelpers.DepthUnderParent(controls.abilityBG, controls.abilities)

    if options.gui_detailed_unitview != 0 then
        LayoutHelpers.AtLeftTopIn(controls.healthBar, controls.bg, 66, 25)
        LayoutHelpers.Below(controls.shieldBar, controls.healthBar)
        controls.shieldBar.Height:Set(14)
        LayoutHelpers.CenteredBelow(controls.shieldText, controls.shieldBar,0)
        controls.shieldBar.Height:Set(2)
        LayoutHelpers.AtLeftTopIn(controls.statGroups[1].icon, controls.bg, 70, 55)
        LayoutHelpers.RightOf(controls.statGroups[1].value, controls.statGroups[1].icon, 5)
        LayoutHelpers.Below(controls.statGroups[2].icon, controls.statGroups[1].icon,0)
        -- LayoutHelpers.AtRightTopIn(controls.StorageMass, controls.bg, 145, 55)
        LayoutHelpers.RightOf(controls.statGroups[2].value, controls.statGroups[2].icon, 5)
        -- LayoutHelpers.AtRightTopIn(controls.StorageEnergy, controls.bg, 145, 73)
        LayoutHelpers.Below(controls.Buildrate, controls.statGroups[2].value,1)
    end

end

function PositionWindow()
    local controls = import('/lua/ui/game/unitview.lua').controls
    local consControl = import('/lua/ui/game/construction.lua').controls.constructionGroup
    if consControl:IsHidden() then
        LayoutHelpers.AtBottomIn(controls.bg, controls.parent)
        controls.abilities.Bottom:Set(function() return controls.bg.Bottom() - 24 end)
    else
        LayoutHelpers.AtBottomIn(controls.bg, controls.parent, 120)
        controls.abilities.Bottom:Set(function() return controls.bg.Bottom() - 42 end)
    end
    LayoutHelpers.AtLeftIn(controls.bg, controls.parent, 17)
end
end


Here is my error log. I know there are other errors below this one, but I'm trying to take them one at a time lol.

Error Log
https://www.dropbox.com/s/2axctynxcglcjfc/game.log?dl=0
RavenCurow
Avatar-of-War
 
Posts: 97
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Re: Nomads are broken?

Postby Uveso » 11 Sep 2016, 06:31

sorry without debugging i cant help here :(

At least i can say the error is in line 251 but the original file only has 147 Lines.
Code: Select all
medata\lua.nx2\lua\ui\game\layouts\unitview_mini.lua(251): attempt to call method `Destroy' (a nil value)

In this case the error should be inside the hook file around line 104
Code: Select all
/nomadhook/lua/ui/game/layouts/unitview_mini.lua


There are some other issues inside the log:

These are all mods and some of them are hooking game files. Please delete those before you start debug something.
Code: Select all
info: checking b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\*.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\00_cheatoptions.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\01_aisupport.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\01_MoreColorsMod.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\02_sorian_ai_pack.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\03_lobbyenhancement.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\Advanced strategic icons.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\brewlan.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\modorderloadfix.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\Siege Walls.scd
info: not safe b:\steam\SteamApps\common\Supreme Commander Forged Alliance\gamedata\TF_CampaignModEnabler.scd



?? Are you mounting 2 versions of nomads at the same time ???
Code: Select all
info: DISK: AddSearchPath: 'b:\programdata\faforever\gamedata\fafnomads.nomad', mounted as '/'
info: DISK: AddSearchPath: 'b:\programdata\faforever\gamedata\nomads.nomad', mounted as '/'



Damaged file scta-env.scd.
Code: Select all
warning: Couldn't locate zip directory for 'b:\steam\steamapps\common\supreme commander forged alliance\gamedata\scta-env.scd'
warning: Search path element "b:\steam\steamapps\common\supreme commander forged alliance\gamedata\scta-env.scd" is not a valid .zip file.



Thats all. can't see more inside the log.
User avatar
Uveso
Evaluator
 
Posts: 810
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 29 times
Been liked: 118 times
FAF User Name: Uveso

Re: Nomads are broken?

Postby RavenCurow » 11 Sep 2016, 06:45

Oh no Im not modding two at the same time. That first one is for chat I believe. Not sure why but when you download the nomads file from faf it has both of those. I don't know if deleting it would have any negative effects. I'll remove it and see what it does.

I didn't realize faf was loading my mods from my steam game data folder. I'll have to remove those too. Thanks for pointing that out.
RavenCurow
Avatar-of-War
 
Posts: 97
Joined: 30 Oct 2014, 01:17
Has liked: 1 time
Been liked: 14 times
FAF User Name: RavenCurow

Previous

Return to Nomads Discussions

Who is online

Users browsing this forum: No registered users and 2 guests