issue with Fretta sv_gmchanger/init.lua

This issue is causing the game to get stuck when trying to vote for a gamemode.

[ERROR] gamemodes/fretta/gamemode/sv_gmchanger.lua:37: attempt to index a nil value

  1. GetNumberOfGamemodeMaps - gamemodes/fretta/gamemode/sv_gmchanger.lua:37
  2. StartGamemodeVote - gamemodes/fretta/gamemode/sv_gmchanger.lua:263
  3. unknown - gamemodes/fretta/gamemode/init.lua:498

sv_gmchanger.lua:

init.lua:

It is for this gamemode:

anyone? :frowning:

Does this happen any time the vote comes up or just when there’s no one on the server that can vote?

Just anytime it comes to the voting I believe

Ah, right, okay, that’s very strange. Have you modified any of the fretta stuff and checked to see if it works on singleplayer at all?

Just by googling once, I made my way through those answers:
Try to put this in your server.cfg:


fretta_voting 0

If that didn’t work, try this:


function GM:StartFrettaVote()
   if GAMEMODE.m_bVotingStarted or GAMEMODE:InGamemodeVote() then return end
      -- manually set what would be the result of a GM vote otherwise
      GAMEMODE.WinningGamemode = "whateveryourdeathrungamemodeis"

      GAMEMODE.m_bVotingStarted = true

      GAMEMODE:ClearPlayerWants()
      
      GAMEMODE:StartMapVote()
end

Edited: I know for sure, that a friend of mine know how to fix it, as the exact same problem occurred on his server too once. I’ll gladly ask him, however there will go a few days, as he’s on vacation.

@NiandraLades: I have not edited the fretta that came with the game mode initially.
@The Beta: I have tried the fretta_vote 0 via console and I think that had no affect (command did run, just still lingered at the initializing the vote)

As for that piece of code I actually have that in use for my prop hunt servers and had copied my sv_gmchanger from that to this new game mode but it still did not work even though it works on my prop hunt (I even copied the entire fretta from my prop hunt to this game mode)

I am wondering if it could be something in the game mode itself causing the issue now :confused:
(Talking to the game mode developer, waiting on a response)

Alright.
I’ve just sent my friend a link to the topic, and he should be able to respond within tomorrow or a couple of days.

Edited: No, it’s not caused by the gamemode, and I know for sure, that this happens for the popular gamemode “Prophunt” too.

Cool, thanks!

Hey, do me a quick favour, download this and see if the same problem occurs. The gamemode name is pedobear, so use that in the command line thing. Fretta is included, too.

Will test when I get home from work! (2 hours from now)

Sure thing, if that works then it’s the gamemode you were using and if it’s still borked, then it’ll be something external causing the issue

Use mine, 100% fix. I think i supplied you it niandra :V

http://puu.sh/6EfXj.zip

If you have any issues, make sure your gamemodes are using the “fretta” base, not “fretta13”. (DeriveBase(“fretta”))

This is slightly different/updated, and works perfectly, so enjoy.

awesome! like i said up there, will try when i get home from work :smiley: much appreciated!

Ah, that you did and this’ll definitely be useful to a lot of people, but it’d be a bit weird to give out other people’s code

That and fretta vote breaking ANYTIME there’s a vote means something isn’t right on your end :v:

I alright I used that new one, same issue happened.

in game it will say “Starting gamemode voting…” but then nothing appears on the screen.
tested on my mac laptop and on pc, so not user side issue.

thinking gamemode issue but not sure where to look, no word from developer yet

Alright, that’s interesting. The dropbox I linked you was a copy I fixed up a while back and I know it works because I tested it earlier on my dev server.

When you say ‘Starting gamemode voting’ shows up, I know that is printed to chat. Does anything happen beyond that? Like, does the gamemode vote show up at all or just has no gamemodes

doesn’t show any game modes, im going to try and rebuild the server form the beginning but starting it with the diff fretta you guys supplied and see if that makes a difference

Judd, did rebuilding make a difference?

Got caught up with something at work last night, will be trying today. will report afterwards!