Announcement

Collapse
No announcement yet.

Vote-Map: Add QuakeC to any mod

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    not.working.

    Testing with a dedicated Proquake server on the same machine. Typing map name into console and nothing happens. When I type "Yes", though, I get "No vote in progress". I also get "Bindings sent" and "blah has been disabled on this server" when connecting (not when respawning).

    What is the "vote0" command for. Is that a typo?
    Scout's Journey
    Rune of Earth Magic

    Comment


    • #32
      Are you sure the VOTE_PRIMARY_IMPULSE (97) is not being over-ridden in ImpulseCommands()? I.E. The impulse 97 is called earlier in the impulses list and the code stops.

      It's sometimes complicated adding a lot of foreign code to a code base that has already been modded heavily. Just remember that this code was designed to fit into vanilla quake, not a mod. Try following from start to finish the route the code takes and add debug messages in places that might be of concern. This way you will know what is being called and what is not.

      As for the maps being hardcoded there is a way around that. Baker has the right idea. There's a utility CAx uses that replaces a predetermined string in the progs with a customized string read from a text file. I.E. "string_01" to "dm6.bsp"

      Hope this helps!

      Comment


      • #33
        Are you sure the VOTE_PRIMARY_IMPULSE (97) is not being over-ridden in ImpulseCommands()? I.E. The impulse 97 is called earlier in the impulses list and the code stops.
        Absolutely sure.

        Just remember that this code was designed to fit into vanilla quake, not a mod.
        It's clear; I'm not blaming you. I'm grateful for the code.

        What is supposed to happen if it works? A message popping up?

        I have a hard time following the code. The basic working isn't clear to me. Apparently there are two impulses being sent? I can code monster behaviour, even bot AI, but when it comes to impulses and network stuff I'm clueless.

        (It's not documented, either - the tutorial says "copy this there", but not what it does).
        Last edited by golden_boy; 11-24-2008, 04:47 PM.
        Scout's Journey
        Rune of Earth Magic

        Comment


        • #34
          Are you using FTEQCC to compile I hope?

          When you might consider doing, is slapping some #IFDEF VOTE ... #ENDIF // VOTE around the vote code (conditional compilation).

          This really helps organization of code and makes it a heck of a lot easier to track down problems.
          Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

          So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

          Comment


          • #35
            What is supposed to happen if the code works properly is a vote is cast for the command the player wants. If there is only 1 player the vote will automatically initiate the command (I.E. change map, change mode, etc), otherwise it will initiate a vote for the command.

            The code is basically an impulse hack that lets you use 1 main impulse for every vote option. Incorporating map voting in a mod was always a tough one because for every vote there must be an impulse identified to it. Unless you make a menu system and that isn't as convenient. That means there could be 50+ impulses eaten up just on map impulses and on an already developed mod, finding room for that many impulses would be hard.

            - How it works -

            First it sends out the main impulse (I.E. when the player punches in a map name). Once the code recognizes a player has done so it opens up any and all impulses to be used without interfering with other standard impulses (I.E. we now have the ability to use impulse 7 without switching to rocket launcher) because it is now in a different mode for a split second. So as soon as that second impulse is sent the code sees the actual command to vote for and everything impulse related is reset. From there the vote system kicks in because it now knows what command is wanted.
            Last edited by Bam; 11-24-2008, 08:41 PM.

            Comment


            • #36
              Yep, we're using FTEQCC. It's not that much stuff to remember, but I might eventually do it. It means I have to turn the progs.src into a qc file, but everyone will have to live with that.

              Bam, thanks, I see how it works now. The impulse stuff seems to be fine - it may be my pflag and vflag setting stuff that's a bit messed up. I'll get to that. I hope DRS returns soon so he can just *poof* do his magic there.
              Scout's Journey
              Rune of Earth Magic

              Comment


              • #37
                By studying the implementation of "rcon", part of me wonders if it isn't possible to implement vote-map as a server feature.

                This would require client side modifications, however as some extra command similar to rcon would need to be added.

                Plus the mod would need to have the ability to disable the feature contextually because some situations in a mod (like 2 players having a match) the server shouldn't be allowed to change the map just because some non-participants voted. (that's 1 example situation).
                Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

                So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

                Comment


                • #38
                  another small niggle, when loading the first map it only prints "Player bindings sent", but on successive maps it also spams "blah has been disabled on this server". I think that should only be printed when r_wateralpha etc are used; however I have that neither in my autoexec nor in my config.cfg. So I have no idea where that is coming from.

                  Anyway, real coder needed to fix this :-/

                  It's apparently not that easy to plug something like this into "any mod".
                  Scout's Journey
                  Rune of Earth Magic

                  Comment


                  • #39
                    ...on successive maps it also spams "blah has been disabled on this server".
                    That stuff you can remove from bindings.qc if you would like. I didn't think it would spam those messages unless the mod is reloaded. There must be some other source that is calling those commands upon map change, because if those messages print, so should the bindings sent message. Would there be some sort of config that is being loaded each map? Maybe I'm wrong about this? Another alternative is to change r_wateralpha, chase_active, etc alias's to that of r_novis. Just mimic how r_novis's alias is changed and it won't print those annoying messages, but will still disable them.

                    Comment


                    • #40
                      Got it working.

                      Solution: In ImpulseCommands(), change

                      self.primary_impulse_hack = time + 0.3

                      to

                      self.primary_impulse_hack = time + 1

                      and it works. Otherwise the .impulse gets zeroed before the map impulse is sent.

                      This may have to do with sys_tickrate. Credit goes to Supa for this fix.
                      Scout's Journey
                      Rune of Earth Magic

                      Comment


                      • #41
                        Originally posted by golden_boy View Post
                        Got it working.

                        Solution: In ImpulseCommands(), change

                        self.primary_impulse_hack = time + 0.3

                        to

                        self.primary_impulse_hack = time + 1

                        and it works. Otherwise the .impulse gets zeroed before the map impulse is sent.

                        This may have to do with sys_tickrate. Credit goes to Supa for this fix.
                        Thanks for posting the information.
                        Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

                        So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

                        Comment

                        Working...
                        X