-
-
Notifications
You must be signed in to change notification settings - Fork 15
Billboard Implementation Guide
Global guide on how to Implement a Billboard that updates based off of a set list of string parameters in Project OST.
Use this guide to learn how you can add your own stuff to Project OST
String parameters can be things like "[Name] or [Price]"... etc.

Naviage to TycoonStomper/cc/ci.verse
This interface will be used to toggle the visibility of our BillboardDevice
- Naviage to
TycoonStomper/cc/ci.verse - Create a new interface called LogicalVisibility
- Add 2 public Show and Hide methods

This interface will be used to return a map of items such as
"[Name]" => "{Name}"Later we'll build a function that takes this map and converts it to its real value.
- Add a public GetStringParams method that returns a map of [string]string

This interface will be used to build out our billboard_main class and to define its StringReturnable list such as
"[Name]" => "{Name}"
- Add a public Initialize Method that takes a StringReturnableInterface

Navigate to TycoonStomper/cc/cf.verse
-
This function will be used to fetch [string]string values from anything wtih the StringReturnable interface implemented.
-
This will then convert these values to their real values. I.e
Input: "Hi I'm [Base]" => Output: "Hi I'm ExampleBaseNameHere" -
First we need to find every [] inside a string, then fetch the StringReturnables map and get the Value assocaited with the Key we found between the []
-
For example if the value between the brackets is Name then we need to go to our StringReturnable map and input Name as the Key
-
Then if there is an associated value to this Key we'll then replace whats inside the brackets with this value
-
Then we need to delete the brackets
[]and update our current string value. -
If we can no longer find any [] then we'll simply return the current string value.

- I set a CurrentString variable so I can modify the all current outputs
- I then check and ensure the string length is >= 1 so our other if's wont fail
- Then I get the StringReturnables interface implementation and check the params.
- For example if a base was parsed it would return something like
{"[Name]"=>Name, "[ID]"=>UniqueID, "[Players.Length]"=>"{Players.Length}", "SizeLimit"=>"{SizeLimit}", "[Status]"=>"{Status.ToStr()}"}remember you can only parse something that implements the StringReturnables interface like a base purchaseable. - Next I loop and check for any chars' that have "[" or "]" .Find method returns the first index.
- Then I slice a new array from the start of [ and then end of ]+1 since the end value prior to the index specified. I call this
Value - Then I specify a
FoundValue= where I fetch the CurrentParams and parse theValuekey which will return the specified associated value such asMy Example Base Name - Then I create a
FinalStringwhich removes the brackets and then goes to where the[was originally and inserts theFoundValue - Then I update the Current string to be equal to the
FinalString - And loop again, and if any brackets aren't found it simply breaks out of the loop and returns the newly made CurrentString
Navigate to TycoonStomper/cc/cc.verse
Create a new public Insantiate method inside billboard_main where you fetch the Owner, set a variable = GetStringParamaters > parse the Text & owner, then update the text with said variable!
-
For the superclass navigate to
TycoonStomper/Purchaseables/superclass.verse- Add an editable called BillboardConfig of type
billboard_main

- Under Initialize add BillboardConfig.OnBegin(-1) & BillboardConfig.Initialize(Self)

- Under InitializeChildren add BillboardConfig.Instantiate() (Initialize children is called when an Item is either Unlocked during the game or was Unlocked by default)

- Add an editable called BillboardConfig of type
-
For a base navigate to
TycoonStomper/cc/cc.verse- Under base_setup add a BillboardConfig of type billboard_main

- Initialize the config

- Navigate to
TycoonStomper/BaseManager.verse - Under AwaitBaseClaim call Baes_Setup.BillboardConfig.Instantiate()
- Create a new check for how many players remain in the base, if its more than the limit Hide the Config.

Need Help? If you run into any issues or have questions, feel free to join our Discord Server for support.
