Jump to content

[KSP 1.2.X] Draft Twitch Viewers v2.4.6 - Draft, tour with, or rescue your twitch viewers as in-game Kerbals!


IRnifty

Recommended Posts

FtqXphU.png

Draft Twitch Viewers

v2.4.6: Release

This software is provided "as-is" with no warranties.

Presented under the GPL v3 license.

Creation and/or publication of media (images, videos, etc.) while using this software is authorized.

Created by: Nifty255

Copyright 2015 All rights reserved.

This mod is in RELEASE. However, bugs can still happen. If you have a bug, or a suggestion, please leave it in a mature manner.

 

DOWNLOAD: SpaceDock OR GitHub

SOURCE: GitHub

Get DTV on CKAN!

 

 

FEATURES:

Draft Twitch Viewers (DTV) uses web requests to connect to Twitch, and can pick a random user from any channel, and create a Kerbal in-game with that viewer's name.

 

 

- Easy to use interface.

- Draft from any channel, specified in the GUI. Or launch a viewer drawing without adding the winner to the game!

- While getting the channel viewer list, DTV can remove bots (specified by the player/streamer) and viewers with distasteful names.

- Upon attempted draft, an alert is displayed in-game indicating success or failure.

- Customize the draft success message and the drawing success message.

- Fully compatible with both Crew Manifest and Ship Manifest.

- Players can add the viewer directly to the current vessel.

- Rescue your viewers or take them on tours with DTV modified Career Mode Contracts!

 

CHANGELOG:

 

v2.4.6:

- KSP 1.2.1 compatibility update.

- Added a now required client ID to all Twitch web API requests.

 

v2.4.5:

- Fixed bug with job setting.

 

v2.4.4:

- DTV now ensures the player can afford a draft in career mode.

 

v2.4.3:

- Corrected career draft cost.

 

v2.4.2:

- Fixed bug which caused the draft app to blank out on the flight scene.

- Fixed bug which caused scene switching issues after entering one save, leaving, and then entering another.

 

v2.4.1:

- Modified DraftKerbal method to invoke success using a generic Dictionary instead of a specialized DraftInfo object.

- ScenarioDraftManager now destroys itself when returning to the main menu (and reloads when entering another save) to prevent potential load/save issues.

 

v2.4:

- Drafts are now saved directly to each save's persistent file, allowing reverts to free drafted names.

- An upgrade system was left in place which will migrate pre-existing drafts over to the new system.

- Fixed drafting for specific jobs still yeilding Kerbals with random jobs.

- Changed the Quick Draft hotkey to Alt+Insert.

 

v2.3.2:

- Made the Quick Draft hotkey togglable.

- All settings except for the "Bots to Remove" list now autosave when changed.

 

v2.3.1:

- Incremented version info.

 

v2.3:

- KSP 1.1 PRE-RELEASE Kompatibility Update. BUGS ARE EXPECTED.

- Fixed a UI bug which mishandled window positioning on >1080p resolutions.

- Due to inkompatibilities, right clicking the app icon no longer drafts.

- Alt+D is the new drafting shortcut.

 

v2.2:

- All compatible contracts can now be retroactively modified to include drafted viewers.

- Careeer Mode Tourism Contracts are now modified by DTV to replace stock Kerbals with drafted viewers.

- When a tourism contract is offered, DTV silently drafts and replaces the old Kerbals with the new.

- The DTV contract system will deactivate after 5 consecutive failures and notify the player.

- The DTV contract system will skip a contract if there is no channel name and notify the player.

- NOTE: DTV can have up to 4 times the usual delay because tourism contracts can have up to 4 tourists.

- NOTE: Unknown results can occur if a contract is accepted before it can be modified. A fix is in the works.

- NOTE: To alleviate the above issue, modified contracts show a pre-completed "Modified By DTV" objective.

 

v2.1.3:

- Fixed the Draft Manager App not saving at all.

 

v2.1.2:

- Fixed improper saving of the "Add Kerbal to Craft" setting.

 

v2.1.1:

- DTV's Draft App now toggles visibility with the game UI.

 

v2.1:

- Careeer Mode Rescue Contracts are now modified by DTV to replace stock Kerbals with drafted viewers.

- When a rescue contract is offered, DTV silently drafts and replaces the old Kerbal with the new.

- The DTV contract system will deactivate after 5 consecutive failures and notify the player.

- The DTV contract system will skip a contract if there is no channel name and notify the player.

- NOTE: Unknown results can occur if a contract is accepted before it can be modified. A fix is in the works.

- NOTE: To alleviate the above issue, modified contracts show a pre-completed "Modified By DTV" objective.

 

v2.0.1:

- Downgraded target framework from .NET 4.5 to 3.5 to fix mod integration issues.

- Added parameter which can suppress drafts being saved.

- Suppressed saves allow for situations in which it is unclear whether or not the drafted viewer will be used.

- If an unsaved Kerbal will be used, the draft caller can save the name manually through "SaveSuppressedDraft".

 

v2.0:

- Large code refactor to allow for third-party mod integration.

- Settings reworked for consolidation and added stability.

- Added error handling to the web side of the draft system.

- Removed unnecessary "using"s to clean up code.

- Performing any draft or drawing saves the current settings.

- Made the alert window slightly larger.

 

v1.1.4:

- Added ability to add drafted Kerbals directly into the craft.

- The option to add directly into crafts is togglable in the Customize menu.

- Kerbals can be added into any part with available seating, simply by clicking it.
 

v1.1.3:

- Fixed bug which prevented the DTV App from appearing in the flight scene.

 

v1.1.2:

- Added version label to the bottom of the App window.

 

v1.1.1.1:

- Fixed "Kerman" toggle and custom messages not loading from file.

 

v1.1.1:

- Added toggle for adding "Kerman" to the end of Kerbal names.

 

v1.1:

- Added "Do a Viewer Drawing" which picks a random viewer independent of the draft.

- Viewers pulled for a drawing are stored in its own list to prevent repeat pulls.

- Added "Empty Drawn User List" button which resets the list and allows repeat pulls.

- Added ability to draft viewers of specific jobs.

- Users can still draft viewers, accepting any job.

- NOTE: Drafting for specific jobs may take longer and may fail on low-viewer channels.

- NOTE: The default action for right clicking is to draft with any job.

- Added fund requirement for users in career mode just like normal hiring.

- NOTE: KSP 1.0.2 displays a false hire cost in the Astronaut Complex. DTV shows the correct amount.

 

v1.0.5:

- Users already drafted are now removed before randomly drafting, skipping them completely.

- The list of users already drafted is stored in individual files for each game save.

 

v1.0.4.1:

- Fixed icon duplication bug.

 

v1.0.4:

- KSP 1.0 "Kompatibility" update ;3

 

v1.0.3:

- Fixed weird audio panning effects.

- Set draft audio to the game UI level.

 

v1.0.2:

- Removed twitch login requirement.

- Mod no longer posts to twitch chat.

- Mod now requests a user list, parses the list, and then drafts as usual.

- Mod now plays sounds on draft button click, draft success, and failure.

- Added username filtering which removes vulgar usernames form the draft.

- Right clicking the app launcher button will automatically draft a Kerbal.

- The draft alert now shows the drafted user's skill type.

 

v1.0.1:

- Fixed App window bug on resolutions other than 1080p.

- Fixed Draft alert window always showing "Draft Failed".

 

v1.0:

- INITIAL RELEASE

Edited by IRnifty
Link to comment
Share on other sites

Hey guys :) unfortunately KS -> ckan is not automatic, someone from the team needs to review and accept the metadata first. We are doing our best to keep up but lately we are all really tangled with real life... :(

Link to comment
Share on other sites

Hello,

I was lookin thru my AI Bot research and this popped up...cute ! I plan on streaming it for testing today !

Edit: Where the instructions ?! I created a Twitch Bot; grabbed it's API and transferred it to the screen in KSP; username is my Twitch Bot (?) and added my stream channel; your program which sounds like its a bot as it is connecting to a channel on twitch (like nightbot), is not connecting; so I am just wondering if your program is a twitch bot and we need to ues IT's Channel name for the Username?

Cmdr Zeta

Edited by Cdr_Zeta
Link to comment
Share on other sites

My mod is not a bot in and of itself. It requires your own bot to log into a channel. You will need the bot's username, exactly as you spelled it, the API key (you can click a button inside the mod to get that), and a channel to join (which MUST be lowercase). Click connect, and you should be good!

Link to comment
Share on other sites

Updated! v1.0.2:

- Removed twitch login requirement.

- Mod no longer posts to twitch chat.

- Mod now requests a user list, parses the list, and then drafts as usual.

- Mod now plays sounds on draft button click, draft success, and failure.

- Added username filtering which removes vulgar usernames form the draft.

- Right clicking the app launcher button will automatically draft a Kerbal.

- The draft alert now shows the drafted user's skill type.

Link to comment
Share on other sites

Updated! v1.0.2:

- Removed twitch login requirement.

- Mod no longer posts to twitch chat.

- Mod now requests a user list, parses the list, and then drafts as usual.

- Mod now plays sounds on draft button click, draft success, and failure.

- Added username filtering which removes vulgar usernames form the draft.

- Right clicking the app launcher button will automatically draft a Kerbal.

- The draft alert now shows the drafted user's skill type.

I think the bold one make's the mod instructions "idiot proof" <-- (mostly)

Link to comment
Share on other sites

Hi,

I got it to work last night...tho I could not see where the drafted viewer went; they didnt show up anywhere not even in an empty seat ! I may be missing something again.

I downloaded Crew Manifest to see if that was required to do anything with the draftees or if they show up in there 'only'; are the draftees persistent or only one time? IE if you use them and revert are they still located somewhere?

On the API call I still had to manually write in the API; I take it this was necessary as I could not copy or paste nor could I add the API in the box after the call.

Kool Mod Thank You !!

Cdr Zeta

Link to comment
Share on other sites

  • 2 weeks later...

I was trying to use this on linux when I try to draft a twitch viewer I get the following error message:

[EXC 22:27:18.421] ArgumentOutOfRangeException: Argument is out of range.

Parameter name: startIndex

System.String.Substring (Int32 startIndex)

DraftTwitchViewers.DraftManagerApp.ParseIntoNameArray (System.String toParse, System.String parsingFrom)

DraftTwitchViewers.DraftManagerApp+<DraftIntoKrew>d__1.MoveNext ()

If you need anything else I'll be happy to provide anything you need.

Link to comment
Share on other sites

  • 1 month later...

Nifty! I have a feature request and a question, sir!

Could you make an option box so that it would select from subscribers only?

In career mode, do drafting viewers cost Kerbucks to hire? If not, could you make it so it scales like hiring them out of the astronaut complex?

Link to comment
Share on other sites

scerion, I unfortunately don't know how to determine the subscriber status of a viewer, and I'm actually working on changing the behavior of the mod in Career such that, instead of drafting directly into your Krew, it will fill the applicants roster with viewers every time you go into it. If you have any design advice on how you'd like that to work, let me know!

- - - Updated - - -

Updated! v1.0.5:

- Users already drafted are now removed before randomly drafting, skipping them completely.

- The list of users already drafted is stored in individual files for each game save.

Link to comment
Share on other sites

Hmm would this help for the sub issue?

https://github.com/justintv/Twitch-API/blob/master/v3_resources/subscriptions.md

Also not sure how thetwitch api shows it, but when viewing users via chatty it has an icon in front of their name. If that shows up in the twitch api like that, then should be kinda easy to determine? just search and limit to that symbol.

Ohhh so in career it wouldn't include any random named ones just ones from your channel? What if you don't have enough folks in your channel? still would pull random named kerbals?

Link to comment
Share on other sites

  • 4 weeks later...

Updated! v1.1:

- Added "Do a Viewer Drawing" which picks a random viewer independent of the draft.

- Viewers pulled for a drawing are stored in its own list to prevent repeat pulls.

- Added "Empty Drawn User List" button which resets the list and allows repeat pulls.

- Added ability to draft viewers of specific jobs.

- Users can still draft viewers, accepting any job.

- NOTE: Drafting for specific jobs may take longer and may fail on low-viewer channels.

- NOTE: The default action for right clicking is to draft with any job.

- Added fund requirement for users in career mode just like normal hiring.

- NOTE: KSP 1.0.2 displays a false hire cost in the Astronaut Complex. DTV shows the correct amount.

Link to comment
Share on other sites

  • 3 weeks later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...