News Liste Project 5: Sightseer

Twitch Integration
Project 5: Sightseer
22.08.19 22:38 Community Announcements
The game features a rich Twitch integration that allows viewers to influence the game's events, but how to use it, one might ask? Well, here's a detailed description.

SETUP

[olist]
  • While on the game's main menu (before starting your world), click on the gears icon on the top left to bring up the options.
  • Enter your Twitch Channel name. For example, if your channel is https://www.twitch.tv/abcdef, you would enter "abcdef" (without the quotes) and hit Enter. Doing so will open up additional options.
  • Enter the username you wish to use. It can match your channel name, but it can also be the username of your bot you wish to use.
  • Go to https://twitchapps.com/tmi/ to get your OAUTH token, and enter it in the OAUTH field. This should be the full token, for example: "oauth:ou99kxgkh12cgdbv3h4mieyj5yowqr". The OAUTH token is what allows the game to talk back to Twitch viewers on your behalf.
  • Enable the Interaction option, and if you wish -- the Chat option as well. Interaction is what allows the game to respond to keywords in Twitch chat, while Chat allows your game to display Twitch chat in the in-game chat window. Both can be toggled from within your game later.
  • Play the game! You can test the functionality by using the !p5 command in Twitch chat (but this won't work if you do it from the same account as the "username" from the step 3).
  • [/olist]


    COMMANDS


    Your viewers will have the ability to use the following commands, which can be both used in public, as well as PM'd to the 'username' from step 3, above:
    • !p5 -- Messages the viewer the list of usable commands.
    • !points -- Shows how many points the viewer has accumulated. Viewers automatically start to accumulate points once they speak in chat or use one of the commands. Each of the following actions costs points to use.
    • !voice -- 18 points. Plays a random voice over and puts the viewer in combat for 30 seconds.
    • !loot -- 30 points. Spawns a random upgrade for the streamer somewhere nearby and shows an alert with the name of the viewer that has done so.
    • !trader -- 60 points. Creates a neutral trader NPC that will fly up to the streamer. This NPC, like all NPCs spawned by the commands here, will have the name of the viewer that used the command.
    • !pirate -- 60 points. Spawns an unfriendly NPC that will fly up to the streamer and either attack outright (if a weapon is equipped), or offer to be bribed (if no weapon is equipped).
    • !encounter -- 60 points. Creates a random encounter. This can be a pirate, a trader, or a random quest. Like all encounters, it will vary with the level and weapon loadout of the streamer's vehicle.
    • !ufo1 -- 30 points. Spawns a Tier 1 UFO that will float around nearby, behaving like they usually do -- without a particular purpose.
    • !ufo2 -- 60 points. Spawns a Tier 2 UFO that will fly around, scanning loot and attacking anyone that dares to touch it near them.
    • !ufo3 -- 120 points. Spawns a Tier 3 UFO.
    • !revive -- 6 points. Revives the streamer after they have been defeated in combat. Good thing Twitch viewers are nice and will ever chain-revive the streamer with hostiles nearby just to watch them die again and again.
    • !buff -- 20 points. Places a buff on the streamer's vehicle that will instantly heal the streamer if they happen to be defeated, giving them another chance. The buff lasts 60 seconds. Only works if used while the streamer's vehicle is still alive, but can also be used after a !revive.
    • !troll -- 120 points. This... is an unpredictable one. Let's just say its name is well deserved and leave it at that... :) Regardless of the outcome of this command, it will also create an item for the streamer somewhere nearby. Just to be nice.

    Note that all NPCs created by viewers will have their name, so the streamer will know whom to thank (or yell at!) :)

    In addition, if the Streamer is in a Combat Simulation, new additional commands open up:
    • !healer -- 27 points. Spawns a healer NPC to follow the streamer.
    • !support1 -- 9 points. Spawns a supporting (friendly) NPC to help the streamer.
    • !support2 -- 27 points. Spawns a stronger version of the friendly supporting NPC.
    • !attack1 -- 9 points. Spawns a hostile NPC to try to kill the streamer.
    • !attack2 -- 27 points. Spawns a stronger version of the hostile NPC to try to kill the streamer.

    MORE


    In addition, the Streamer can choose to award points to any viewer at any time by using the /award ViewerName # command in game's chat. For example, /award ArenMook 50. You can use this command as a thank you for viewer donations and subscriptions.

    /setServer twitchCD = 0.5 -- This command lets the server admins control the cooldowns on Twitch commands (as they all have innate cooldowns so they can't be spammed). '0.5' in this case would make them usable twice as often. '2.0' would mean the opposite -- half as often. Default is '1'.

    /setServer twitchCost = 0.5 -- This command lets the server admins to change how many points the abilities cost. '0.5' would mean that a 120 point command will cost 60 points instead. Using '2.0' here would have the opposite effect (240 points). Point accumulation rate remains unchanged, so you can control how often players can use abilities by adjusting this value. Default is '1'.

    /setServer streamerMode = false -- This command lets the server admins to turn off Twitch integration on the server. For example, it's currently disabled on the Tasharen's PvP server.

    /setServer time = 1220 -- This command lets the server admins to freeze time at the specified value. This is very useful for streamers, as the world tends to get very dark at night. Freezing the time close to sunrise/sunset will look spectacular, and will let viewers see what's going on better. The '1220' is an offset in hours, in this case, so you will likely need to adjust it by a few hours (for example 1215) to get the desired angle of the sun.

    Questions? Comments? Stop by Tasharen's Discord. I hope you and your viewers will find the Twitch integration to be as much fun as I've had adding it. :)

    -Aren