View Single Post
Old 07-12-07, 06:28 PM   #106
tater
Navy Seal
 
Join Date: Mar 2007
Location: New Mexico, USA
Posts: 9,023
Downloads: 8
Uploads: 2
Default

Quote:
Originally Posted by mcoca
Quote:
Originally Posted by lurker_hlb3
having a problem with "cargoExt & cargoInt". When I use/change them get "error" saying that these item are read only. Was using them in contection with editing / creating merchants.
I expanded the internal names to "internalCargo" and "externalCargo". I have no idea why the error is so silly...

Quote:
is there code to "randomly" selecting "crewratings" ?
Not per se, but it's really easy to create your own:

Code:
unit.crewRating=choice((CrewRating.POOR, CrewRating.NOVICE, CrewRating.COMPETENT))
That will select a random element from that list. Add or remove elements at will. You can also edit init.py to add a function that does that as shorthand.
Can you create a list with the same entry twice?

For example:
Code:
unit.crewRating=choice((CrewRating.COMPETENT, CrewRating.COMPETENT, CrewRating.COMPETENT, CrewRating.COMPETENT, CrewRating.COMPETENT, CrewRating.COMPETENT, CrewRating.VETERAN, CrewRating.VETERAN, CrewRating.VETERAN, CrewRating.ELITE))
The idea would be that without other coding it would quickly give a 10% chance of Elite, 30% vet, 60% Competant.

tater
tater is offline   Reply With Quote