Help - Search - Members - Calendar
Full Version: CARTYPEWNTED question
Skyline User's Forum > > Activity Generator
Frascati
Hi

Is there any effect to be had by having the same car type listed more than once in an entry?

eg BOX-BOX-BOX-FLAT.

Would boxes be 3 times more likely to turn up?

Stefan R

sgdavis
QUOTE(Frascati @ Jan 6 2008, 03:48 AM) *
Hi

Is there any effect to be had by having the same car type listed more than once in an entry?

eg BOX-BOX-BOX-FLAT.

Would boxes be 3 times more likely to turn up?

Stefan R


This was such a great question, I actually had to read through my own program code to determine how the program would respond to this. As it turns out you are correct, doing this will cause the Box car to be more likely to be selected. The way it works is the program looks at all the types that are separated by hyphens and builds a list of those. So the list in this case would have BOX, BOX, BOX, FLAT. Then the program counts the number of items in that list (in this case 4). Finally the program generates a random number between 1 and 4 and selects the type that corresponds to that humber, i.e. 1, 2 or 3 would return "BOX" and a 4 would return "FLAT".

So you have discovered a new feature of the program for those advanced template designers who would like to "stack" the odds of a certain car type to be shipped to a given industry. Of course CarTypeShipped (cars shipped OUT OF an industry) would work the same way -- it uses the same program subroutine.

Thanks,

Steve
nbeveridge
QUOTE(sgdavis @ Jan 6 2008, 08:48 AM) *
This was such a great question, I actually had to read through my own program code to determine how the program would respond to this. As it turns out you are correct, doing this will cause the Box car to be more likely to be selected. The way it works is the program looks at all the types that are separated by hyphens and builds a list of those. So the list in this case would have BOX, BOX, BOX, FLAT. Then the program counts the number of items in that list (in this case 4). Finally the program generates a random number between 1 and 4 and selects the type that corresponds to that humber, i.e. 1, 2 or 3 would return "BOX" and a 4 would return "FLAT".

So you have discovered a new feature of the program for those advanced template designers who would like to "stack" the odds of a certain car type to be shipped to a given industry. Of course CarTypeShipped (cars shipped OUT OF an industry) would work the same way -- it uses the same program subroutine.

Thanks,

Steve


COOL!!! Way back when we first talked about what features to add to AG3 (it would become AG4),Steve and I had talked about not just multiple car types on a given track, but how to portion those cars. Eg. how to have three box cars vs. one flat car because the track has three doors to the warehouse, and only one platform. So now it turns out that AG4 has been able to do this all along. WOW! Steve may say that he'd rather be lucky than good, but I think that this is another example of how his style of programming produces brilliant results!

Thanks Steve -- this may entice me to revise even the templates which are already updated to AG4!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.