1. Post #1
    I hide under your bed
    Dennab
    July 2011
    1,877 Posts
    Gimmix is essentially an addon that randomly creates game-altering crap. You can control how frequently this crap spawns. The gimmicks range from beneficial to funny to deadly to downright annoying to ragequittingly awful. Gimmix works with essentially every gamemode.



    Here's a list of completed gimmicks:

    Delivery Gimmicks - Not exactly gimmicks. They're used to deliver the gimmicks to the players.
    - Pandora's Box. A strange vibrating box spawns somewhere on the map. Nearby players will be notified of its presence. The first player to find and open the box is given a ~random gimmick~. This could be good or bad depending on which gimmick you get.
    - Spontaneous Fuckery. A random player is chosen and a random gimmick is imparted upon them. This one happens less frequently because it can get very fucking annoying.
    - Guessing Game. A random player has 3 overturned pots spawn in front of him. 1 contains a beneficial gimmick. 2 contain evil gimmicks. ARE YOU MAN ENOUGH? BIG AND BAD ENOUGH?
    - Communism. The least frequent delivery method. Everyone gets the same gimmick. Chaos will follow.

    Player-based gimmicks - Gimmicks that directly affect players
    - Drunkness. The affected player becomes drunk. Their vision blurs and their camera wobbles around slowly.
    - Spontaneous Tourettes Syndrome. The affected player begins to cuss up a storm. Their view shakes violently for 30 seconds.
    - Memetic Kill Agent. Any players near the target player must follow the player or they will slowly die.
    - Full heal. Player has their health restored.

    Weapon-based gimmicks - Weapons you can get
    - None yet

    Entity gimmicks - Entities that spawn on the map
    - Proximity Mine.

    Check out these Sweet Pics, Mate!



    The cussing in the second screenshot is 100% generated by the tourettes script.



    That's a combination of tourettes and drunkness. It's very unpleasant.

    Commands:

    - sv_gimmix_interval (how often does the script "roll" for a new gimmick?)
    - sv_gimmix_chance (what are the odds a gimmick will occur on a given "roll"?)

    local GIMMICK = {}
    
    GIMMICK.Type = GIMMICK_PLAYER // this is used to differentiate between delivery methods and real gimmicks
    GIMMICK.Duration = 60 * 2
    GIMMICK.Shared = true // does the client need to run any code?
    GIMMICK.ClientHooks = { "RenderScreenspaceEffects", "CalcView" } // which functions in this gimmick should be interpreted as clientside hooks?
    GIMMICK.Beneficial = false // does this gimmick benefit any players? this determines whether the guessing game considers it a good or bad gimmick.
    GIMMICK.Hooks = {} // which functions in this gimmick should be interpreted as serverside hooks?
    GIMMICK.Chance = 1.0 // what are the odds that this gimmick will be chosen (relative to the other gimmicks)? A chance of 0.2 would mean there's a 20% chance it will be chosen.
    
    function GIMMICK:OnStart()
    
    	local ply = self:GetPlayer()
    	
    	if ValidEntity( ply ) then
    		
    		GIMMIX.ChatPrint( { "Looks like ", ply, " has been hitting the sauce pretty hard..." } )
    	
    	end
    
    end
    
    function GIMMICK:OnEnd()
    	
    	local ply = self:GetPlayer()
    	
    	if ValidEntity( ply ) then
    		
    		GIMMIX.ChatPrint( { "You've sobered up!" }, ply )
    	
    	end
    
    end
    
    function GIMMICK:OnClientStart()
    
    	self.WobbleTime = CurTime() + self.Duration - 40
    	self.Ang = Angle(0,0,0)
    	self.TargAng = Angle(1,1,1)
            self.Intensity = 0
    
    end
    
    function GIMMICK:OnClientEnd()
    
    end
    
    function GIMMICK:RenderScreenspaceEffects()
    
    	DrawMotionBlur( 0.05, 0.6, 0.01 )
    
    end
    
    function GIMMICK:CalcView( ply, origin, angle, fov )
    
    	if self.WobbleTime > CurTime() then
    
    		self.Intensity = math.Approach( self.Intensity, 20, FrameTime() )
    		
    	else
    	
    		self.Intensity = math.Approach( self.Intensity, 0, FrameTime() )
    	
    	end
    
    	self.Ang.p = math.Approach( self.Ang.p, self.TargAng.p, 0.001 )
    	self.Ang.y = math.Approach( self.Ang.y, self.TargAng.y, 0.001 )
    	self.Ang.r = math.Approach( self.Ang.r, self.TargAng.r, 0.001 )
    	
    	if self.Ang == self.TargAng then
    	
    		self.TargAng = Angle( math.Rand( 0, 5 ), math.Rand( 0, 5 ), math.Rand( 0, 5 ) )
    	
    	end
    	
    	angle.roll = angle.roll + math.sin( CurTime() + self.Ang.r ) * self.Intensity
    	angle.pitch = angle.pitch + math.sin( CurTime() + self.Ang.p ) * self.Intensity
    	angle.yaw = angle.yaw + math.sin( CurTime() + self.Ang.y ) * self.Intensity
    
    	return ply, origin, angle, fov
    
    end
    
    gimmick.Register( GIMMICK )

    If anyone here wants to create their own gimmick feel free to ask me any questions about this.
    Reply With Quote Edit / Delete Reply Windows 7 Canada Show Events Funny Funny x 6Winner Winner x 2Useful Useful x 1 (list)

  2. Post #2
    Peach's Avatar
    July 2011
    71 Posts
    Nice job, <3

  3. Post #3
    I hide under your bed
    Dennab
    July 2011
    1,877 Posts
    I'm just going to paste code for more gimmicks here since i'm lazy and don't feel like updating the release.

    local GIMMICK = {} // This is like, worse than the communism gimmick. Every player on the server is given a random gimmick at the same time. 
    GIMMICK.Type = GIMMICK_SPAWNER
    GIMMICK.Chance = 0.01
    
    function GIMMICK:OnStart()
    	
    	GIMMIX.ChatPrint( { "BEEP BOOP COMPUTER" } )
    	
    	for k,v in pairs( player.GetAll() ) do
    	
    		local gim = gimmick.GetExcludeTypes( { GIMMICK_SPAWNER } )
    		GIMMIX.StartGimmick( nil, v, gim )
    		
    	end
    
    end
    
    gimmick.Register( GIMMICK )

    e: Acid trip woo

    local GIMMICK = {} // ACID TRIP
    GIMMICK.Type = GIMMICK_PLAYER
    GIMMICK.Duration = 60
    GIMMICK.Shared = true
    GIMMICK.ClientHooks = { "HUDPaint", "CalcView" }
    GIMMICK.Intensity = 0
    
    function GIMMICK:OnStart()
    
    	local ply = self:GetPlayer()
    	
    	if ValidEntity( ply ) then
    		
    		GIMMIX.ChatPrint( { ply, " is tripping the fuck out..." } )
    	
    	end
    
    end
    
    function GIMMICK:OnEnd()
    	
    	local ply = self:GetPlayer()
    	
    	if ValidEntity( ply ) then
    		
    		GIMMIX.ChatPrint( { "You've sobered up!" }, ply )
    	
    	end
    
    end
    
    function GIMMICK:OnClientStart()
    
    	self.WobbleTime = CurTime() + self.Duration - 40
    	self.Ang = Angle(0,0,0)
    	self.TargAng = Angle(1,1,1)
    	self.ColTime = 0
    	self.Col = Color(255,0,0,50)
    
    end
    
    function GIMMICK:GetColor()
    
    	local col = Color(255,0,0,50)
    	
    	col.r = table.Random{ 255, 0 }
    	col.g = table.Random{ 255, 0 }
    	col.b = table.Random{ 255, 0 }
    	
    	if col.r == 0 and col.g == 0 and col.b == 0 then
    	
    		col.r = 255
    	
    	end
    	
    	return col
    
    end
    
    function GIMMICK:HUDPaint()
    
    	if self.ColTime < CurTime() then
    	
    		self.ColTime = CurTime() + 0.2
    		self.Col = self:GetColor()
    	
    	end
    
    	draw.RoundedBox( 4, 0, 0, ScrW(), ScrH(), self.Col )
    
    end
    
    function GIMMICK:CalcView( ply, origin, angle, fov )
    
    	if self.WobbleTime > CurTime() then
    
    		self.Intensity = math.Approach( self.Intensity, 10, FrameTime() )
    		
    	else
    	
    		self.Intensity = math.Approach( self.Intensity, 0, FrameTime() )
    	
    	end
    
    	self.Ang.p = math.Approach( self.Ang.p, self.TargAng.p, 0.001 )
    	self.Ang.y = math.Approach( self.Ang.y, self.TargAng.y, 0.001 )
    	self.Ang.r = math.Approach( self.Ang.r, self.TargAng.r, 0.001 )
    	
    	if self.Ang == self.TargAng then
    	
    		self.TargAng = Angle( math.Rand( 0, 5 ), math.Rand( 0, 5 ), math.Rand( 0, 5 ) )
    	
    	end
    	
    	angle.roll = angle.roll + math.sin( CurTime() + self.Ang.r ) * self.Intensity
    	angle.pitch = angle.pitch + math.sin( CurTime() + self.Ang.p ) * self.Intensity
    	angle.yaw = angle.yaw + math.sin( CurTime() + self.Ang.y ) * self.Intensity
    
    	return ply, origin, angle, fov
    
    end
    
    gimmick.Register( GIMMICK )

  4. Post #4
    Mr Uber Ostrich's Avatar
    June 2011
    723 Posts
    Looks pretty cool. Keep up the work!
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Informative Informative x 1 (list)

  5. Post #5
    I hide under your bed
    Dennab
    July 2011
    1,877 Posts
    Making another trippy one.



    Clientside models randomly appearing to creep you the fuck out.