Ladder maker STool

Hey Facepunch.
This is my newest Stool.

It creates Ladders,pointing away from the Faces HitNormal.

You can set the high by using the Slider in the Q-Menu.

ScreenShots

http://img144.imageshack.us/img144/1521/gmconstruct0020if3.jpg

http://img339.imageshack.us/img339/4084/gmconstruct0019na6.jpg

Download
http://www.garrysmod.org/img/?t=dll&id=39994

One thing i could not get to work were the Color Panel,like with the Paint Tool.

Never wanted to go to the position I wanted,could need some help there.

Bugs:
Sometimes acts weirds with bad Surfaces Normals

Thanks for reading.

Cool, you got my DL and a Lua King.

It actually looks like a ladder now instead of 2 lasers.

Sweet I’m downloading now :dance:

Climb… WITH STYLE!

Very nice. I like how it, you know, looks like a ladder. :slight_smile:

DL and Lua King

Good job, this is bloody brilliant!

Nice, I like that you used func_useableladders. Reminds me of the m-way from a few months back, but more useful.

Nice work, that first pic looks like a ladder to heaven. :smiley:

:tizzy: Now you’ve brought up memories of all the GM9 scripts I wanted to convert.

Mhh nice but two suggestions

  • A material chooser for those beams (like in the rope tool)
  • Make it possible to click two points and it then creates a ladder between those

BlackNecro, download the Bridge Tool and select the “Ladder” option.

I decided to bump this as well, because I find it interesting.

Can you actually dismount these, unlike the other ones?

Hey, I made a fix for your creation that allows you to use the color control panel and I have no experience in lua and took about a minute for me to learn the code and add it. Your welcome.

Fricken awesome man. I was hoping someone would create something like this that was better than the two laser version. I was building a full sized submarine and needed a ladder to make it work easier. this helps a lot… thanks.

It works for me, but only sort of. The ladder WORKS, but is entirely invisible! No rungs, no lasers, nothing. When the “STAIRS” box is checked, it just spawns an error that does nothing.

I have the same problem as Slyfo. I found that out shortly after I bumped this.

The stool uses models from portal so make sure you have it installed.

I made a few changes to get it to work for me. Still creates a lua error but at least it creates the ladder and the undo function works.

By the way, stairs when unchecked is supposed to spawn the ladder without the rungs and lasers.

[lua]if (CLIENT) then
language.Add(“Tool_ladder_name”, “Ladder Maker Stool”)
language.Add(“Tool_ladder_desc”, “Climb higher and higher”)
language.Add(“Tool_ladder_0”, “Left Click to make a ladder with the given Height.”)
language.Add(“Undone_ladder”, “Ladder Undone” )
language.Add(“Cleanup_ladder”, “Ladders” )
language.Add(“Cleaned_ladder”, “Cleaned up Ladders” )
language.Add(“SBoxLimit_ladder”, “Maximum Ladders Reached” )
end
cleanup.Register(“Ladder”)
TOOL.Category = “Construction”
TOOL.Name = “#Ladder
TOOL.Command = nil
TOOL.ConfigName = “ladder”

TOOL.ClientConVar[“Offset”] = 256
TOOL.ClientConVar[“stairs”] = 1

TOOL.ClientConVar[ “r” ] = 255
TOOL.ClientConVar[ “g” ] = 255
TOOL.ClientConVar[ “b” ] = 255
TOOL.ClientConVar[ “a” ] = 255

function TOOL:LeftClick(trace)

local SpawnPos = trace.Entity:GetPos() 
	local r		= self:GetClientNumber( "r", 0 )
	local g		= self:GetClientNumber( "g", 0 )
	local b		= self:GetClientNumber( "b", 0 )
	local a		= self:GetClientNumber( "a", 0 )
local ent_ladder = ents.Create("func_useableladder")
ent_ladder:SetPos(SpawnPos)
ent_ladder:SetNetworkedNumber("Offset", self:GetClientNumber("Offset"))	
local yaw = 10
if trace.HitNormal:Angle().pitch != 0 then
yaw = self:GetOwner():GetAngles().yaw +180
else
yaw = trace.HitNormal:Angle().yaw
end
ent_ladder:SetAngles(Angle(trace.HitNormal:Angle().pitch - 90,yaw  ,0))
		local target = self:GetClientNumber("Offset")
ent_ladder:SetKeyValue("point0",trace.HitPos.x .. " " .. trace.HitPos.y .. " " ..trace.HitPos.z )
ent_ladder:SetKeyValue("point1",(trace.HitPos.x + trace.HitNormal.x * target ) .. " " .. (trace.HitPos.y + trace.HitNormal.y * target ) .. " " .. (trace.HitPos.z + trace.HitNormal.z * target ))
ent_ladder:SetKeyValue("origin",trace.HitPos.x .. " " .. trace.HitPos.y .. " " .. trace.HitPos.z )
ent_ladder:Spawn()
ent_ladder:Activate()

–models/gibs/metal_gib3.mdl
if self:GetClientNumber(“stairs”) == 1 then
local ammount = target / 24
ent_ladder.stair = {}
for i = 1,ammount do
ent_ladder.stair* = ents.Create(“Prop_physics”)
ent_ladder.stair*:SetModel(“models/props_bts/ladder_01.mdl”)
ent_ladder.stair*:SetPos(trace.HitPos + ent_ladder:GetForward() * 25 + (trace.HitNormal * (i24)))
ent_ladder.stair
:SetAngles(ent_ladder:GetAngles() + Angle(0,180,0))
ent_ladder.stair*:Spawn()
ent_ladder.stair*:GetPhysicsObject():EnableMotion(false)
ent_ladder.stair*:SetParent(ent_ladder)
ent_ladder.stair*:Activate()
end

	ent_ladder.beamtarget = ents.Create("info_target")
	ent_ladder.beamtarget:SetPos(trace.HitPos + ent_ladder:GetForward() * 25 + (trace.HitNormal * (ammount*24 - 10))+ ent_ladder:GetRight() * 14)
	ent_ladder.beamtarget:Spawn()
	ent_ladder.beamtarget:Activate()
	ent_ladder.beamtarget:SetKeyValue("targetname","ladder_target_" .. tostring(ent_ladder:EntIndex()))
	
	ent_ladder.beam = ents.Create("env_laser")
	ent_ladder.beam:SetPos(trace.HitPos + ent_ladder:GetForward() * 25 + (trace.HitNormal * 25) + ent_ladder:GetRight() * 14)
		ent_ladder.beam:SetKeyValue("LaserTarget","ladder_target_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam:SetKeyValue("targetname","ladder_beam_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam:SetKeyValue("width","2")
	ent_ladder.beam:SetKeyValue( "TextureScroll", "35")
	ent_ladder.beam:SetKeyValue("renderamt", "255")
	ent_ladder.beam:SetKeyValue( "rendercolor", r .. " " .. g .. " " .. b  .. " " .. a)
	ent_ladder.beam:SetKeyValue( "damage", "0")
	ent_ladder.beam:SetKeyValue( "EndSprite", "")
	ent_ladder.beam:SetKeyValue( "parentname", "")	
	ent_ladder.beam:SetKeyValue( "renderfx", "0")		
	ent_ladder.beam:SetKeyValue( "dissolvetype", "None")	
	ent_ladder.beam:SetKeyValue( "spawnflags", "1")
	ent_ladder.beam:SetKeyValue("texture","sprites/plasmabeam.spr")
	ent_ladder.beam:Spawn()
		ent_ladder.beam:SetKeyValue("LaserTarget","ladder_target_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam:SetKeyValue("targetname","ladder_beam_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam:SetKeyValue("width","2")
	ent_ladder.beam:SetKeyValue( "TextureScroll", "35")
	ent_ladder.beam:SetKeyValue("renderamt", "255")
	ent_ladder.beam:SetKeyValue( "rendercolor", r .. " " .. g .. " " .. b  .. " " .. a)
	ent_ladder.beam:SetKeyValue( "damage", "0")
	ent_ladder.beam:SetKeyValue( "EndSprite", "")
	ent_ladder.beam:SetKeyValue( "parentname", "")	
	ent_ladder.beam:SetKeyValue( "renderfx", "0")		
	ent_ladder.beam:SetKeyValue( "dissolvetype", "None")	
	ent_ladder.beam:SetKeyValue( "spawnflags", "1")
	
	
	ent_ladder.beamtarget2 = ents.Create("info_target")
	ent_ladder.beamtarget2:SetPos(trace.HitPos + ent_ladder:GetForward() * 25 + (trace.HitNormal * (ammount*24 - 10))+ ent_ladder:GetRight() *- 14)
	ent_ladder.beamtarget2:Spawn()
	ent_ladder.beamtarget2:Activate()
	ent_ladder.beamtarget2:SetKeyValue("targetname","ladder_target2_" .. tostring(ent_ladder:EntIndex()))
	
	ent_ladder.beam2 = ents.Create("env_laser")
	ent_ladder.beam2:SetPos(trace.HitPos + ent_ladder:GetForward() * 25 + (trace.HitNormal * 25) + ent_ladder:GetRight() *- 14)
		ent_ladder.beam2:SetKeyValue("LaserTarget","ladder_target2_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam2:SetKeyValue("targetname","ladder_beam2_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam2:SetKeyValue("width","2")
	ent_ladder.beam2:SetKeyValue( "TextureScroll", "35")
	ent_ladder.beam2:SetKeyValue("renderamt", "255")
	ent_ladder.beam2:SetKeyValue( "rendercolor", r .. " " .. g .. " " .. b  .. " " .. a)
	ent_ladder.beam2:SetKeyValue( "damage", "0")
	ent_ladder.beam2:SetKeyValue( "EndSprite", "")
	ent_ladder.beam2:SetKeyValue( "parentname", "")	
	ent_ladder.beam2:SetKeyValue( "renderfx", "0")		
	ent_ladder.beam2:SetKeyValue( "dissolvetype", "None")	
	ent_ladder.beam2:SetKeyValue( "spawnflags", "1")
	ent_ladder.beam2:SetKeyValue("texture","sprites/plasmabeam.spr")
	ent_ladder.beam2:Spawn()
		ent_ladder.beam2:SetKeyValue("LaserTarget","ladder_target2_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam2:SetKeyValue("targetname","ladder_beam2_" .. tostring(ent_ladder:EntIndex()))	
	ent_ladder.beam2:SetKeyValue("width","2")
	ent_ladder.beam2:SetKeyValue( "TextureScroll", "35")
	ent_ladder.beam2:SetKeyValue("renderamt", "255")
	ent_ladder.beam2:SetKeyValue( "rendercolor", r .. " " .. g .. " " .. b  .. " " .. a)
	ent_ladder.beam2:SetKeyValue( "damage", "0")
	ent_ladder.beam2:SetKeyValue( "EndSprite", "")
	ent_ladder.beam2:SetKeyValue( "parentname", "")	
	ent_ladder.beam2:SetKeyValue( "renderfx", "0")		
	ent_ladder.beam2:SetKeyValue( "dissolvetype", "None")	
	ent_ladder.beam2:SetKeyValue( "spawnflags", "1")
end
undo.Create("Ladder")
undo.AddEntity(ent_ladder)
if self:GetClientNumber("stairs") == 1 then
for k,v in pairs(ent_ladder.stair) do
undo.AddEntity(ent_ladder.stair[k])
end
end
undo.AddEntity(ent_ladder.beam)
undo.AddEntity(ent_ladder.beamtarget)	
undo.AddEntity(ent_ladder.beam2)
undo.AddEntity(ent_ladder.beamtarget2)	
undo.SetPlayer(self:GetOwner())
undo.Finish()	

return true

end

function TOOL.BuildCPanel(panel)
panel:AddControl("Header", {
	Text = "Ladder Maker Stool",
	Description = "Creates a Ladder with a given Height"
})


panel:AddControl("Slider", {
	Label = "Height",
	Type = "Float",
	Min = "64",
	Max = "1024",
	Command = "ladder_offset"
})
panel:AddControl( "Checkbox", {
Label = "Stairs ?",
Command = "ladder_stairs" 
} )
    panel:AddControl( "Color", { Label = "Beam Color", Description = "Beam Color" , Red = "ladder_r", Green = "ladder_g", Blue = "ladder_b", Alpha = "ladderalpha", ShowAlpha = "1", ShowHSV = "1", ShowRGB = "1", Multiplier = "255" }  )

end

[/lua]

If that’s the case, shouldn’t I still see the lasers? Or is it not just the ladder rungs that are from portal?