Forum Discussion

ffi82's avatar
ffi82
Rising Scout
6 months ago

get Construction Yard Level from browser console issue

hi.

view: region
target: some alliance base (not ghost)
issue: level 0

Why does ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity().get_ConstructionYardLevel(); return 0 here?

 

2 Replies

  • Hiho,

    I tried the same with some bases from my alliance on FS25. Some showed a valid value (e.g. 41), others showed 0. I do not have an explanation for it.

    Greetings
    Leo

  • ffi82's avatar
    ffi82
    Rising Scout
    2 months ago

    found a workaround... (i love proxies... :( )... works for CY, CC, DHQ and DF this way...

    proper fix would be nice though... or is this a "feature" ? :P

    const buildings = ClientLib.Data.MainData.GetInstance().get_Cities().get_CurrentCity().get_Buildings().d;
    const getLevel = name => Object.values(buildings).find(b => b.get_TechGameData_Obj().dn === name)?.get_CurrentLevel();
    const obj = {
      levelCY: getLevel('Construction Yard'),
      levelCC: getLevel('Command Center'),
      levelDHQ: getLevel('Defense HQ'),
      levelDF: getLevel('Defense Facility')
    };
    console.log(obj);

About Tiberium Alliances Technical Issues

Having problems running the game or a script? Get help with Command and Conquer: Tiberium Alliances with the community!1,662 PostsLatest Activity: 15 hours ago