Page 1 of 1

Getting cargo name

Posted: 14 Jan 2011 11:11
by krinn
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.

Re: Getting cargo name

Posted: 14 Jan 2011 18:01
by Zuu
If you want to duplicate/clone/copy an AIList, create a new one and then use the member function AddList.

Code: Select all

local t = AITownList()
t.Valuate(AITown.GetPopulation);
t.KeepAbove(300);
local t2 = AIList();
t2.AddList(t);
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.

Re: Getting cargo name

Posted: 14 Jan 2011 20:29
by krinn
thank you, that's what i was looking for