How to modify your maps for the upcoming workshop
But there's something I don't quite understand. The tutorial says you have to use the standard elevator exit logic instances, but i've got like 2 heavily modified ones because some stuff happens at the elevator which is difficult and don't want to throw em away and have to do all that work on the new ones.
In the intro level on my campaign, you are sucked into the elevator and it has lots of differnent push triggers for that and it actually triggers the end level inside the elevator (without starting to move it first)
I have done the following things to my intro departure elevator logic:
to the e_starter logic relay I added
output: OnTrigger
Target entity: core_workshop_integration (which is the fix up name for the pti global ents instance
Target input: instance:@relay_pti_level_end:Trigger
BUt if I play the level it doesn't show up the rating menu.
Am I doing something wrong ? Should I fully upload it to the workshop in order for this menu to work ?
thx
The trigger to end your map only works after you published your map in the workshop. Upload it and everything should work
Oh, maybe i should make a new topic for it but I don't want to cause too much clutter so I ask here. Does anyone have experience packing up the /media folder with bzip ? Will embedded movies work that way ? Otherwise it'd be a good test if I try to port an example map like this.
CosmicD wrote:
ah, thanks. I'll try that with a demo map of my campaign. I also must bzip all the custom glados sounds and materials that I have.Oh, maybe i should make a new topic for it but I don't want to cause too much clutter so I ask here. Does anyone have experience packing up the /media folder with bzip ? Will embedded movies work that way ? Otherwise it'd be a good test if I try to port an example map like this.
I've tried it before with pakrat, same difference: unfortunately it doesn't work 
However with workshop integration I would reach more players with these maps. Dilemma. Perhaps hoping for a post <Holiday Name Here> miracle of valve fixing this up and allowing to include media in bsp's would be nice.
CosmicD wrote:
that sucks. I've had some custom movies made and the campaign would be slightly unpolished if I can't include them. I had the same problem back when the vpk packaging still worked, so I went for the "sourcemods" solution.However with workshop integration I would reach more players with these maps. Dilemma. Perhaps hoping for a post miracle of valve fixing this up and allowing to include media in bsp's would be nice.
I tried poking a few valve people before, for similar things, but most of them left the portal 2 team and went to work on different projects, so I don't know if that's a realistic possibility 
The nasty workaround might be transforming the movies into an animated texture...
Please subscribe to this test map and check.
I assume you know how to pack the rest of custom stuff using pakrat's automatic scan feature, so I'll only explain how to pack the video (the same goes for scripts) manually:
- Ofc you'll need pakrat

- It's very important to have pakrat well set-up, so go to File > Preferences, indicate where your portal2 game directory is, select "Ask" in the dialog box beside "Path fixup on add file", and make sure you have everything below checked like so:

- Click the "Add" button and use the browser to go to your portal2/media folder. You'll see that no video file is appearing at first, this is because below, by default, you are searching for "All valid pak files", so you'll have to choose "All files" instead, like so: (mine is in Spanish, so it says "Todos los archivos"
)

Then your video files will appear.
-
After you select the video and click "Accept", the program automatically will ask you (because we said it to ask us about fixing up the path on adding files) if you want to fix up its path into the bsp, now you have to say YES.
-
You can check the file is perfectly embedded into the bsp if in pakrat you go to "View" and select "As Tree". Your .bik file should be located into a /media folder inside the bsp.
-
Don't forget to save your file by going to File > Save BSP
![]()
Do you really need to add a custom trigger in the map with the @pti_level_end thingy ? I added an elevator transit logic from the p2editor instances dir . I just get "end of playtest".
It looks like the solution I gave you before regarding the videos won't work if you want to use a custom video, it only works for the stock videos, and since they all are already into each one's computer, it doesn't make much sense to pak them into the bsp.
I've been messing around with the scripts that manage the elevators videos (video_splitter.nut script into portal2/portal2/scripts/vscripts/videos folder) to see if I could obtain from there something that might help, because the thing is that the videos seems to be pre-cached in the very beginning when you run the game / or / they must be physically under your media folder for them to work out and be shown. There is a funtion into that script called Precache() but after doing some test around that I can't make it to work. Check what I'm talking about:
||```
function Precache()
{
if( "PrecachedVideos" in this )
{
// don't do anything
}
else
{
// Commenting this line out because it prevents properly re-precaching movies after loading a save game.
// The cost is that we end up running this code below about 2x too often, but it's fairly cheap and not realtime code anyways...
//::PrecachedVideos <- 1
local mapName = GetMapName()
foreach (index, level in ElevatorVideos)
{
if (level.map == mapName)
{
local movieName
if ("additional" in level && level.additional != "" )
{
movieName = "media\" + level.additional
//printl( "Preching movie: " + movieName )
PrecacheMovie( movieName )
}
if ("arrival" in level && level.arrival != "" )
{
movieName = "media\"
if( OVERRIDE_VIDEOS == 1 )
movieName += "entry_emergency.bik"
else
movieName += level.arrival
//printl( "Preching movie: " + movieName )
PrecacheMovie( movieName )
}
if ("departure" in level && level.departure != "" )
{
movieName = "media\"
if( OVERRIDE_VIDEOS == 1 )
movieName += "exit_emergency.bik"
else
movieName += level.departure
//printl( "Preching movie: " + movieName )
PrecacheMovie( movieName )
}
}
}
}
}
```||
I've read the first part of the script also, where it appears all campaign maps and the video that the script wants to assign to each of them... but even though adding there my test map and my test video and running the function Precache() via a logic_script entity and a logic_auto in my test map, I can't make it to work.
Dude, I don't know much about scripting (yet) so I'm only doing trial and error, and it takes a lot of time. Would you by any chance know more than me about vscripting? It'd be nice if someone with scripting knowledge enough could give us a hand 
CosmicD wrote:
Do you really need to add a custom trigger in the map with the @pti_level_end thingy ? I added an elevator transit logic from the p2editor instances dir . I just get "end of playtest".
I've read above what you're doing to trigger that relay, it's simpler than that (and I started to do the same as you to no avail). What I do is to modify the logic_relay called "@transition_from_map" into my "arrival_departure_transition_ents" instance adding a new output like so:
OnTrigger > @relay_pti_level_end > Trigger delay: 8.00
(ofc you can change the delay, I use to let the player go up through the elevator turbine for a while, then I show some text then make the PTI vote appears...)
Triggering directly the logic_relay called "@relay_pti_level_end", as long as it has a "@" prefix, will work even though it's into an instance. Try it.
right.. thanks for the info. I guess I'll just add that in the stock instance so I always have it when modifying the maps.
For now, I wonder if you guys would like to check out my demo map:
http://steamcommunity.com/sharedfiles/f ... =115969162
Someone comments that they start "in a box" which tytpically means some script is missing. However I don't understand why that should happen.
Also some custom materials appear to be missing... did you use pakrat's automatic scan feature to pack them?
ANd if you mean the "white" in the button room, that's normal. Maybe show a screenshot ?
Yes i use the "auto" feature when compiling the map so all extra materials and sounds are added.
updated the map:
Used standard transition ents and modified that one to include the pti rate window stuff...
If the "texture error" still happens, might that be because included in bsp files can't be in caps..
there's this fake_white.vtf which has a FAKE_WHITE.vmt , perhaps that's the problem and I can fix that later.