Objects - hovgaardgames/startupcompany GitHub Wiki
Objects
This list is not exhaustive and is intended to list only the main objects.
How to access to these objects ?
To access to objects listed below, simply call it by his name (e.g. Components
or AchievementNames
) and you will be able to use his methods or data.
Global
Name | Description | Example |
---|---|---|
Benefits | Contains all benefits | - |
Buildings | Contains all buildings | - |
CompetitorProducts | Contains all competitors' products | - |
Components | Contains all components and modules | Example |
Configuration | Contains game's configurations | - |
Database | Contains benefits, bonuses, items and more. | - |
Emotions | Contains emotions of employees | - |
EmployeeTypes | Contains all employee's types | - |
Events | Contains all events that can be triggered | - |
Features | Contains all features | - |
Frameworks | Contains all frameworks | - |
Helpers | - | - |
HelpTopics | Contains all help topics | - |
InvestmentProjects | Contains all investment projects | - |
Investors | Contains all investors | - |
items | Contains all items | - |
Language | Contains translations of the current language | Example |
Loans | Contains all loans | - |
MarketingPackages | Contains all marketing ads | - |
Modding | Contains methods for mods | - |
RackDevices | Contains all rack devices for servers | - |
Remote | - | - |
ResearchItems | Contains all research items | - |
Servers | Contains all virtual servers | - |
Sounds | Contains sounds of the game | Example |
Names
Name |
---|
AchievementNames |
AdsFeatureNames |
BenefitNames |
BuildingNames |
BuildingType |
ComponentNames |
ComponentTypes |
ContractStatuses |
ContractTypes |
DemandTypes |
Difficulties |
EmployeeLevels |
EmployeeStates |
EmployeeTypeGroups |
EmployeeTypeNames |
Enums |
EventNames |
FeatureCategories |
FeatureNames |
FeatureProperties |
FrameworkNames |
GameEvents |
HelpTopicNames |
InvestmentProjectNames |
ItemCategories |
ItemNames |
MarketingInterests |
MarketingPackageNames |
NotificationTypes |
PriceRanges |
Priorities |
ProductStates |
ProductTypeNames |
RackDeviceNames |
RackDeviceState |
ResearchCategories |
ResearchItemNames |
ServerNames |
TaskStates |
Examples
Components
To add a new component, add the following code to you initialize method (in start.js):
ComponentNames.MyNewComponent = 'MyNewComponent';
Components.push({
name: ComponentNames.MyNewComponent,
employeeLevel: Enums.EmployeeLevels.Beginner,
icon: modPath + 'images/mynewcomponent.png',
employeeTypeName: Enums.EmployeeTypeNames.Developer,
type: ComponentTypes.Component,
produceHours: 2
});
Modules share the same array as component. To add a module you do it like this:
ComponentNames.MyNewModule = 'MyNewModule';
Components.push({
name: ComponentNames.MyNewModule,
employeeLevel: Enums.EmployeeLevels.Beginner,
icon: modPath + 'images/mynewmodule.png',
type: ComponentTypes.Module,
employeeTypeName: Enums.EmployeeTypeNames.Developer,
requirements: {
BlueprintComponent: 1,
WireframeComponent: 2,
GraphicsComponent: 1
}
});
Languages
To add new languages to the game, you simply have to provide a JSON file containing all the translations. You can find the original English translation file, by enabling Developer Mode, click Sources, find en.json and simply copy the content to your local JSON file.
To add the language to the game, add the following line to your initialize
method:
Database.languages.push({ name: 'Danish', key: 'da', path: _modPath + 'da.json' });
To add single translations, you can use the function
Modding.addTranslation(key, {en: 'english value', de: 'german value'});
The abbreviations of the languages are according to the ISO 639-1 standard.
Sounds
It's easy to play a sound in the game. In this example, we will play an error sound :
PlaySound(Sounds.error);
For more sounds, check the Sounds
object.