Portal 2

Portal 2

Project Capture Legacy - Part 3
[ENG] Interesting and useful console commands for the Project Capture 3 and 4 maps
An important lyrical digression! Some console commands in subsequent updates may be inoperable, and some may break the script completely.
So that no one has any questions, we will write the syntax below to make it easier:
<command>
(what values can there be here)
  • Default: <Default value>
  • <Command comment >
  • Notes: <Note to the command >
Now, I hope we are fully ready, have fun!


Commands for the Project Capture maps
Commands:
ent_fire @fstop.h runscriptcode "_scaling_enable_ = true"
(true, false)
  • By default: -
  • Forcibly turns on or off scaling, even in the third part!
  • Notes: -
ent_fire @fstop.h runscriptcode "_mirror_enable_ = false"
(true, false)
  • By default: -
  • Perhaps is a new mechanic from new parts about reflections and mirrors.
  • Notes: Does not work, may work in future parts.
ent_fire @fstop.h runscriptcode "chromatic_aberration = true"
(true, false)
  • Default: true
  • Responsible for the hologram effect. You can turn it off if necessary.
  • Notes: -
ent_fire @fstop.h runscriptcode "max_photo = 2"
(0;+∞*)
  • By default: 2
  • You can change the limits on the number of cubes photographed.
  • Notes: *The maximum number is not exactly known.
ent_create_pcapture_cube
(none, *_2, *_3)
  • By default: -
  • Allows you to spawn the cube.
  • Notes:
ent_create_pcapture_cube
^ Standard.
ent_create_pcapture_cube_2
^ Large.
ent_create_pcapture_cube_3
^ Huge.
    It is impossible to spawn a cube smaller than the standard one, because the author broke the commands:
ent_create_pcapture_cube_0.4
^ Less.
ent_create_pcapture_cube_0.7
^ Tiny.
    And also, the usual cube is transparent, because the author is still a hack.Source code of the teams who really need:
ent_fire @ent_create_pcapture trigger
^ Standard.
ent_fire @ent_create_pcapture fireuser1
^ Large.
ent_fire @ent_create_pcapture fireuser2
^ Huge.
ent_fire @ent_create_pcapture fireuser3
^ Less.
ent_fire @ent_create_pcapture fireuser4
^ Tiny.
    Accordingly, the last two are broken. It is possible that future versions will be repaired.
ent_fire @fstop.h runscriptcode "SetTickRate(60)"
(30, 60)
  • Default: 60
  • Responsible for the smooth operation of the script.
  • Notes: You can set only 30, or only 60. Should not affect the gameplay. Put 30 if you are experiencing performance problems.
ent_fire @fstop.h runscriptcode "tick = 0.03333"
(seconds)
  • Default: 0.03333
  • Responsible for the speed of the script in seconds.
  • Notes: The more - the slower, the less - the faster. It is not recommended to set too low values and change them at all. Will negatively affect the script!
ent_fire @fstop.h runscriptcode "camera_mode_hint_once = true;placement_mode_hint_once = true;turn_placement_mode_hint_once = true;two_photo_in_placement_mode_hint_once = true;zoom_in_hint_once = true"
(true, false)
  • Default: true
  • Responsible for displaying hints.
  • Notes: Edit the values individually for each, focusing on the name. If you want to disable all hints, replace true with false everywhere.
ent_fire @fstop.h runscriptcode "motion_smooth = 0.5"
(0 - 1)
  • Default: 0.5
  • Responsible for the smoothness of the placement.
  • Notes: 1 - No smoothness, 0 - No movement. The smaller - the smoother, the more - the faster.
ent_fire @fstop.h runscriptcode "smooth_scaling_type = 2"
(1, 2, 3, 4, 5, 6, 7, 8)
  • Default: 2
  • Responsible for the type of scale.
  • Notes: 1 is linear, the others - the larger the value, the smoother, however, this is not accurate.
ent_fire @fstop.h runscriptcode "ToggleWeapon(true,0)"
(true, false)
  • By default: 2
  • Via the console, you can switch from the placement to the camera and back. true - placement, false - camera.
  • Notes: It will not be possible to set through the bind, because there are quotes in the command, and source engine does not like this. How to solve such problems will be discussed later.
ent_fire @fstop.h runscriptcode "place_obj = null"
(none)
  • By default: -
  • Allows you to freeze the hologram of the cube in place.
  • Notes: Repaired by re-enabling the placement.
ent_fire @fstop.h runscriptcode "Clean(true,null)"
(none)
  • By default: -
  • Erases cubes in the inventory.
  • Notes: -
ent_fire @fstop.h runscriptcode "pcapture_start_story()"
(none)
  • By default: -
  • At the very beginning allows you to skip the questionnaire.
  • Notes: May break something!


Custom commands written by me.
Note that for some to work correctly, you must enter:
sv_cheats 1

Commands:
ent_fire @fstop.h runscriptcode "mouseignore = true;_can_selweapon_ = false";impulse 101
(none)
  • By default: -
  • Correctly issues a portal gun.
  • Notes: If you specify when placement is enabled,
    there will be visual bugs, which can lead to a crash!
use "weapon_cubemap";ent_fire @fstop.h runscriptcode "mouseignore = false";ent_fire @fstop.h runscriptcode "_can_selweapon_ = true"
(none)
  • By default: -
  • Correctly changes the portal gun back to the camera.
  • Notes: -
ent_fire @fstop.h runscriptcode "SetTickRate(30)";ent_fire dynamic_light kill
(none)
  • By default: -
  • Slightly stronger improves performance.
  • Notes: The light may behave strangely .


Now a couple of interesting facts.
  • The gLess modifier cannot be turned on or off, because it is completely hammer mechanics.
  • It is impossible to fix the bug with the issue of the gun and the placement turned on, because you cannot instantly change the mode without animation, then you would have to enter twice. Due to the built-in scale binding, the gun zoom also does not work. And also the author of well done and prescribed a command for instant change not with the value 1 or 0, not true or false, and variable, yes, not simple, but in quotes, because of what the console swears, even if through configs. (but more on that later)
  • The cards on the release in the workshop were all broken by the workshop, and because of this, everyone had individual problems solved and manifested by restarting.
  • Judging by the code, it is clear that the mechanics of reflections will be strictly on reflective surfaces, and how it works was demonstrated in the Discord server.
  • Portal gun adequately work with placement and camera:(
  • You can hide the camera with the command:
    r_drawviewmodel 0
  • The gLess modifier works with the portal gun too.
  • It is now possible to display the script's debug information via:
    developer 1


And so, it's time to start the shrink...
How to bind any of the commands to the button?
Configs. You will have to write your own config for each of the commands. Using the example of custom commands, we will try to put their shift on one button.
How to do it? In the folder:
".../Steam/steamapps/common/Portal 2/portal2/cfg"
Creating a .cfg file. (create .txt and rewrite manually) You throw in your own command for each file.
In my case:
  • pc_camera.cfg - Contains a command for the camera.
  • pc_gun.cfg - Contains the command for the cannon.
And now the most difficult thing, we write a bind for a single button:
alias "pc" "pc_camera";alias "pc_camera" "exec pc_camera; alias pc pc_gun";alias "pc_gun" "exec pc_gun; alias pc pc_camera";bind q "pc"
Don't ask, I don't know myself, but it works.
In this case, the bind is written to the q button. If you want another button, change it at the end of the command.
We throw it into another .cfg file with any name, in my case pc_toggle. Then go to the map and enter:
exec pc_toggle
Voila, now we can switch weapons to a given button!
If you want to execute one specific command, then just drop it into a .cfg file and write the exec bind in its name. ex:
bind key "exec filename"
I do not hide it, perhaps there are simpler methods of solution.
Last edited by | L I C A | N I T E |; 7 Jan, 2023 @ 9:45am