jfs wrote: ↑10 Jan 2025 09:13
You need to use
GSCompanyMode to switch to operate as one of the companies in the game to be able to get a list of the signs that company has created. If you want all signs from all companies, you will need to switch to each of the companies in turn to list for them.
Thank you, that's what I needed !
For one who need, here an example:
Code: Select all
for(local ci=0;ci<15;ci++)
{
if(GSCompany.ResolveCompanyID(ci)!=GSCompany.COMPANY_INVALID)
local cm = GSCompanyMode(ci)
local signs = GSSignList();
foreach( signid, x in signs)
{
if(GSSign.IsValidSign(signid))
{
local txt = GSSign.GetName(signid);
GSLog.Info("text : " + txt);
if(txt.find("GS:") == 0)
{
action=txt.slice(3);
// do somethng...
}
}
}
//back to deity mode
}
from what I understood, the gamescript acts as company "ci" when the GSCompanyMode instance is live,
hence I created a local instance ("local cm"), that is destroyed at the end of the "for" loop, then gamescript is back to Deity mode,
I hope I understood it well