ULX

Author Topic: Fretta/Base First Person Death Bug  (Read 2027 times)

0 Members and 1 Guest are viewing this topic.

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Fretta/Base First Person Death Bug
« on: September 10, 2014, 08:40:58 PM »
when a player dies, they are stuck motionless in first person view rather then spectator, they ragdoll. ive done everything I know how to do and I am simply sick of it. im not too proud to ask for help if I need it. Fretta is sentient and has a mind of her own. I need somebody who can appease her so that this curse will end. how do I set it up so my users no longer ragdoll when they die. just spectate...?
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: Fretta/Base First Person Death Bug
« Reply #1 on: September 11, 2014, 07:23:53 AM »
Hello,
take a look at this dummy code:
Code: [Select]
function GM:DoPlayerDeath( ply )
ply:DropWeapon(ply:GetActiveWeapon())
ply:CreateRagdoll()
        ply:SetTeam(TEAM_SPECTATOR)
        ply:Spectate(OBS_MODE_ROAMING)
ply:SpectateEntity(nil)
        ply:SetPos(ply:EyePos())
end

Here are some functions that will help you:
SetTeam, aswell as Spectate and those two hooks: DoPlayerDeath and PlayerDeath.

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Re: Fretta/Base First Person Death Bug
« Reply #2 on: September 11, 2014, 12:09:56 PM »
ok so I tried it out no script errors occurred, it labels the name of the person im spectating at the bottom as it should, indicating that I am in fact spectating, however, I can only see first person view.
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: Fretta/Base First Person Death Bug
« Reply #3 on: September 11, 2014, 12:18:56 PM »
Hello,

Code: [Select]
ply:Spectate(OBS_MODE_ROAMING)
Puts the player in freecam / "roaming mode".
Try it without SpectateEntity, as this is used for spectating players.

Also take a look at the PlayerSpawn Hook:
Code: [Select]
if ply:Team() == TEAM_SPECTATOR then
ply:Spectate(OBS_MODE_ROAMING)
return
end

Avoid
« Last Edit: September 11, 2014, 12:36:31 PM by Avoid »

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Re: Fretta/Base First Person Death Bug
« Reply #4 on: September 11, 2014, 12:27:37 PM »
tried that and all it did was as it should, set the cam into what would be freeroam. and you "Start" spectator in freeroam rather then starting with eyes on a player, it reads and reners fine. but im stuck in first person view. you would have to see for yourself to understand what I mean 100% if your willing to take a moment and actually see the issue first hand, even blasteh with everyone's banana was confused by it. its a unique bug.
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: Fretta/Base First Person Death Bug
« Reply #5 on: September 11, 2014, 04:30:28 PM »
Hello,
I went ahead, added ChaosWolf to my friends list and tried to help him out.

I came to the conclusion, that this issue is caused by one of many addons/workshop items/autorun files, as the gamemode (PropHunt) works fine whilst playing without any addons or testing it locally!

I recommend removing all your custom content and testing one by one, also do not use workshop, use FastDL instead!

Avoid

Offline ChaosWolf

  • Jr. Member
  • **
  • Posts: 94
  • Karma: 2
  • "The Exiled One's" Server Owner
Re: Fretta/Base First Person Death Bug
« Reply #6 on: September 12, 2014, 09:28:58 PM »
well its not in my addons folder, and its not in my lua folder, because I removed addons completely and ran the server without them. then ran the server using a stock lua from SteamCMD and the error still occurred. so after returning my addons I need a new lead as to where I could possibly look to pry out the cause.
"Someone once told me, scripting lua is like trying to build a rocket ship, once your finished with it and think your done, you start it up only to realize you had just built it upside down." ~Programmer