SteamVR

SteamVR

Not enough ratings
Using the Scripted Item Test Range Asset Pack
By Rectus
The Scripted Item Test Range contains many new tools and props for SteamVR Home, now available for authors to use in their own environments using the convinient content pack feature. Here is how to use them.
   
Award
Favorite
Favorited
Unfavorite
Enabling the asset pack
The Scripted Item Testing Range contains many new tools and props, as well as a custom item spawn menu and a somewhat functional player physics and locomotion system.

To enable the asset pack, first subscribe to the workshop item.
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=929520573

Then follow the official guide on the developer wiki:
https://developer.valvesoftware.com/wiki/SteamVR/Environments/AssetPacks
Setting up the map script
If you wish to use the locomotion assets or the spawn menu, you need to add a map script to the environment. The map script is run automatically on map load as long as it is named and placed in the correct location.

https://github.com/Rectus/destinations_range/blob/master/range/scripts/vscripts/map_scripts/range.lua
Copy the above script, and place it in a text file named:
\SteamVR\tools\steamvr_environments\game\steamtours_addons\<addon name here>\scripts\vscripts\map_scripts\<map name here>.lua

The vscripts and map_scripts directories do not exist by default, so create them.

The spawn menu, player locomotion and the all menu items are enabled by default. To disable locomotion and player physics, edit the script and remove all lines with g_VRScript.playerPhysController in them. To disable the spawn menu, remove all lines with g_VRScript.pauseManager in them.

What tools and props can be spawned from the menu, and their order are determined by the SPAWN_ITEMS array. You can remove or modify the items to suit your map, or even add brand new ones in.

The custom quick inventory is always selectable from the menu. To set what items are in it by default, modify the quick_inv_items array in the MAP_PLAYER_DEFAULT_SETTINGS table. The numbers correspond to the items place in the SPAWN_ITEMS array, starting with 1 at the top. The Items are arranged left to right.

The Quick Locomotion system is also enabled by default. To disable it, remove these lines from the map script:
require("quick_locomotion")
g_VRScript.pauseManager:EnableQuickLocomotion()

The MAP_COMMANDS array allows you to set up custom buttons specific to your map. If you are not using the feature it is recommended to remove the MAP_COMMANDS parameter from the pause manger creation line below:
g_VRScript.pauseManager = CPauseManager(SPAWN_ITEMS, MAP_PLAYER_DEFAULT_SETTINGS)

To use custom map commands replace the lines in the MAP_COMMANDS array with your own. The cmd key for each command corresponds to an entry in the OnMapCommand() function in the map script, where you can implement any custom logic. The user ID of the player who triggered the command is passed to data.id.
Preparing the Panorama files (NEW)
In order to properly show text in the menu, please remove the file \steamvr_environments\game\steamtours_addons\<addon>\panorama\localization\addon_english.txt from your add-on.

If you are using Panorama localization, you will instead have to merge the contents of the file below with your localization file.
https://github.com/Rectus/destinations_range/blob/master/range/panorama/localization/addon_english.txt

Setting up the sounds
While the sounds of the tools are included in the asset pack, they require Sound Events set up for them. The sound event script for each addon overrides the ones from asset packs, so the sound events for the tools need to be added to the sound event script of your addon.

The sound event script is located here: \SteamVR\tools\steamvr_environments\content\steamtours_addons\<addon name here>\soundevents\soundevents_addon.vsndevts

If you haven't added any custom sound events, you can simply open up the script in a text editor and replace its contents with the file here: https://github.com/Rectus/destinations_range/blob/master/range/soundevents/soundevents_addon.vsndevts

If you have any custom sound events, you would need to copy all the event entries and place them into your own file, between the main curly braces.
Placing items in Hammer
When placing scripted tools and props directly into a map, the script name for the appropriate item needs to be added to the entity properties Entity Scripts key in the Misc category.



Props - prop_destinations_physics
Item
Model
Script
Paper plane
models/props_toys/paper_plane1.vmdl
prop_paper_plane
Round bomb
models/props_toys/bomb.vmdl
prop_bomb
Fireworks
models/props_toys/fireworks_rocket.vmdl
prop_fireworks_rocket
LAW Rocket
models/weapons/law_rocket.vmdl
law_rocket
Gold bar
models/props_range/gold_bar.vmdl



Tools - prop_destinations_tool
Item
Model
Script
MAC-10
models/weapons/mac10/mac10.vmdl
tool_mac10
Laser pistol
models/weapons/laser_pistol.vmdl
tool_laser_pistol
Longsword
models/weapons/longsword.vmdl
tool_sword
Spraypaint can
models/tools/spraycan.vmdl
tool_spraycan
Recurve bow
models/weapons/bow.vmdl
tool_bow
Boxing glove (left)
models/props_gameplay/boxing_gloves001_left.vmdl
tool_glove
Boxing glove (right)
models/props_gameplay/boxing_gloves001_right.vmdl
tool_glove
Gravity Gun (Remastered)
models/weapons/hl2/gravity_gun_new/gravity_gun.vmdl
tool_gravity_gun_new
Gravity Gun (Old)
models/weapons/hl2/w_physics_reference.vmdl
tool_gravity_gun
M72 LAW Rocket launcher
models/weapons/law_weapon.vmdl
tool_law
Nailgun
models/tools/nailgun.vmdl
tool_nailgun
Mare's Leg Rifle
models/weapons/mares_leg.vmdl
tool_mares_leg
Spawnpoint relocator
models/tools/player_spawnpoint_tool.vmdl
tool_spawnpoint
Entity scanner
models/tools/scanner.vmdl
tool_scanner
Flashlight (Valve)
models/props_gameplay/flashlight001.vmdl
fl_test
Flashlight (rusty)
models/props_beach/flashlight.vmdl
tool_flashlight
Sunlight adjustment tool
models/tools/sun_tool.vmdl
sun_tool



Locomotion Tools - prop_destinations_tool
Require the map script to be set up with player physics.
Turn off the Has Collision In Hand property for these.
Item
Model
Script
Multipurpose Locomotion tool
models/tools/locomotion_tool_base.vmdl
tool_locomotion
Ski pole
models/props_slope/ski_pole_tool.vmdl
tool_ski_pole
Jetpack
models/tools/jetpack.vmdl
tool_jetpack
Suction cup
models/weapons/suction_cup.vmdl
tool_suction_cup
Barnacle Grapple
models/weapons/barnacle_gun.vmdl
tool_barnacle_gun
Pogo stick
models/tools/pogostick.vmdl
tool_pogostick

12 Comments
Rectus  [author] 19 Mar, 2021 @ 9:47am 
I'm not sure, but you'd likely have to reupload it to the workshop to be able to host a room.
themarcoculus 19 Mar, 2021 @ 9:43am 
I wont be able to host public rooms because I would get flagged as someone who stole/duplicated an existing environment (will private ones, me and friends still work?) ? So, to use all the scripted items you shared, they have to be added to a brand new environment only? Sorry to bombard you with questions, this is just too exciting to create an awesome home filled with dynamics!!
Rectus  [author] 11 Mar, 2021 @ 11:44pm 
It should be possible if you extract all the environment files into a new addon, and add the scripts there. You won't be able to host public rooms though.
themarcoculus 11 Mar, 2021 @ 11:33pm 
Is it possible to incorporate all these items into an already existing environment that I subscribed to? ( I would love to have a bow/arrow in the Windwaker env!!!).
Killer in Exile 30 Jan, 2021 @ 7:38pm 
Did the update brake the map_script menu, I can't seem to get it working for new environments,
I had it working a couple weeks ago.
JAZ 29 May, 2020 @ 7:53pm 
Thanks! Everything is working and I made sure to give you credit.
Rectus  [author] 29 May, 2020 @ 1:50pm 
You need to edit the source file that's under your addons content folder, instead of the game folder. The _c file is the compiled version that automatically gets generated from the source.
JAZ 29 May, 2020 @ 1:31pm 
The tools are now working (it was an error in the file path), except for the sound. I added a temporary replacement Salien.vsnd for the Barnacle gun pickup. I noticed you specify soundevents_addon.vsndevts there is a file in the soundevents folder with that name but with _c at the end of it soundevents_addon.vsndevts_c . I can't modify it and if I delete it, it reappears.
If I open it it has: R    REDI ø DATA  2 P  ”  ¨   3 ,Ô™› soundevents/soundevents_addon.vsndevts steamtours_addons/jaztest1  $ ___OverrideInputData___ BinaryBlobArg  IsChildResource 3VK|té˜F¯òæ>µ7ç 
  P Ýîÿ
JAZ 24 May, 2020 @ 5:12pm 
It wasn't the menu. The only error I get is WARNING: No 'models_ModelDocGameData' FGD was specified in the 'ModelDoc' section of gameinfo.gi When have time, I'll have to try it in an empty map to see if something in mine is interfering with it.
Rectus  [author] 24 May, 2020 @ 3:10pm 
If you copied over the range map script, it should already have set up everything for the locomotion using tools. Check that you aren't trying to move with the menu open, other than that, there might be clues in the dev console.