• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

ATG

Recruit
9 Badges
May 6, 2017
4
0
  • Europa Universalis IV
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Surviving Mars
  • Surviving Mars: Digital Deluxe Edition
  • Surviving Mars: First Colony Edition
  • Prison Architect
  • Surviving Mars: First Colony Edition
Can someone please explain the proper way to add a custom sponsor banner? I have not found one full example on how to do this. There is a small section in the SDK docs that makes it sound like this is easy to do, but it is too vague and I find it very incomplete.

I'll describe what I am doing, hopefully someone can fill in the blanks:

1) I created a custom mission sponsor with working decal/logo. For this example, we'll call the sponsor ID "MySponsor".

2) I took the 3 entity (.ent) files from an existing banner (USA) with corresponding material (.mtl) file and texture.

3) Renamed the .ent files - Flag_01_MySponsor, Flag_02_MySponsor, Flag_03_MySponsor

4) Renamed the material file and then edited the flag .ent files to reference this new material name.

5) Renamed the texture and then edited the material file to reference the new texture name.

6) Imported the 3 banner entities via the mod editor.

7) Added the mission sponsor banner entity suffix in the mod editor (banners_name = "MySponsor")


I had doubts it would work....and I was right :( Edit: Disregard below, it works with the above steps (1-7)


I then found SkiRich's example from his NASA Sponsor mod. Here is his code that I modified with my sponsor info as a test:

local BannerSponsorEntityMap = {
CNSA = "China",
ESA = "Europe",
ISRO = "India",
Roscosmos = "Russia",
MySponsor = "MySponsor"
}

function OnMsg.ClassesGenerate()

function SponsorBannerBase:GetEntity()
if lf_print then print("Running Banner GetEntity") end
local sponsor = GameTime() ~= 0 and GetMissionSponsor().id
local entity = ""
if sponsor == "MySponsor" then
return self.banner .. "MySponsor"
end
if BannerSponsorEntityMap[sponsor] then
entity = self.banner .. (BannerSponsorEntityMap[sponsor] or "") or self.banner .. (sponsor or "")
end
if not IsValidEntity(entity) then
entity = self.banner .. "IMM"
end
return entity
end
end

The custom banner worked with this added code but unfortunately, this not a proper solution.

The code doesn't reference all of the actual banners in the game. So if you are using this mod, you are currently missing some banners. For example SpaceY - if you choose this sponsor then you will get the default IMM (Hand Shake) flag instead.

More importantly, you can easily update this code with all of the current sponsor flags but the same problem will happen again when someone else creates a custom banner mod in this fashion. The reason being that the code under "local BannerSponsorEntityMap" must declare all sponsor banners. If you only declare your custom one, then all of the banners wont be available. This creates the imposibility of multiple mods having custom sponsor banners with this code.

It would be nice if there was a way to inject new sponsors without affecting the existing ones but I am just learning lua.

There has to be a better way of doing this. There's a reason there aren't any mission sponsor mods with custom banners. I'm hoping a dev or someone can finally shed some light on the proper steps to create them.
 
Last edited:
EDIT: Disregard. I finally got it to work! :)

There is no need for code. The problem was I had the NASA mod enabled the whole time and it was causing my banner to default to the IMM one (making me think I did it wrong). Once I disabled it, my custom banner appeared. All you need are the assets/entities like I described in my first post steps 1-7.
 
Last edited:
Did Ski add something to his mod forcing the banner then?

I think that code was used to redirect the USA banner to his NASA mod.

Like I described in my first post, the code I posted used in his NASA mod is problematic.

Basically any sponsor entity not declared under the local BannerSponsorEntityMap section will default to the IMM banner. So this means any mission sponsor mod that adds a custom banner will not work including several of the default flags not included in his list (i.e. SpaceY, Brazil,..)
 
I think that code was used to redirect the USA banner to his NASA mod.

Like I described in my first post, the code I posted used in his NASA mod is problematic.

Basically any sponsor entity not declared under the local BannerSponsorEntityMap section will default to the IMM banner. So this means Bluestacks Lucky Patcher Kodi any mission sponsor mod that adds a custom banner will not work including several of the default flags not included in his list (i.e. SpaceY, Brazil,..)
More importantly, you can easily update this code with all of the current sponsor flags but the same problem will happen again when someone else creates a custom banner mod in this fashion. The reason being that the code under "local BannerSponsorEntityMap" must declare all sponsor banners. If you only declare your custom one, then all of the banners wont be available. This creates the imposibility of multiple mods having custom sponsor banners with this code.
 
Last edited: