SeldBuild - Gmod13 Fix

yes i have fixed Sledbuild for gmod 13. I say thanks to Jocken300 for telling me to remove some stuff.

Links:
(rar file): http://www.mediafire.com/?rol1dw1cnu5litm
(zip file): http://www.mediafire.com/#3x2pisga31ppa

Note: i do not own this gamemode i have just updated Sledbuild for gmod 13

Enjoy and have a grate day!

Please comment if you liked it! :smiley:

There really was no need to credit me, but thanks anyway.

I had to give credit, if you didnt tell me that i would not have a working sledbuild for gmod 13 xD

Nice, tho I’m a bit confused. Does he mean “Sledbuild” or SeldBuild, as the name states? What’s it about then?

What?

I just noticed too. You got the title wrong.

Fixed

The fact you cannot spell nor use capitals makes me not want to download.

Have a grate day.

What exactly has been changed in this version prior to previous versions? Sled build fix was as simple as adding some gm12 font fixes and fixing the map teleporter…

So what did you do?

idk but the gm13 link i got before this post want working, so i guess he fixed that!

Ok so you have two copies of the gamemode in here, one in gamemodes and one in addons…

You have no idea what you are doing O_O

I keep getting this on my dedicated server…

http://puu.sh/1D7dQ

Looks like you’re missing some content for it.

I’ve got a server running this normally 20+ players 24/7.

81.19.211.106:27096

I downloaded the sled gamemode, but my server is having a problem with the sleds just stopping after 2-3feet. I would just like to know if this is a problem due to map friction, or the gamemode itself. I am also having the same problem with the workshop sled version. Any reply would be appreciated.

i have this installed and running on a populated server
but there is an issue when you finish the race the players stay at the bottom and the sled are not retrieved it leaves the seats at the bottom and the rest of the sleds are gone.

any help would be appreciated
thanks

The duplicator library is broken/is used differently in GM13, you’ll have to get a coder to fix it for you…

I’d guess http://wiki.garrysmod.com/page/Libraries/constraint/GetAllConstrainedEntities would work… don’t hold me to it though.

[editline]30th January 2013[/editline]

Here… this should work.

pop this code in gamemode/entities/entities/lng_teleport/init.lua

[lua]
– slb_teleport trigger

ENT.Base = "base_entity"
ENT.Type = "brush"
ENT.AlreadyTeleported = 0

/*---------------------------------------------------------
   Name: Initialize
---------------------------------------------------------*/
function ENT:Initialize()	
end

/*---------------------------------------------------------
   Name: StartTouch
---------------------------------------------------------*/

function ENT:StartTouch( entity )
	entity:SetNetworkedBool( "propisinteleport", true )
	if entity:IsPlayer() and !entity:InVehicle() then
	-- The player isn't supposed to get here without a vehicle.. kill him! >:-D
		if !game.GetMap() == "slb_snowsled_v3" then -- DON'T PUT TRIGGERS OVER NON-RACING AREAS!
			entity:Kill()
		end
	end
	
	if entity:IsPlayer() and entity:InVehicle() then
		if self.AlreadyTeleported == 0 then
			self.AlreadyTeleported = self.AlreadyTeleported + 1
			timer.Simple(1, function() self.TeleportRacer(self, entity, self.AlreadyTeleported) end )
			SetGlobalString("FirstPosition", entity:Nick())

			entity:SetCollisionGroup( COLLISION_GROUP_WEAPON )
			entity:AddFrags(1)
			entity:SetColor(Color(0, 255, 0, 255))
			entity:EmitSound("sledbuild/race/slb_win.mp3", 150, 100)

			for k,v in pairs(player.GetAll()) do
				v:PrintMessage( HUD_PRINTTALK , "[1st] [" ..entity:Nick().. "] First!")
				v:PrintMessage( HUD_PRINTCENTER , "[1st] [" ..entity:Nick().. "] First!")
			end	

		elseif self.AlreadyTeleported == 1 then

			self.AlreadyTeleported = self.AlreadyTeleported + 1

			timer.Simple(1, function() self.TeleportRacer(self, entity, self.AlreadyTeleported) end )

			SetGlobalString("SecondPosition", entity:Nick())

			entity:SetCollisionGroup( COLLISION_GROUP_WEAPON )

			entity:SetColor(Color(255, 255, 0, 255))
			entity:EmitSound("vo/npc/barney/ba_yell.wav", 150, 100)

			for k,v in pairs(player.GetAll()) do
				v:PrintMessage( HUD_PRINTTALK , "[2nd] [" ..entity:Nick().. "] Second!")
				v:PrintMessage( HUD_PRINTCENTER , "[2nd] [" ..entity:Nick().. "] Second!")
			end

		elseif self.AlreadyTeleported == 2 then

			self.AlreadyTeleported = self.AlreadyTeleported + 1

			timer.Simple(1, function() self.TeleportRacer( self, entity, self.AlreadyTeleported) end )

			SetGlobalString("ThirdPosition", entity:Nick())

			entity:SetCollisionGroup( COLLISION_GROUP_WEAPON )

			entity:SetColor(Color(255, 0, 0, 255))
			entity:EmitSound("vo/npc/barney/ba_yell.wav", 150, 100)

			for k,v in pairs(player.GetAll()) do
				v:PrintMessage( HUD_PRINTTALK , "[3rd] [" ..entity:Nick().. "] Third!")
				v:PrintMessage( HUD_PRINTCENTER , "[3rd] [" ..entity:Nick().. "] Third!")
			end

		else

			self.AlreadyTeleported = self.AlreadyTeleported + 1

			timer.Simple(1, function() self.TeleportRacer( self, entity, self.AlreadyTeleported) end )

			entity:SetCollisionGroup( COLLISION_GROUP_WEAPON )
			entity:AddDeaths(1)
			entity:SetColor(Color(255, 255, 255, 255))
			entity:EmitSound("sledbuild/race/slb_lose.mp3", 150, 100)

			for k,v in pairs(player.GetAll()) do
				v:PrintMessage( HUD_PRINTTALK , "[" ..self.AlreadyTeleported.. "th] [" ..entity:Nick().. "]") -- I'll assume there's no more than 20 racers..
			end	
		end
	elseif (entity:IsValid() && (entity:GetClass()=="prop_vehicle_prisoner_pod")) then -- The sled has no player in it! (but a vehicle!)
		timer.Simple(5, function() self.TeleportEmptySled(self, entity) end ) -- Teleport back the lost sled after X seconds (has to be less than executeprop !)
		
	elseif entity:IsValid() then
		timer.Simple(20, function() self.executeprop( self, entity) end ) -- Kill props and players
	end
end

function ENT:TeleportEmptySled(entity)
	if entity:GetNWBool( "propisinteleport" ) then
		self.TeleportRacer(self, entity, 0)
		for k,v in pairs(player.GetAll()) do
			v:PrintMessage( HUD_PRINTTALK , "[Sledbuild] Lost Sled Retrieved.")
		end	
	end
	
end

function ENT:executeprop( entity )
	if entity:GetNWBool( "propisinteleport" ) then
		if entity:GetClass()=="prop_physics" then
			entity:Remove()
		elseif entity:IsPlayer() then
			entity:Kill()
		end
	end
end

function ENT:TeleportRacer( entity, finishid )

	local Destination = "Destination_1st" -- Default spawn. (incase something fails.)
	local Vehicle
	if entity:GetClass() == "prop_vehicle_prisoner_pod" then
		Vehicle = entity
	else
		Vehicle = entity:GetVehicle()
	end
	
	if finishid == 1 then Destination = ents.FindByName("Destination_1st")[1]:GetPos()
		elseif finishid == 2 then Destination = ents.FindByName("Destination_2nd")[1]:GetPos()
		elseif finishid == 3 then Destination = ents.FindByName("Destination_3rd")[1]:GetPos()
		else 
			if game.GetMap() == "slb_snowsled_v3" then
				Destination = ents.FindByName("Destination_Lose"..math.random(1, 3))[math.random(1, 2)]:GetPos()
			else
				Destination = ents.FindByName("Destination_Lose"..math.random(1, 6))[1]:GetPos()
			end
	end

	--Phoenixf129 Fix.
	local VehPos = Vehicle:GetPos()
	local ConstrainedEntities = constraint.GetAllConstrainedEntities( Vehicle )
	for _, ent2 in pairs( ConstrainedEntities ) do
		ent2:SetPos(Destination + (ent2:GetPos() - VehPos))
		ent2:SetCollisionGroup( COLLISION_GROUP_DEBRIS_TRIGGER )
	end
	--End fix... that was easy. For some reason the duplicator library doesn't like being used how it used to, so this here's a workaround!
end

// -------------------------------------------------------------------

/*---------------------------------------------------------
   Name: EndTouch
---------------------------------------------------------*/
function ENT:EndTouch( entity )
	entity:SetNetworkedBool( "propisinteleport", false )
end

/*---------------------------------------------------------
   Name: Touch
---------------------------------------------------------*/
function ENT:Touch( entity )
end

/*---------------------------------------------------------
   Name: PassesTriggerFilters
   Desc: Return true if this object should trigger us
---------------------------------------------------------*/
function ENT:PassesTriggerFilters( entity )
	return true
end

/*---------------------------------------------------------
   Name: KeyValue
   Desc: Called when a keyvalue is added to us
---------------------------------------------------------*/
function ENT:KeyValue( key, value )
end

/*---------------------------------------------------------
   Name: Think
   Desc: Entity's think function. 
---------------------------------------------------------*/
function ENT:Think()
end

/*---------------------------------------------------------
   Name: OnRemove
   Desc: Called just before entity is deleted
---------------------------------------------------------*/
function ENT:OnRemove()
end

/*---------------------------------------------------------
   Name: AcceptInput
   Desc: Do button shite
---------------------------------------------------------*/
function ENT:AcceptInput(name, activator, caller)
end

/*---------------------------------------------------------
   Name: KeyValue
   Desc: Called when a keyvalue is added to us
---------------------------------------------------------*/
function ENT:KeyValue(key, value)
end

// Reset
function ENT:Reset()
	self.AlreadyTeleported = 0
end

[/lua]

I’ve fixed the player colors too.

thank you it worked perfectly