Hi guys,
I have 2 questions
How do i get the cargo name (not the cargo label), the real cargo name, it depend on localisation.
like IORE = iron ore
As the doc says, because GRF can change it, i will just use that for cosmetic purpose (yeah i won't die if i can't get it).
Another question, how do i dup something in squirrel without duplicate the instance, but its content ? So both get the same content, but not sharing their instance. Like if i do "a=z" and altering "z" won't change any "a" values ? i'm looking for something that might appears simple for anyone, but i can't put my hand on it.
Getting cargo name
Moderator: OpenTTD Developers
Re: Getting cargo name
If you want to duplicate/clone/copy an AIList, create a new one and then use the member function AddList.
Disclaimer: I haven't checked the API docs or if it compiles. So take a look there if my memory fails on some details. AddList might be AppendList for example.
Code: Select all
local t = AITownList()
t.Valuate(AITown.GetPopulation);
t.KeepAbove(300);
local t2 = AIList();
t2.AddList(t);
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: Getting cargo name
thank you, that's what i was looking for
Who is online
Users browsing this forum: No registered users and 5 guests