Changes

Jump to navigation Jump to search
37 bytes added ,  17:23, 30 October 2023
Line 348: Line 348:  
==== Networking ====
 
==== Networking ====
 
Level 3 features can also use the RunType value to control which computer will execute the code. The value can be either of the following:
 
Level 3 features can also use the RunType value to control which computer will execute the code. The value can be either of the following:
* '''Local''', which means the script will only run on the computer for the player who owns the product (This is the default). Example: You want something to happen to the player, like launching a lawsuit. This needs to be done locally for the affected player, or someone else might be sued for no reason.
+
* '''Local''', which means the script will only run on the computer for the player who owns the product (This is the default). Example: You want something to happen to the affected player's game, like launching a lawsuit or firing an employee. This needs to be done locally for the affected player, or someone else might be sued for no reason.
 
* '''Host''', which means the script will only run on the current hosting player's computer. Example: You are only calling methods which are synchronized between players, like adding bugs or money. These can be run locally, but any online synchronized methods will be faster to run for the host machine. If you are unsure, using Local will be fine, but if you run a synchronized method using the '''Everyone''' RunType, the method will get called multiple times. E.g. if you are adding money to a company, then that money will be added again to the same company for each player connected.
 
* '''Host''', which means the script will only run on the current hosting player's computer. Example: You are only calling methods which are synchronized between players, like adding bugs or money. These can be run locally, but any online synchronized methods will be faster to run for the host machine. If you are unsure, using Local will be fine, but if you run a synchronized method using the '''Everyone''' RunType, the method will get called multiple times. E.g. if you are adding money to a company, then that money will be added again to the same company for each player connected.
 
* '''Everyone''', which means the script will run for every player connected. Example: You are changing aspects of the product (like the price) or a company, which will not be synchronized by default, so you want the script to run for all players in the game, so everyone is on the same page.
 
* '''Everyone''', which means the script will run for every player connected. Example: You are changing aspects of the product (like the price) or a company, which will not be synchronized by default, so you want the script to run for all players in the game, so everyone is on the same page.
      
==== Script example ====
 
==== Script example ====

Navigation menu