• Ironsights messed up on Prop Hunt?
    10 replies, posted
Hello, I have a question, Whenever I try adding a custom weapon to Prop Hunt the iron sights end up messed up like this: [url]http://i.imgur.com/nmflh1k.jpg[/url] I have tried several bases but still the same problem. Im guessing it is something got to do with the game mode files as: The funny thing is whenever I start the game on Single Player sandbox and load up the weapon it is completely fine just like this: [url]http://oi58.tinypic.com/x58u4p.jpg[/url] Can I get some help please :).
What weapons base are you using? Have you tried checking through the prop hunt code to see if it's changing the iron sight position?
So far I have tried, CS Real base, M9K base and the Prop Hunt V2 base. All of them, same problem, I have tried checking the code to see if it's changing the iron sight position but without success, if anyone can guide me if that is the problem that'd be great.
Which prop hunt are you using?
Oh, I can help here since I had the same issue. If you're using the copy of Prop Hunt on the fretta base, then the problem is caused by the gamemode overriding CalcView, which started becoming a problem with the new Gmod update! Go into gamemodes/fretta or where ever it's located and go to line 213 Replace [code] function GM:CalcView( ply, origin, angles, fov ) local view = ply:CallClassFunction( "CalcView", origin, angles, fov ) or { ["origin"] = origin, ["angles"] = angles, ["fov"] = fov }; origin = view.origin or origin angles = view.angles or angles fov = view.fov or fov local wep = ply:GetActiveWeapon() if ( IsValid( wep ) ) then local func = wep.GetViewModelPosition if ( func ) then view.vm_origin, view.vm_angles = func( wep, origin*1, angles*1 ) end local func = wep.CalcView if ( func ) then view.origin, view.angles, view.fov = func( wep, ply, origin*1, angles*1, fov ) end end return view end [/code] with [code] function GM:CalcView( ply, origin, angles, fov ) local view = ply:CallClassFunction( "CalcView", origin, angles, fov ) or { ["origin"] = origin, ["angles"] = angles, ["fov"] = fov }; origin = view.origin or origin angles = view.angles or angles fov = view.fov or fov local wep = ply:GetActiveWeapon() if ( IsValid( wep ) ) then local func = wep.CalcView if ( func ) then view.origin, view.angles, view.fov = func( wep, ply, origin*1, angles*1, fov ) end end return view end [/code]
Thanks for the reply, code_gs, I am using [url]http://steamcommunity.com/sharedfiles/filedetails/?id=207938283[/url] Prop Hunt ULX Version, as the other versions were causing me problems in voting, NiandraLades, I have just tried that, changed the shared.lua of gamemodes/fretta but the iron sights are still messed up and going to the left? Maybe its because of the different version? [editline]9th May 2014[/editline] Maybe i have to edit somewhere different, if you have any idea on this problem please reply
I have just tried many versions of Fretta and Prop hunt but non of them work :(, I don't understand what is wrong.
I have found something, I don't think it is that hook that is affecting the iron sights, as even if the whole hook is removed the game mode runs fine and the issue persists.
Do me a favour, can you post the original code for gamemodes/fretta/shared.lua?
Sure, this is it for the current version I am trying, the original Also its gamemodes\fretta\gamemode\shared.lua [QUOTE]/* shared.lua - Shared Component ----------------------------------------------------- This is the shared component of your gamemode, a lot of the game variables can be changed from here. */ include( "player_class.lua" ) include( "player_extension.lua" ) include( "class_default.lua" ) include( "player_colours.lua" ) fretta_voting = CreateConVar( "fretta_voting", "1", { FCVAR_REPLICATED, FCVAR_NOTIFY, FCVAR_ARCHIVE }, "Allow/Dissallow voting" ) GM.Name = "Simple Game Base" GM.Author = "Anonymous" GM.Email = "" GM.Website = "www.garry.tv" GM.Help = "No Help Available" GM.TeamBased = true // Team based game or a Free For All game? GM.AllowAutoTeam = true // Allow auto-assign? GM.AllowSpectating = true // Allow people to spectate during the game? GM.SecondsBetweenTeamSwitches = 10 // The minimum time between each team change? GM.GameLength = 15 // The overall length of the game GM.RoundLimit = -1 // Maximum amount of rounds to be played in round based games GM.VotingDelay = 5 // Delay between end of game, and vote. if you want to display any extra screens before the vote pops up GM.ShowTeamName = true // Show the team name on the HUD GM.NoPlayerSuicide = false // Set to true if players should not be allowed to commit suicide. GM.NoPlayerDamage = false // Set to true if players should not be able to damage each other. GM.NoPlayerSelfDamage = false // Allow players to hurt themselves? GM.NoPlayerTeamDamage = true // Allow team-members to hurt each other? GM.NoPlayerPlayerDamage = false // Allow players to hurt each other? GM.NoNonPlayerPlayerDamage = false // Allow damage from non players (physics, fire etc) GM.NoPlayerFootsteps = false // When true, all players have silent footsteps GM.PlayerCanNoClip = false // When true, players can use noclip without sv_cheats GM.TakeFragOnSuicide = true // -1 frag on suicide GM.MaximumDeathLength = 0 // Player will repspawn if death length > this (can be 0 to disable) GM.MinimumDeathLength = 2 // Player has to be dead for at least this long GM.AutomaticTeamBalance = false // Teams will be periodically balanced GM.ForceJoinBalancedTeams = true // Players won't be allowed to join a team if it has more players than another team GM.RealisticFallDamage = false // Set to true if you want realistic fall damage instead of the fix 10 damage. GM.AddFragsToTeamScore = false // Adds player's individual kills to team score (must be team based) GM.NoAutomaticSpawning = false // Players don't spawn automatically when they die, some other system spawns them GM.RoundBased = false // Round based, like CS GM.RoundLength = 30 // Round length, in seconds GM.RoundPreStartTime = 5 // Preperation time before a round starts GM.RoundPostLength = 8 // Seconds to show the 'x team won!' screen at the end of a round GM.RoundEndsWhenOneTeamAlive = true // CS Style rules GM.EnableFreezeCam = false // TF2 Style Freezecam GM.DeathLingerTime = 4 // The time between you dying and it going into spectator mode, 0 disables GM.SelectModel = true // Can players use the playermodel picker in the F1 menu? GM.SelectColor = false // Can players modify the colour of their name? (ie.. no teams) GM.PlayerRingSize = 48 // How big are the colored rings under the player's feet (if they are enabled) ? GM.HudSkin = "SimpleSkin" // The Derma skin to use for the HUD components GM.SuicideString = "died" // The string to append to the player's name when they commit suicide. GM.DeathNoticeDefaultColor = Color( 255, 128, 0 ); // Default colour for entity kills GM.DeathNoticeTextColor = color_white; // colour for text ie. "died", "killed" GM.ValidSpectatorModes = { OBS_MODE_CHASE, OBS_MODE_IN_EYE, OBS_MODE_ROAMING } // The spectator modes that are allowed GM.ValidSpectatorEntities = { "player" } // Entities we can spectate, players being the obvious default choice. GM.CanOnlySpectateOwnTeam = true; // you can only spectate players on your own team DeriveGamemode( "base" ) TEAM_GREEN = 1 TEAM_ORANGE = 2 TEAM_BLUE = 3 TEAM_RED = 4 /*--------------------------------------------------------- Name: gamemode:CreateTeams() Desc: Set up all your teams here. Note - HAS to be shared. ---------------------------------------------------------*/ function GM:CreateTeams() if ( !GAMEMODE.TeamBased ) then return end team.SetUp( TEAM_GREEN, "Green Team", Color( 70, 230, 70 ), true ) team.SetSpawnPoint( TEAM_GREEN, "info_player_start" ) // The list of entities can be a table team.SetUp( TEAM_ORANGE, "Orange Team", Color( 255, 200, 50 ) ) team.SetSpawnPoint( TEAM_ORANGE, "info_player_start", true ) team.SetUp( TEAM_BLUE, "Blue Team", Color( 80, 150, 255 ) ) team.SetSpawnPoint( TEAM_BLUE, "info_player_start", true ) team.SetUp( TEAM_RED, "Red Team", Color( 255, 80, 80 ) ) team.SetSpawnPoint( TEAM_RED, "info_player_start", true ) team.SetUp( TEAM_SPECTATOR, "Spectators", Color( 200, 200, 200 ), true ) team.SetSpawnPoint( TEAM_SPECTATOR, "info_player_start" ) team.SetClass( TEAM_SPECTATOR, { "Spectator" } ) end function GM:InGamemodeVote() return GetGlobalBool( "InGamemodeVote", false ) end /*--------------------------------------------------------- Name: gamemode:TeamHasEnoughPlayers( Number teamid ) Desc: Return true if the team has too many players. Useful for when forced auto-assign is on. ---------------------------------------------------------*/ function GM:TeamHasEnoughPlayers( teamid ) local PlayerCount = team.NumPlayers( teamid ) // Don't let them join a team if it has more players than another team if ( GAMEMODE.ForceJoinBalancedTeams ) then for id, tm in pairs( team.GetAllTeams() ) do if ( id > 0 && id < 1000 && team.NumPlayers( id ) < PlayerCount && team.Joinable(id) ) then return true end end end return false end /*--------------------------------------------------------- Name: gamemode:PlayerCanJoinTeam( Player ply, Number teamid ) Desc: Are we allowed to join a team? Return true if so. ---------------------------------------------------------*/ function GM:PlayerCanJoinTeam( ply, teamid ) if ( SERVER && !self.BaseClass:PlayerCanJoinTeam( ply, teamid ) ) then return false end if ( GAMEMODE:TeamHasEnoughPlayers( teamid ) ) then ply:ChatPrint( "That team is full!" ) ply:SendLua("GAMEMODE:ShowTeam()") return false end return true end /*--------------------------------------------------------- Name: gamemode:Move( Player ply, CMoveData mv ) Desc: Setup Move, this also calls the player's class move function. ---------------------------------------------------------*/ function GM:Move( ply, mv ) if ( ply:CallClassFunction( "Move", mv ) ) then return true end end /*--------------------------------------------------------- Name: gamemode:KeyPress( Player ply, Number key ) Desc: Player presses a key, this also calls the player's class OnKeyPress function. ---------------------------------------------------------*/ function GM:KeyPress( ply, key ) if ( ply:CallClassFunction( "OnKeyPress", key ) ) then return true end end /*--------------------------------------------------------- Name: gamemode:KeyRelease( Player ply, Number key ) Desc: Player releases a key, this also calls the player's class OnKeyRelease function. ---------------------------------------------------------*/ function GM:KeyRelease( ply, key ) if ( ply:CallClassFunction( "OnKeyRelease", key ) ) then return true end end /*--------------------------------------------------------- Name: gamemode:PlayerFootstep( Player ply, Vector pos, Number foot, String sound, Float volume, CReceipientFilter rf ) Desc: Player's feet makes a sound, this also calls the player's class Footstep function. If you want to disable all footsteps set GM.NoPlayerFootsteps t
Im just going to give up on this one and say Prop hunt doesn't work well with custom weapons which is why i have decided to just leave the weapons without iron sights, Thanks for everyone that answered,
Sorry, you need to Log In to post a reply to this thread.