Rough'n'ready Portal 2 SDK

Discussion in 'Portal 2' started by Randdalf, Apr 20, 2011.

  1. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    You'll need
    Alien Swarm + Alien Swarm SDK + Source SDK
    the latest version of GCFScape (or your pref
    http://dl.dropbox.com/u/9133125/FGD/fgd.zip (collaboratiion with DeanWinchester from FP, contains the FGD and a sample map with most entities as well)

    so the steps are
    1) open up the pak_01dir VPK in GCFScape
    2) extract the models/materials folders to steamapps/common/alien swarm/swarm folder
    3) place http://dl.dropbox.com/u/1085379/fix_models.bat in the models folder and run it (double-click, takes a little time)
    4) materials and models should now work in the Swarm SDK
    5) place portal2.fgd in the steamapps/<username>/source_sdk/bin/orangebox/bin folder
    6) open Hammer and go to tools > options
    7) next to game data files, click add, and choose the portal2.fgd you just put in the bin folder
    8) use the keyword "portal 2" to filter for Portal 2 textures

    tip: If you want to fix the way the Swarm SDK compiles things, then remove the "-alldetail" parameter in the advanced compile.

    decompiling maps
    1) get http://nuclearvelocity.com/barracuda/bspsrc/downloads.html and run it on a Portal 2 BSP
    2) open the resulting VMF in notepad, and scroll to the bottom, the last entity { ... } definition is usually incomplete (lacks the second curly brace), so delete that from the file (this results in some missing bits in the map but this decompiler isn't finished yet)
    3) open in Hammer, enjoy

    making paint work
    1) open up map > map properties in hammer
    2) deselect the SmartEdit button
    3) add 2 new keyvalues, paintinmap with value 1 and maxblobcount with value 250 (though you can change this)

    [​IMG]

    The decompiler I found only has basic Portal 2 functionality, probably why the VMFs have errors you need to get rid of. Should be fine for compiling and running maps of your own though. Entities will have to be copy+paste for now, until Valve or someone makes an FGD.

    list of entities and properties (missing tractor beam reversal, "map portals", and bombs)
    Code:
    func_noportal_volume
    	name
    	spawnflags
    
    func_portal_bumper
    	angles
    	origin
    	spawnflags
    
    func_portal_detector
    	spawnflags
    	-OnStartTouchPortal1
    	-OnStartTouchPortal2
    	-OnStartTouchLinkedPortal
    
    npc_personality_core
    	angles
    	disablereceiveshadows (bool)
    	DontUseSpeechSemaphore (bool)
    	hintlimiting (bool)
    	ignoreunseenenemies (bool)
    	ModelSkin 1
    	parentname
    	physdamagescale
    	renderamt
    	rendercolor
    	renderfx
    	rendermode
    	sleepstate
    	spawnflags
    	targetname
    	wakesquad
    	thinkfunction
    	wakeradius
    	-OnPlayerPickup
    
    npc_security_camera
    	angles
    	disableshadowdepth
    	disableshadows
    	drawinfastreflection
    	LookAtPlayerPings (bool)
    	shadowdepthnocache (bool)
    	skin
    	spawnflags
    	TeamToLookAt
    
    prop_portal
    	Activated (bool)
    	angles
    	PortalTwo (bool)
    	targetname
    	+SetActivatedState
    
    prop_testchamber_door (model ent)
    	angles
    	AreaPortalFadeEnd
    	AreaPortalFadeStart
    	AreaPortalWindow
    	targetname
    	UseAreaPortalFade (bool)
    	+Open
    	+Close
    	-OnFullyClosed
    
    trigger_portal_cleanser
    	Visible
    	origin
    	targetname
    	spawnflags
    	StartDisabled (bool)
    	-OnUser1
    	-OnUser2
    
    prop_button
    	angles
    	Delay
    	-OnPressed
    
    prop_floor_button
    	angles
    	model
    	skin
    	-OnPressed
    	-OnUnPressed
    
    prop_indicator_panel
    	angles
    	IndicatorLights
    	targetname
    	+Check
    	+Uncheck
    
    prop_weighted_cube
    	allowfunnel
    	angles
    	CubeType
    	NewSkins
    	PaintPower
    	skin
    	SkinType
    	targetname
    	-OnFizzled
    	+OnEndTouchAll
    	+OnTrigger
    
    trigger_catapult
    	AirCtrlSupressionTime
    	applyAngularImpulse
    	entryAngleTolerance
    	launchDirection
    	launchTarget
    	lowerThreshold
    	origin
    	physicsSpeed
    	playerSpeed
    	spawnflags
    	targetname
    	StartDisabled
    	upperThreshold
    	-OnCatapulted
    
    env_portal_laser
    	angles
    	AutoAimEnabled (bool)
    	model [default: models/props/laser_emitter_center.md]
    	scalevalue
    	skin
    	StartState (bool)
    	targetname
    	+TurnOn
    	
    info_overlay_accessor (looks like a normal overlay to me, except UVs)
    	angles
    	BasisNormal
    	BasisOrigin
    	BasisU
    	BasisV
    	EndU
    	EndV
    	fademindist
    	material
    	OverlayID
    	sides
    	StartU
    	StartV
    	targetname
    	uv0
    	uv1
    	uv2
    	uv3
    
    info_placement_helper
    	angles
    	hide_until_placed (bool)
    	radius
    	snap_to_helper_angles (bool)
    
    prop_laser_catcher
    	angles
    	IndicatorLights
    	targetname
    	model
    	skin
    	SkinType
    	vscripts
    	-OnPowered
    	-OnUnpowered
    
    npc_portal_turret_floor
    	angles
    	PickupEnabled (bool)
    	TurretRange
    	-OnTipped
    	
    info_paint_sprayer
    	radius_grow_time_min
    	angles
    	radius_grow_time_max
    	blob_spread_radius
    	targetname
    	min_streak_time
    	start_radius_max
    	blobs_per_second
    	start_radius_min
    	silent (bool)
    	min_streak_speed_dampen
    	end_radius_max
    	end_radius_min
    	max_speed
    	max_streak_speed_dampen
    	max_streak_time
    	min_speed
    	maxblobcount
    	AmbientSound
    	PaintType
    	start_active (bool)
    	+Start
    	+Stop
    
    prop_under_button
    	angles
    	Delay
    	-OnPressed
    
    prop_under_floor_button
    	angles
    	-OnPressed
    	-OnUnPressed
    
    npc_wheatley_boss
    	(unlikely to be used for mapping, same as npc_personality_core)
    	disableflashlight (bool)
    	disableshadowdepth (bool)
    	disableshadows (bool)
    	+RunScriptCode
    
    prop_monster_box
    	angles
    	BoxSwitchSpeed
    	disableflashlight (bool)
    	disableshadowdepth (bool)
    	disableshadows (bool)
    	fademindist
    	fadescale
    	inertiaScale
    	physdamagescale
    	spawnflags
    	targetname
    	-OnFizzled
    
    prop_wall_projector (hard light bridge)
    	angles
    	StartEnabled (bool)
    	targetname
    
    prop_tractor_beam
    	angles
    	disableshadows
    	linearForce
    	StartEnabled
    	targetname
    	+Enable
    
     
    • Thanks Thanks x 32
    Last edited: Apr 23, 2011
  2. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,992
    Positive Ratings:
    1,233
    Where doth I download the latest GCFScape from? Nem's stie is stuck in 2006.
     
  3. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    A little clarification, open the VPK at this location C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2\pak01_dir.vpk (or whatever your computer has) to extract models/materials.
     
  4. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    I updated the OP with a list of new entities we can use, and their properties (that I could find), I'm going to look into formalising this into an FGD.
     
  5. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,031
    Positive Ratings:
    3,975
  6. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    I think that's a risk you take if you decide to map for a game before you beat it.
     
    • Thanks Thanks x 2
  7. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,031
    Positive Ratings:
    3,975
  8. Pocket

    aa Pocket func_croc

    Messages:
    4,480
    Positive Ratings:
    2,212
    Don't. Crafty has a file system browser that's meant to replace it (although there haven't been any changes to Source that break the former yet), so you might as well start using it now if you don't already have GCFScape.
     
  9. Leminnes

    aa Leminnes

    Messages:
    1,317
    Positive Ratings:
    801
    It seems that whenever I load maps, it crashes a lot. Not sure what from, but it always seems to be when looking at certain things in a map.
     
  10. pisaman2

    pisaman2 L1: Registered

    Messages:
    34
    Positive Ratings:
    1
    Is there any way to filter the models like the textures? Don't wanna use any from alien swarm
     
  11. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    I'm not sure pisaman.

    I've just add a draft of an FGD to the OP. It's missing a few entities, such as linked_portal_doors, most NPCs (except turrets, which are there), and bombs. Some functionality such as reverse tractor beams is also missing, but hey, it's only a draft. This lets you add entities using the entity tool, and use the SmartEdit feature when editing their properties.
     
  12. Penguin

    aa Penguin Clinically Diagnosed with Small Mapper's Syndrome

    Messages:
    1,992
    Positive Ratings:
    1,233
    How do I make the AS compiler NOT turn everything into a func_detail?
     
  13. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    Go to advanced compile, and in the $bsp_exe bit, remove the "-alldetail" parameter.

    I just updated the FGD to fix some stuff with cubes and lasers.
     
    Last edited: Apr 21, 2011
  14. Micnax

    aa Micnax I maek map

    Messages:
    2,018
    Positive Ratings:
    1,338
    Goddamnit Dropbox, why you not connect on me now?
     
  15. Yacan1

    aa Yacan1 D I G I T A L I N F L U E N C E R

    Messages:
    410
    Positive Ratings:
    658
    Between steps 4 and 5, where can p2_Draft be found? I searched for it after I ran fix_models but, it isn't present. Or did I mess up as usual?
     
  16. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,031
    Positive Ratings:
    3,975
  17. Randdalf

    aa Randdalf

    Messages:
    1,054
    Positive Ratings:
    462
    I've added instructions on how to get paint working.
     
  18. Ravidge

    aa Ravidge Grand Vizier

    Messages:
    1,544
    Positive Ratings:
    2,492
    The fgd link is broken. caused my hammer to crash twice before I realized I tried to load dropboxes 404 html page as a fgd.
     
  19. dubca7

    dubca7 L1: Registered

    Messages:
    2
    Positive Ratings:
    0
    I registration just to thank you for this awesomeness, can you re-upload p2_draft.fgd so I can try it out :)
     
  20. HellJumper

    aa HellJumper

    Messages:
    812
    Positive Ratings:
    373
    Just to be sure, you all know about:

    Source: http://store.steampowered.com/app/620/