Cities: Skylines Guide

Adding Rush Hour events to your building for Cities: Skylines

Adding Rush Hour events to your building

Overview

This guide covers how to make your own random events for Rush Hour.This guide covers both random events and user creatable events. If you are creating random events only you don’t need to read past the end of the random events section, however if you are creating user creatable events you will need to read through both sections.Please let me know if you found this guide helpful, or you’re using events with your building!

Intro

Rush Hour now allows you to create events for your own unique buildings, and you can customise your event exactly like official events.

Rush Hour now comes with an event editor built in (as an external program). You can find it in the Rush Hour options ingame.

Creating the folder structure

In your mod folder (where your crp files are) which will be located in steamappsworkshopcontent255710 create a new folder named RushHour Events. This is where you’ll place the XML file(s) needed for your events.

Note: You will need a published project for this to work, but if you don’t have one you can create a temporary folder in the content255710 folder which will be read as long as it has the same folder structure inside. This should be fixed soon.

Creating your XML file

Below is the code you need to create a new event. Create a new XML file in the folder you just created and give it whatever name you like, but make sure it has the .xml extension. Copy the below code into that file for easier viewing and editing. If you know XML then you’ll probably be able to figure everything out from here on out, but if not I’ll describe it below.

<?xml version=”1.0″ encoding=”utf-8″?> <EventContainer xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> <Events> <Event EventName=”UniqueEventName” BuildingName=”YourBuildingName” Capacity=”1000″ LengthInHours=”1″> <InitialisedMessages> <Message>This message will appear as soon as soon as the event is created</Message> <Message>This can be days in advance of the event actually happening</Message> <Message>Add more messages here like this</Message> </InitialisedMessages> <BeginMessages> <Message>This message will appear after the event has started</Message> <Message>Add more messages here like this</Message> </BeginMessages> <EndMessages> <Message>This message will appear after the event has ended</Message> <Message>Add more messages here like this</Message> </EndMessages> <ChanceOfAttendingPercentage> <Males>0</Males> <Females>0</Females> <Children>0</Children> <Teens>0</Teens> <YoungAdults>0</YoungAdults> <Adults>0</Adults> <Seniors>0</Seniors> <LowWealth>0</LowWealth> <MediumWealth>0</MediumWealth> <HighWealth>0</HighWealth> <Uneducated>0</Uneducated> <OneSchool>0</OneSchool> <TwoSchools>0</TwoSchools> <ThreeSchools>0</ThreeSchools> <BadHappiness>0</BadHappiness> <PoorHappiness>0</PoorHappiness> <GoodHappiness>0</GoodHappiness> <ExcellentHappiness>0</ExcellentHappiness> <SuperbHappiness>0</SuperbHappiness> <VeryUnhappyWellbeing>0</VeryUnhappyWellbeing> <UnhappyWellbeing>0</UnhappyWellbeing> <SatisfiedWellbeing>0</SatisfiedWellbeing> <HappyWellbeing>0</HappyWellbeing> <VeryHappyWellbeing>0</VeryHappyWellbeing> </ChanceOfAttendingPercentage> </Event> </Events> </EventContainer>

Random events (not user creatable)

The sections below show you how to create random events.

If you aren’t allowing users to create their own events then you will only need to read these sections, however if you are allowing users to create their own events for your building then you’ll need both this section and the user events section.

The Event tag

The first actual coding step of creating your event is to edit the event tag of your custom event.

<Event EventName=”UniqueEventName” BuildingName=”YourBuildingName” Capacity=”1000″ LengthInHours=”1″>

Parameter
Meaning
EventName
The unique name of your event. If anything else has this name it will be overwritten, so make sure it’s something no one else will think up.
BuildingName
Your building name as it appears ingame. You can find this name by activating the Print all monuments in your city to the console developer option in the Rush Hour options and load a city up with your unique building in it. The name will be printed to the console/debug log as your city is loaded.
Capacity
The maximum number of Cims that can attend your event. This is limited to 9000.
LengthInHours
The length of your event in hours. 1 = 1 hour, 1.5 is 1 hour and 30 minutes.

Message tags

These tags control what appears when an event is scheduled, started and ended. Adding more of these messages increases randomness, and you’re recommended to have at least four messages per message type (even though I’ve not done that in some of mine, but shhh). Below is what the message code looks like.

<InitialisedMessages> <Message>This message will appear as soon as soon as the event is created</Message> <Message>This can be days in advance of the event actually happening</Message> <Message>Add more messages here like this</Message> </InitialisedMessages> <BeginMessages> <Message>This message will appear after the event has started</Message> <Message>Add more messages here like this</Message> </BeginMessages> <EndMessages> <Message>This message will appear after the event has ended</Message> <Message>Add more messages here like this</Message> </EndMessages>

Parameter
Meaning
InitialisedMessages
These messages appear when an event is first created by the event system. This event also has variables you can use within your message.

  • {0} – The number of days until your event. It will appear as “less than a day”, “1 day” or “3 days”, for example.
  • {1} – The number of tickets available. This will appear as “100 tickets” or “1200 tickets”, for example.
  • {2} – The length of the event. This will appear as “more than 1 hour long”, “more than 3 hours long”, “2 hours long” or “1 hour long”, for example.

An example of a message that uses all these variables is “There’s {0} until the event! There’s only {1} available, and the event is {2}.” which could appear ingame as “There’s less than a day until the event! There’s only 1200 tickets available, and the event is more than 2 hours long.”

BeginMessages
These messages appear as soon as the event starts. These have no variables.
EndMessages
The maximum number of Cims that can attend your event. This is limited to 9000.

Chances

These control the chances of a certain citizens attending your event. These are precentage chances, so if you always want a specific type of citizen to attend, write 100. Alternatively, if you don’t wish for them to attend, put 0. Anything in between will be a random percentage of those citizens. Lower numbers means less of those types of people will attend. Of course, the names of these percentages should be pretty obvious.

<ChanceOfAttendingPercentage> <Males>0</Males> <Females>0</Females> <Children>0</Children> <Teens>0</Teens> <YoungAdults>0</YoungAdults> <Adults>0</Adults> <Seniors>0</Seniors> <LowWealth>0</LowWealth> <MediumWealth>0</MediumWealth> <HighWealth>0</HighWealth> <Uneducated>0</Uneducated> <OneSchool>0</OneSchool> <TwoSchools>0</TwoSchools> <ThreeSchools>0</ThreeSchools> <BadHappiness>0</BadHappiness> <PoorHappiness>0</PoorHappiness> <GoodHappiness>0</GoodHappiness> <ExcellentHappiness>0</ExcellentHappiness> <SuperbHappiness>0</SuperbHappiness> <VeryUnhappyWellbeing>0</VeryUnhappyWellbeing> <UnhappyWellbeing>0</UnhappyWellbeing> <SatisfiedWellbeing>0</SatisfiedWellbeing> <HappyWellbeing>0</HappyWellbeing> <VeryHappyWellbeing>0</VeryHappyWellbeing> </ChanceOfAttendingPercentage>

Testing (setting up)

You now have an option to force your events to happen. In your XML file, where the Event tag is you can now add a Force=”true” parameter. Below is the example Event tag:

<Event EventName=”UniqueEventName” BuildingName=”YourBuildingName” Capacity=”1000″ LengthInHours=”1″>

If we add the Force=”true” parameter to this, it will look like:

<Event EventName=”UniqueEventName” BuildingName=”YourBuildingName” Capacity=”1000″ LengthInHours=”1″ Force=”true”>

This is the first step required to allow you to force your event in your city using Rush Hour. The next section will cover actually turning on your event in game.

Remember to remove this tag before publishing your workshop item!

Testing (in game)

Once you have set the Force parameter in one of your events, load the game and your city. When your city is loaded, go to the Rush Hour options and click the Experimental tab. Under there should be an option to “Enable ‘Force’ XML parameter”.


If you tick this option and hit apply, the event will be immediately scheduled 3 hours in advance of your current city time. Every time you save with this option enabled it will be re-scheduled, so if you want to change any other options you can disable this option after an event has scheduled itself.

Note: Each time an event is scheduled this way the XML file will be re-loaded. You can make changes to your XML file while ingame, then re-schedule the event to load the changes again.

Also, if anyone has left the Force=”true” parameter in their file, this might be scheduled instead of your event. If this is the case you can manually edit their file to take the parameter out, and contact the creator to let them know.

Examples

All events Rush Hour uses are in steamappsworkshopcontent255710605590542RushHour Events. These are made the same as what is described here, and will probably give you some more information.

Also note that you can have more than one event per file. You don’t have to create a new XML file for each event you have, although you can if you want. Take a look at the ExpoCenter.xml code to see how this is done.

User creatable events

Below here are instructions on how to allow users to create events at your building. You will need to read through how to create random events, as those stages are all required for the stages below.

Additional tags

In order to make your building compatible with user creatable events you will need to add two new sections to your xml file: Costs and Incentives.

The costs set the event up so that money can be taken and given to the user. Incentives are things that either increase or reduce the attractiveness of the event to the citizens.

The first thing to do is add a few extra parameters onto your Event tag at the top of the xml file to enable user events.

<Event EventName=”BusinessExpo” BuildingName=”ExpoCenter” UserEventName=”Business Expo” Capacity=”5000″ LengthInHours=”2″ SupportsRandomEvents=”true” SupportsUserEvents=”true” CanBeWatchedOnTV=”false”>

Parameter
Meaning
UserEventName
This is the readable name of the event when presented to the user in the event selection drop down menu when selecting a building.
SupportsRandomEvents
Either a true or false value allowing you to control whether this event can be randomly created by the mod.
SupportsUserEvents
Either a true or false value you can set to allow or disallow users from creating this particular event.
CanBeWatchedOnTV
Either a true or false value which isn’t used currently. This will eventually allow citizens to go visit friends and watch the event on TV with them. Useful for events that are usually shown on TV in real life.

The Costs tag

<Costs> <Creation>1200000</Creation> <PerHead>20</PerHead> <AdvertisingSigns>5000</AdvertisingSigns> <AdvertisingTV>5000</AdvertisingTV> <EntryCost>100</EntryCost> </Costs>

Parameter
Meaning
Creation
The initial cost of your building to add an event to. Think of this as the set up cost for your event.
PerHead
This is the total cost to set up for a citizen attending the event. This is linked to the amount of tickets available.
AdvertisingSigns
This is unused at the moment, but will be the cost of placing advertising boards around the city.
AdvertisingTV
Similar to advertising signs, but on TV instead.
EntryCost
This is the cost to the citizen to enter the event. This should be higher than the PerHead cost, as this is what will be returned to the user at the end of the event.

The Incentives tag

<Incentives> <Incentive Name=”Food” Cost=”8″ ReturnCost=”15″ ActiveWhenRandomEvent=”true”> <Description>Allows citizens to buy food at the event.</Description> <PositiveEffect>0</PositiveEffect> <NegativeEffect>25</NegativeEffect> </Incentive> <Incentive Name=”Free food” Cost=”20″ ReturnCost=”0″ ActiveWhenRandomEvent=”false”> <Description>Gives citizens free food at the event. Costs more to purchase, and there’s no return on your investment.</Description> <PositiveEffect>30</PositiveEffect> <NegativeEffect>0</NegativeEffect> </Incentive> </Incentives>

Parameter
Meaning
Name
The readable name of this incentive. It can be anything you like, but will appear on the UI
Cost
The cost to buy one of this item initially before selling onto citizens.
ReturnCost
The price of a single item for the citizen to buy. This will be returned back to the user at the end of the event.
ActiveWhenRandomEvent
True or false value stating whether this should be activated when it is a random event or not. This will have no effect when it is a user created event.
Description
The description of the event when the user hovers over the item title. Keep it relatively short.
PositiveEffect
Positive effects will increase the ChanceOfAttendingPercentage by the percentage given here while the item is in stock. If for example the chances for an adult to attend is at 50% and the PositiveEffect is 30, if the item is in stock the chance to attend will increase by 30% to 65%.
NegativeEffect
Negative effects will decrease the ChanceOfAttendingPercentage by the percentage given here if the item is not in stock. If for example the chances for an adult to attend is at 50% and the NegativeEffect is 30, if the item is no longer in stock the chance to attend will decrease by 30% to 35%.
SteamSolo.com