Advertisement
Guest User

Untitled

a guest
Jun 25th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. //** Following code finds powerplants on the map and selects one from the list
  2.  
  3. local cm = GSCompanyMode(0);
  4. local industrylist = GSIndustryList();
  5. industrylist.Valuate(GSIndustry.GetIndustryType);
  6. industrylist.KeepValue(1);
  7. industrylist.Sort(GSList.SORT_BY_VALUE, false);
  8. local industrylist_a = industrylist.Begin();
  9.  
  10. //** Now the fun part in debugging
  11.  
  12. GSLog.Error("you have " + industrylist_b + " PowerPlants on the map");
  13. GSLog.Error("This is the industry_ID " + industrylist_a);
  14. GSLog.Error("Is it a valid industry? " + GSIndustry.IsValidIndustry(industrylist_a));
  15. GSLog.Error("Whats its name: " + GSIndustry.GetName(industrylist_a));
  16. GSLog.Error("The location of the tile" + GSIndustry.GetLocation(industrylist_a));
  17. GSLog.Error("Is this tile valid? " + GSMap.IsValidTile(industrylist_a));
  18.  
  19. //** Debugging finds power plants, finds its ID, sees its a valid industry, can give the name of industry and it exists on the map, returns the location tile. But last line gives the error that tile is not valid.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement