How to modify your maps for the upcoming workshop

Avatar
Idolon
417 Posts
Posted May 10, 2012
Replied 5 hours later
You should write this up in article form and put it up on the VDC. I have a hard time learning from videos for some reason.
Advertisement
Registered users don't see ads! Register now!
Avatar
Wanderer2021
90 Posts
Posted May 10, 2012
Replied 45 minutes later
I was kinda surprised at how easy it was to update older maps to upload to the workshop. I love it when things like this are so simple.
Avatar
CosmicD
125 Posts
Posted Dec 25, 2012
Replied 7 months later
I'm trying to refurbish my campaign maps to the workshop as we develop the 2.0 version of my campaign.

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

Avatar
Sprowl
97 Posts
Posted Dec 25, 2012
Replied 7 hours later
The elevator instances are not important for the workshop. The only thing you need is the PTI-instance. And you have it in your map.
The trigger to end your map only works after you published your map in the workshop. Upload it and everything should work .
Avatar
portal2tenacious
393 Posts
Posted Dec 25, 2012
Replied 44 minutes later
Adding to that, you can make sure the trigger worked by opening the console after you hit the trigger. There should be one line with just your map name.
Avatar
CosmicD
125 Posts
Posted Dec 25, 2012
Replied 24 minutes later
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.

Avatar
Lpfreaky90
2,842 Posts
Posted Dec 25, 2012
Replied 31 minutes later

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

Avatar
CosmicD
125 Posts
Posted Dec 26, 2012
Replied 8 hours later
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 <Holiday Name Here> miracle of valve fixing this up and allowing to include media in bsp's would be nice.

Avatar
Lpfreaky90
2,842 Posts
Posted Dec 26, 2012
Replied 2 hours later

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...

Avatar
josepezdj
2,386 Posts
Posted Dec 26, 2012
Replied 4 hours later
@CosmicD and LPFreaky: I've recently done a test to check about this and it works. I use pakrat to embed all my custom content and I tried paking media the same as I do with paking scripts, and it works perfect.

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:

  1. Ofc you'll need pakrat
  2. 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:

  1. 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.

  1. 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.

  2. 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.

  3. Don't forget to save your file by going to File > Save BSP

Avatar
CosmicD
125 Posts
Posted Dec 26, 2012
Replied 1 hour later
that's allot of help. Now I should probably redo all glados sound entities that i have and instead of pointing it to the soundscript , pointing it to the actual glados sounds itself right? I guess you can't embed a sound cache within a map within a system that already has a sound cache running I assume.
Avatar
CosmicD
125 Posts
Posted Dec 26, 2012
Replied 1 hour later
The pakrat thing works like a charm, however I can't seem to get the map to open the rate menu.

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".

Avatar
josepezdj
2,386 Posts
Posted Dec 27, 2012
Replied 17 hours later
Hey CosmicD!

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.

Avatar
CosmicD
125 Posts
Posted Dec 27, 2012
Replied 32 minutes later

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.

Avatar
josepezdj
2,386 Posts
Posted Dec 27, 2012
Replied 34 minutes later
I just tried your map and in fact you are spawn into the arrival_departure_transition_ents instance (into the box where the info_player is located)... did you edit that instances and forgot any output to make the player be teleported to the elevator? because that is what it looks like.

Also some custom materials appear to be missing... did you use pakrat's automatic scan feature to pack them?

Advertisement
Registered users don't see ads! Register now!
Avatar
CosmicD
125 Posts
Posted Dec 27, 2012
Replied 1 hour later
yeah, I was using my custom transitions to read from custom transition list, so I guess that's the problem there.

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.