Go Back   Steam Users' Forums > Steam Game Discussions > M - P > Portal 2

Reply
 
Thread Tools Display Modes
Old 05-17-2012, 10:11 AM   #1
turk645
 
Join Date: Mar 2007
Reputation: 18
Posts: 197
A Very Basic Tutorial for Editing the Editor. AKA adding wall cameras to the editor

I'm going to attempt to explain how to get started with these edits. Im hoping some people with better vision, and more free time, are able to expand on this and make the editor better for everyone else. In this tut I will do a basic explination of adding the testing cameras to the editor.

Here is some proof of concept:

http://cloud.steampowered.com/ugc/55...29C672EFBF774/
http://cloud.steampowered.com/ugc/55...74B0BC73341AA/

Things you need:
  • Basic text editor
  • Portal 2 Authorizing tools
  • Basic hammer gui know how

Notepad++ isn't needed but is recommended.

To get started we get to locate the main file we are going to edit. We are going to be editing the editoritems.txt file. It is located in the Steam\steamapps\common\portal 2\portal2_dlc2\scripts directory.

This file is pretty straight forward. things are defined and contained within {}. So goes "Item" {item details here}.

Do a search for "bridge" and copy the entire light bridge item, this inclused the "item" before the {}. We are going to paste this in front of the first item in the list. We now have two light bridges taking up the same slot in the editor. To fix this we will replace the franken turret slot.

Do a search for "Palette_franken_cube". We are going to cut the whole "palette" tag and paste it over the palette tag of our copied bridge.

Tooltip option is what it's called when you hover over it

Image is self explanitory.

The pallet tag's position option refurs to the loction in the item palette going in X Y Z offsets. Z does nothing yet.

Next we going to edit the part of the bridge that controls how we move it in the editor.

"MovementHandle" "HANDLE_6_POSITIONS"
"DesiredFacing" "DESIRES_UP"

This section will change how we position it. We want to leave the desired facing direction as is but the movement handle we can delete since its not needed and will rotate the camera on us. However we do want to add something else though to prevent ceiling and floor use. By stealing this line from other items it will prevent it.

"InvalidSurface" "CEILING FLOOR"

Pretty straight forward, this will prevent the camera from being placed on floors and ceilings.

Feel free to make other small tweeks to the items info as well. For my example pictures I set the game to show the sphere model instead of the bridge model.

Now for the important part with hammer so we have the camera in game.

Load hammer and in the open window browse to "maps\instances\p2editor" and load the bridge.vmf. Since this is a cheap edit for the sake of the tutorial we are just going to double click the bridge in the 3d window to open the settings and change its item type to the npc_security_camera. After applying save it as a new file in the same folder.

Back in the editoritems.txt we want to scroll down on our copied bridge and find the "Exporting" section. You will see where it defines the bridge intance. Just change it to the instance we just made.


Save your changes and try loading up the game. If everything went as planned you should have a basic, if maybe a little buggy, wall camera in your map.

Keep exploring the file, learn more, and create more interesting things
turk645 is offline  
Reply With Quote
Old 05-17-2012, 10:37 AM   #2
Catsy
 
 
 
Join Date: Sep 2011
Reputation: 83
Posts: 340
Thanks! I will definitely give this a shot when I get home. I can already see an insane number of possibilities.

One thing I'm not clear on--is it necessary to do the tweak in Hammer every time you run a map, or is that step related to making that item show up in the editor?
Catsy is offline   Reply With Quote
Old 05-17-2012, 10:57 AM   #3
turk645
 
Join Date: Mar 2007
Reputation: 18
Posts: 197
The hammer step is a one time thing. The way the editor works is that it's pretty much a lego set of instances. Each wall cube is an instance, each box is an instance, etc. There is no instance for the camera so the hammer step makes it. Editing the editoritem.txt is basicly telling the editor there is a new lego now and how it connects to the other parts.
turk645 is offline   Reply With Quote
Old 05-17-2012, 11:03 AM   #4
herobrine42
 
 
 
Join Date: Nov 2011
Reputation: 32
Posts: 35
Good job, I remember you saying you were going to make this tutorial.
herobrine42 is offline   Reply With Quote
Old 05-17-2012, 11:12 AM   #5
Catsy
 
 
 
Join Date: Sep 2011
Reputation: 83
Posts: 340
Quote:
Originally Posted by turk645 View Post
The hammer step is a one time thing. The way the editor works is that it's pretty much a lego set of instances. Each wall cube is an instance, each box is an instance, etc. There is no instance for the camera so the hammer step makes it. Editing the editoritem.txt is basicly telling the editor there is a new lego now and how it connects to the other parts.
Hahahaha. Love it.

Considering I was the one who built the Lego GLaDOS model and custom Chell minifig that went up on Kotaku et al last year, I think I can handle a Lego editor.
Catsy is offline   Reply With Quote
Old 05-17-2012, 01:01 PM   #6
Alexander Bell
 
 
 
Join Date: Apr 2012
Reputation: 1328
Posts: 2,346
Cave Johnson here.

Now, as you know The Cloud has banned all camera technology - hates getting it's picture taken. So this will have to be on the honor system - Will the owner of this thread please hide the parts about Cameras so that The Cloud does not get suspicious and float under the doors and leech off all our skin.

Anyway, nice. But does this remove the ability to place Franken Turrets? And would you be so kind as to make a guide to implement Prop_Exploding_futbol's and the dispensing pipes for them? and GLaDOS too?
Alexander Bell is offline   Reply With Quote
Old 05-17-2012, 01:05 PM   #7
turk645
 
Join Date: Mar 2007
Reputation: 18
Posts: 197
frankenturrets are still completely useable. Even though they dont show up in the side menu you can easily get them via a right click option on a normal cube to switch its type. This is why we have a lot more free spaces then it seems to add new stuff. There are 5 cubes yet only one is needed on the menu itself due to the right click menu once its on the map. This makes things easy to replace for stuff we actually need.

Futbols would be interesting. It's just a matter of if i can make an instance for it correctly and actually have it connectable to stuff.
turk645 is offline   Reply With Quote
Old 05-17-2012, 01:13 PM   #8
Alexander Bell
 
 
 
Join Date: Apr 2012
Reputation: 1328
Posts: 2,346
I dont understand what you mean by an "instance" (not that computer savy), but they're in the games code - they're the bombs that
Spoiler:
Wheatley throws at you
Alexander Bell is offline   Reply With Quote
Old 05-17-2012, 01:16 PM   #9
turk645
 
Join Date: Mar 2007
Reputation: 18
Posts: 197
instances in the source engine are basicly a prebuilt item. a turret with a hat can be a good example. If you needed 5 of them in different map files, instead of building each one from scratch you could make 1 instance and easily have that pasteable. The map editor uses instances to make placing things like box droppers easier.
turk645 is offline   Reply With Quote
Old 05-17-2012, 01:19 PM   #10
Alexander Bell
 
 
 
Join Date: Apr 2012
Reputation: 1328
Posts: 2,346
Oh I see.

Sorry for asking, but can you make a guide for turrets with top hats?

lol
Alexander Bell is offline   Reply With Quote
Old 05-17-2012, 10:29 PM   #11
tehportalgun
 
Join Date: Apr 2011
Reputation: 0
Posts: 33
The next step is getting a texture in the menu, and making a model for the editor, so we have something for in game.

Anyway have the skills or know how?
tehportalgun is offline   Reply With Quote
Old 05-19-2012, 12:02 AM   #12
Kariko
 
 
 
Join Date: Dec 2011
Reputation: 256
Posts: 1,088
Quick question: What if I make a map in the Editor with cameras, upload it to the Workshop, and someone downloads it? Will there be cameras? I'd guess yeah because they have Portal 2, but I'm not sure. Also, will this let me basically put in stuff that's not in the editor easily?

I think I could take a snapshot of a camera to help myself know, but model editing is not possible for me. Nice!
Kariko is offline   Reply With Quote
Old 05-19-2012, 12:25 AM   #13
tehportalgun
 
Join Date: Apr 2011
Reputation: 0
Posts: 33
Quote:
Originally Posted by Kariko View Post
Quick question: What if I make a map in the Editor with cameras, upload it to the Workshop, and someone downloads it? Will there be cameras? I'd guess yeah because they have Portal 2, but I'm not sure. Also, will this let me basically put in stuff that's not in the editor easily?

I think I could take a snapshot of a camera to help myself know, but model editing is not possible for me. Nice!
I would think it would work, as you can place thinsg from hammer that arn't in the peti and upload them

so yeah.

I'm now gonna work on a texture for the sidebar for the security camera, then maybe a texture to use in the peti, as opposed to the ball....
tehportalgun is offline   Reply With Quote
Old 05-19-2012, 01:13 AM   #14
Kariko
 
 
 
Join Date: Dec 2011
Reputation: 256
Posts: 1,088
Quote:
Originally Posted by tehportalgun View Post
I'm now gonna work on a texture for the sidebar for the security camera, then maybe a texture to use in the peti, as opposed to the ball....
Please share when completed...Please?
Kariko is offline   Reply With Quote
Old 05-19-2012, 03:18 AM   #15
Kariko
 
 
 
Join Date: Dec 2011
Reputation: 256
Posts: 1,088
Lil' update here: I'm currently trying to put Pneumatic Diversity Vents into the PTI Editor. So far, crash on boot after Valve video. I think it's because I don't understand the editoritems.txt file completely...

If somebody can explain it to me, I think I can get this Diversity Vent into PTI. It's a custom instance, pretty simple, but I can't seem to get it to work. Help would be appreciated.
Kariko is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Game Discussions > M - P > Portal 2


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -7. The time now is 01:36 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.