BEE2-items icon indicating copy to clipboard operation
BEE2-items copied to clipboard

Enable paint gun in base Portal 2

Open vrad-exe opened this issue 2 years ago • 11 comments

Aperture Tag's workshop is currently broken, as its binaries were never updated to support workshop item IDs greater than 2^31. The vote screen doesn't work, multiverse cave gets stuck repeating the same lines, and playing coop maps fails entirely because it can't verify that both people have the map downloaded. The Aperture Tag developer has been told about this but seems to have no intent to fix it, so I think we need to just take this into our own hands by bypassing Aperture Tag entirely and enabling the paint gun to be used in standard Portal 2.

What needs to be done

  • Remove the hardcoded game restriction from the paint gun logic in the precompiler, so it can be used in other games. (If we support other games later and need to disable it for those, we can just do it with conditions)
  • The paint gun should be rebuilt using VScript so we're not using the original Aperture Tag logic, and just to make it cleaner and easier to expand on
  • Since Aperture Tag is a paid mod I don't think we should reuse any of its assets, so someone would need to make new textures/models for the paint gun itself, activation fields, and the corresponding signages.
  • We could look into allowing you to have both guns, but switching between them would have to be tied to crouching or something, since we can't bind a new key for that.
  • We'd need to add a way to set whether your map is a portal gun or paint gun map, there are 4 ways I can think of to do that:
    • Automatic: If paint gun activation fields are in the map, it automatically becomes a paint gun map. This has the advantage of being straightforward, but isn't very expandable (e.g. if we want to allow swapping between paint/portal guns in the same map, how do you enable that?)
    • Entry Door Properties: Have properties on the entrance door that set the type of map it is (portal gun, paint gun, both guns). This would allow us to add/change the properties later on if needed, but it's not really obvious what they do without testing them (remember, players can't see the entrance door item description unless they have unlock default items enabled)
    • Separate Item: Add a "map settings" item that lets you choose which guns the player can use. This is more obvious but has the disadvantage of taking up a palette slot.
    • In BEE2 App: Put the paint gun settings in the BEE2 app as stylevars, itemvars or the like. Problem with this is it's no longer tied to the map itself, you'd have to use "save settings in palettes" and re-export whenever you want to switch between editing portal gun and paint gun maps
  • Since the portal gun model would no longer be a paint gun by default we'd have to override it manually. For the first person model this is doable with VScript model overriding, for third person that doesn't work so we'd have to set the gun to not render, then replace it with a prop_dynamic_ornament version
    • Alternatively we could look into using weapon_portal_base, which would solve the model problem by making it a separate weapon entirely. We'd need to make sure weapon scripts are packable though (they should be?)
  • Coop would work the same where one player has a paint gun and the other has a portal gun, except we should enable the ability for players to choose who has which one. Maybe even allow swapping guns mid map by walking up to the other player and pressing +use (like the cut 2guns mechanic)

vrad-exe avatar Feb 13 '23 23:02 vrad-exe

The third reason there is indeed why I didn't originally allow it to be used in base Portal 2. I have been thinking about whether we do need a page in the app to control which guns you spawn with, this would be another usecase. For the fields we could enhance them a fair bit, add in several colours to show which gels you're getting access to. Also expand it, add the ability to grant the player any combination of gels.

TeamSpen210 avatar Feb 14 '23 02:02 TeamSpen210

What do you mean by any combination of gels, like allowing it to also include conversion/reflection/cleansing types? How would you switch between all of those, we can't bind additional keys for next/previous paint.

vrad-exe avatar Feb 14 '23 03:02 vrad-exe

I was thinking of three possible modes:

  • Manually assigning two gels to the left/right buttons.
  • Putting cleansing gel in either slot if it’s disabled.
  • Using right click to cycle a single gel.

TeamSpen210 avatar Feb 14 '23 07:02 TeamSpen210

It's also difficult to figure out how to expose all this in the UI, I'm not sure how you'd assign specific gels to each slot - again if we do a UI for that in the app, it would be global instead of map specific. We really need a way to be able to know what map the player is currently editing, did you ever try implementing the thing with reading the autosave files?

vrad-exe avatar Feb 14 '23 07:02 vrad-exe

Here's an idea: Essentially, take the "we can't bind additional keys for next/previous paint", and throw it out the window by somehow packing and executing .cfg files into maps, and binding [ and ] to commands that use ent_fire to trigger relays (or vscripts or whatever) that swap both gels, in this looping order: Repulsion + Propulsion -> Conversion + Reflection -> Cleansing + Cleansing.

So absurdly stupid that it just might work. But I wouldn't be surprised if you already thought of that.

slambo311 avatar Mar 15 '23 18:03 slambo311

I mean, we physically can bind new keys by just running bind commands through VScript or whatever, but it's considered a very bad practice because you're forcing the user to have a specific thing bound to those keys - it'll override anything else they might have bound there, and can't be rebound unless they know about the console (and even if they did that, it'd just get switched back the next time they played another BEE map since we have no way of knowing if they have it bound to another key).

Additionally, ent_fire is a cheat which means it can't be used in Coop without sv_cheats enabled.

vrad-exe avatar Mar 15 '23 20:03 vrad-exe

It's also entirely useless for people who want to use a controller, are playing on a Steam Deck, etc.

TeamSpen210 avatar Mar 15 '23 22:03 TeamSpen210

Also unsure what should happen with the existing Tag support, if we should keep it in place (some things would need to be handled differently like the portal/paint gun models) or just drop it once that's merged into the base game.

vrad-exe avatar Mar 16 '23 06:03 vrad-exe

YES!

dsagfa avatar Oct 09 '23 07:10 dsagfa