XS12 Functions Explained - XiozZe/XioScript GitHub Wiki

Function order

In general, these are the order chains:

  • Technology and Research --> Equipment --> Salary --> Training
  • Price and Policy --> Retail supply --> Warehouse supply
  • Price, Policy, Technology and Equipment --> Production supply --> Warehouse supply
  • Production Price --> Production Holiday

From these chains, you can conclude that:

  • All Equipment functions are finished before the Salary functions begin.
  • Warehouse supply functions will not begin before Production and Retail supply functions are finished.
  • Technology and Research functions do not have a requirement to start: they will begin immediately when the XioMaintenance is fired.

Functions

Note: if Option #1 is set to "-", none of the Options will fire.

TopManagerStats:

  • Green (target): shows stats with the top manager without bonuses.
  • Blue (maximum): shows stats with the top manager with bonuses.
  • Red (overflow): shows stats with the top manager efficiency still 100%. Note that increasing the top1 will reduce the overflow value for top3 and the other way around.

Price (Production and Warehouses)

Option #1:

  • Zero: Price will be set to zero.
  • $0.01: Price will be set to $0.01.
  • Prime Cost: Price will be set equal to the prime cost.
  • CTIE: Price will be set to the prime cost increased by the CTIE. The upper boundary for the price is 30x IP.
  • Profit Tax: Price will be set to the prime cost increased by the CTIE and the Profit Tax. The upper boundary for the price is 30x IP.
  • 1x IP: Price will be set equal to the IP for the corresponding product.
  • 30x IP: Price will be set equal to 30 times the IP for the corresponding product.
  • PQR: Price will be set based on the price of the world market: the script will look for the lowest available Price / Quality Ratio. Suppliers with a total ordered amount that exceeds the supplier's maximum order amount by three times will be excluded. The price will be calculated using that PQR. The new price will not change more than 9%, to keep all the contracts. The price cannot go under prime cost or go higher than 30x IP.

Option #2 (Production only):

  • Stock: The script uses the values under the "In stock"-column only.
  • Output: The script uses the values under the "Output"-column only.

Option #3:

  • Keep: If there is no prime cost (no goods in stock), do not change the price.
  • Reject: If there is no prime cost (no goods in stock), still change the price.

Price (Retail)

Option #1:

  • Zero: Price will be set to zero.
  • Market 10%: Price will be increased by 3% if the market share is above 12%, and decreased by 3% if below 8%.
  • Sales: The script compares the price and sales of yesterday with the day before yesterday. If an increase in price led to higher sales, the price will be increased by 3%. If an increase in price led to lower sales, the price will be decreased by 3%. If an decrease in price led to higher sales, the price will be decreased by 3%. If an decrease in price led to lower sales, the price will be increased by 3%.
  • Turnover: The same as Sales, except that it takes turnover (sales times price) in account, instead of sales.
  • Stock: Price will be increased by 3% if the all the stock was sold out last update, and decreased if not.
  • Local: Price will be set to the price of the local suppliers times your quality / local suppliers quality.
  • City: Price will be set to the price of the city average times your quality / city average quality.

Option #2:

  • P x0.0: No minimum price.
  • P x1.0: The price set with Option #1 cannot be lower than 1.0 times the purchase price.
  • P x1.1: The price set with Option #1 cannot be lower than 1.1 times the purchase price.
  • P x1.4: The price set with Option #1 cannot be lower than 1.4 times the purchase price.
  • P x2.0: The price set with Option #1 cannot be lower than 2.0 times the purchase price.

Policy

Option #1:

  • No sale: The policy will be set to "Not for sale"
  • Any: The policy will be set to "To any customer"
  • Company: The policy will be set to "Only to my company"
  • Corp.: The policy will be set to "Only to members of the corporation"

Option #2:

  • All: The policy of all products will be changed to the value determined by Option #1.
  • Output: The policy of products that had an output last update will be changed to the value determined by Option #1, all products with no output will be set to "Not for sale".

Supply (Production and Service)

  • Zero: The supply will be always set to zero
  • Required: For production buildings, the supply will be always set equal to the required amount. For service buildings, the supply will be set equal to the maximum consumption.
  • Stock: For production buildings, the supply will be set equal to three times the required amount minus the stock, with an upper boundary of two times the required amount. For service buildings, the supply will be set equal to three times the maximum consumption minus the stock, with an upper boundary of two times the maximum consumption.

If one or more suppliers are missing, or too many suppliers (more than one for each good) are present, all supply will be set to zero and you will receive a warning.

Supply (Retail)

Option #1:

  • Zero: The supply will be always set to zero
  • Sold: The supply will be set equal to the sold amount.\
  • Stock: The supply will be set equal to three times the sold amount minus the stock, with an upper boundary of two times the sold amount.
  • Amplifier: The supply will be set equal to the sold amount, but when the stock is equal to the purchased amount (all stock was sold out last update) it will increase the supply order by 25%.
  • Enhance: The supply will be set equal to the sold amount, plus 20% if the sold volume exceeds half of the current stock, and minus 20% otherwise.

Option #2:

  • None: No changes.
  • One: The supply set with Option #1 cannot go below 1 minus the goods not sold last update.
  • $1 000: The supply set with Option #1 cannot go below ($1,000 / purchase price) minus the goods not sold last update.
  • $1 000 000: The supply set with Option #1 cannot go below ($1,000,000 / purchase price) minus the goods not sold last update.
  • Market 1%: The supply set with Option #1 cannot go below 1% of the total market volume for that particular product minus the goods not sold last update.
  • Market 5%: The supply set with Option #1 cannot go below 5% of the total market volume for that particular product minus the goods not sold last update.
  • Market 10%: The supply set with Option #1 cannot go below 10% of the total market volume for that particular product minus the goods not sold last update.

Option #3:

  • Any Q: No changes.
  • Local Q: If the quality of your supplier is below the quality of the local supplier, the supply will be set to zero.
  • City Q: If the quality of your supplier is below the city average quality, the supply will be set to zero.

Supply (Warehouse)

Option #1:

  • Zero: The supply will be set to zero
  • Required: The supply will be set equal to the required amount.
  • Stock: The supply will be always set equal to three times the required amount minus the stock, with an upper boundary of two times the required amount.
  • Enhance: The supply will be set equal to the required amount, plus 20% if the required amount exceeds half of the current stock, and minus 20% otherwise.
  • Nuance: The supply will be set equal to the square root of the required amount divided by the stock, with an upper boundary of two times the required amount.
  • Maximum: The supply will be set to 1.000.000.000 for every supplier.

The supply will be spread out over different suppliers: The supplier with the lowest Price / Quality ratio will be picked first, moving on to the second in the PQR list when the demand exceeds the available amount.

Option #2:

  • None: No additional suppliers will be set or removed.
  • Mine: The script will dynamically contract different suppliers from the world market, searching for the lowest PQR. Only contracts from subdivisions that are yours are considered.
  • All: The script will dynamically contract different suppliers from the world market, searching for the lowest PQR. Contracts can come from any subdivisions available on the world market.
  • Other: The script will dynamically contract different suppliers from the world market, searching for the lowest PQR. Only contracts from subdivisions that are not yours are considered.

Option #3:

  • Remove: If the script does not require supply from a certain supplier, it will remove the supplier from the list. This is only the case if Option #2 is set to "Mine", "All" or "Other".
  • Zeros: If the script does not require supply from a certain supplier, it will set the supply for that supplier to zero.
  • Ones: If the script does not require supply from a certain supplier, it will set the supply for that supplier to one.

Ads

  • Zero: The advertisement campaign will be stopped.
  • Min TV: The advertisement medium will be set to TV and the advertisement budget will be set to the minimum possible.
  • Pop#N: The advertisement medium will be set to TV and the advertisement budget will be set in such a way that the number of contracts match the population count times #N.
  • Max: The advertisement medium will be set to TV and the advertisement budget will be set to the maximum allowed to keep 100% advertisement efficiency.

Salary

  • Required: The salary will be set to let the skill match the required skill.
  • Target: The salary will be set to the maximum allowed by the Top1. The function uses the manager qualification without bonuses.
  • Maximum: The salary will be set to the maximum allowed by the Top1. The function uses the manager qualification with bonuses.

For every salary function, the lower boundary of the salary is 0.8 * city salary, and the upper boundary 500 * city salary.

Holiday

  • Holiday: The holiday will always be turned on.
  • Working: The holiday will always be turned off.
  • Stock: For Production subdivisions, holiday will be turn on if the stock of one or more goods is zero. For Retail subdivisions, holiday will be turn on if the stock of all goods is zero.

Training

  • Always: When the subdivision is not in training, it will set a new training schedule of 4 days.
  • City Salary: When the subdivision is not in training, and the current salary is higher than the city average salary, it will set a new training schedule of 4 days.
  • 1 Year: When the subdivision is not in training, the difference between the current salary and the new salary after training will be compared to the training costs: if the costs of training can be earned back by the reduction of salary within one real year (365 days), the training will be set to 4 days.

Equipment

Option #1:

  • Required: The quality of the equipment will always be kept above required, but it will reduce the quality if that is cheaper. If the quality of the equipment is below required before repairing, it will first increase the quality to required. The algorithm used to find the supplier: of all suppliers, pick the supplier with the lowest price/quality. If repairing of a machine would lead to a lower quality than required, pick the supplier with the lowest price/quality but with a quality higher than required instead.
  • Maximal: The quality of the equipment will steadily increase over time, but it is capped by the Top1. The algorithm used to find the supplier: of all suppliers that have a quality higher than the current quality, it will pick the supplier with the lowest price/quality. If buying the equipment would push the quality over the limit determined by the Top1, it will buy equipment with a quality lower than the current equipment quality, with the lowest price/quality.
  • Q2.00: The quality of the equipment used for the repair will always be Q2.00 from the cheapest source. If Q2.00 is not available, the subdivision will not be repaired: it does not mix equipment with a quality lower than Q2.00 with a quality higher than Q2.00.

Equipment will be bought from the world market, not distinguishing between supply of your own company or supply of others.

Option #2:

  • Black: Only the black, completely damaged parts will be repaired.
  • Full: All damaged parts will be repaired.
  • Perc: One piece of equipment will be repaired if the percentage of wear and tear is higher than 1%.

Technology

  • Researched: When a new technology is researched and therefore the price of a higher level technology is $0.00 (excluding cost of introduction), the new technology will be introduced. This will not exceed the maximum technology level given by the current Top Manager.

Research

  • Continue: (Step 1) If no project is currently running, one level higher than the last finished project will be started, as long as the level does not exceed the maximum technology level allowed by the top manager. (Step 2) If no hypothesis is currently in study (progress is on 0%), the script will calculate the average completion time for each hypothesis and selects the quickest. (Step 3) The script will go through all possible factories that can be attached to the lab, looking for the highest load times efficiency. If the lab cannot find a factory with a efficiency and load higher than zero, it will give off a message and no factory will be set.

Solar

  • Always: The subdivision will always buy solar panels if no booster on that spot is active.
  • Profitable: The subdivision will always buy solar panels if the expected savings of energy costs surpasses the costs of the solar panel.

Size

  • Packed: The warehouse will always keep the percentage full between the 13.8% and the 69.5%. If the percentage full exceeds the 69.5%, the script will increase the size of the warehouse. If the percentage full is lower than 13.8%, the warehouse will decrease in size.
  • Full: The warehouse will always keep the percentage full between the 20% and the 200%. If the percentage full exceeds the 200%, the script will increase the size of the warehouse. If the percentage full is lower than 20%, the warehouse will decrease in size.