Announcement

Collapse
No announcement yet.

Vote-Map: Add QuakeC to any mod

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

  • #16
    hmm i keep getting an error from vote.qc

    combat.qc
    items.qc
    vote.qc
    vote.qc(385): error: Unknown value "intermission_running"

    ../progs.dat - 1 error(s), 0 warning(s)
    >Exit code: 1

    maybe once i get the observer and map vote added to this "clean progs 106"
    ill release it so everyone can have it to build off of

    Comment


    • #17
      Did you try looking for where it might be defined, and maybe see if you have the qc files being loaded in the wrong order?
      16:03:04 <gb> when I put in a sng, I think I might need nails
      16:03:30 <gb> the fact that only playtesting tells me that probably means that my mind is a sieve

      Comment


      • #18
        in src:
        Code:
        ../progs.dat
        
        defs.qc
        settings.qc // bam map vote
        observer.qc //bam observer mode
        func.qc // bam map vote
        subs.qc
        fight.qc
        ai.qc
        combat.qc
        items.qc
        vote.qc // bam map vote
        weapons.qc
        world.qc
        bindings.qc // bam map vote
        client.qc
        player.qc
        monsters.qc
        doors.qc
        buttons.qc
        triggers.qc
        plats.qc
        misc.qc
        
        ogre.qc
        demon.qc
        shambler.qc
        knight.qc
        soldier.qc
        wizard.qc
        dog.qc
        zombie.qc
        boss.qc
        
        tarbaby.qc		// registered
        hknight.qc		// registered
        fish.qc			// registered
        shalrath.qc		// registered
        enforcer.qc		// registered
        oldone.qc		// registered
        in vote.qc:
        Code:
        			vote_print (3);
        	}
        	
        	self.nextthink = time + 0.25;
        };
        
        void (string mode_name, void () func)
        vote_spawn =
        {
        	local entity e;
        	
        	if (intermission_running)
        		return;
        	
        	e = spawn ();
        	e.owner 		= self;
        	e.use 			= func; 
        	e.classname 	= "vote_counter";
        	e.message 		= mode_name;
        	e.vdelay		= time + VOTE_PRINT_DELAY;
        	e.vcount		= 0;
        	e.think 		= vote_think;
        	e.nextthink 	= time + 0.25;
        	
        	vote_print (1);
        };
        
        void () vote_impulse =
        {
        	local entity e;
        	
        	e = find (world, classname, "vote_counter");
        	
        	if (!e)
        in client.qc:
        Code:
        *
        =============================================================================
        
        				LEVEL CHANGING / INTERMISSION
        
        =============================================================================
        */
        
        float	intermission_running;
        float	intermission_exittime;
        
        /*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16)
        This is the camera point for the intermission.
        Use mangle instead of angle, so you can set pitch or roll as well as yaw.  'pitch roll yaw'
        */
        void() info_intermission =
        {
        };
        // bam votemap add :
        void ()
        SetParms2 =
        {
        parm1 = IT_SHOTGUN | IT_AXE;
        parm2 = 100;
        parm3 = 0;
        parm4 = 25;
        parm5 = 0;
        parm6 = 0;
        parm7 = 0;
        parm8 = 1;
        parm9 = 0;
        parm10 = self.pflag; 
        }; 
        
        
        void() SetChangeParms =
        {
        	if (self.health <= 0)
        	{
        		SetNewParms2 (); /// bam votemap change
        		return;
        	}
        
        // remove items
        	self.items = self.items - (self.items & 
        	(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
        	
        // cap super health
        	if (self.health > 100)
        		self.health = 100;
        	if (self.health < 50)
        		self.health = 50;
        	parm1 = self.items;
        	parm2 = self.health;
        	parm3 = self.armorvalue;
        	if (self.ammo_shells < 25)
        		parm4 = 25;
        	else
        		parm4 = self.ammo_shells;
        	parm5 = self.ammo_nails;
        	parm6 = self.ammo_rockets;
        	parm7 = self.ammo_cells;
        	parm8 = self.weapon;
        	parm9 = self.armortype * 100;
        	pram10 = self.pflag; // bam votemap add
        };
        
        void() SetNewParms =
        {
        	parm1 = IT_SHOTGUN | IT_AXE;
        	parm2 = 100;
        	parm3 = 0;
        	parm4 = 25;
        	parm5 = 0;
        	parm6 = 0;
        	parm7 = 0;
        	parm8 = 1;
        	parm9 = 0;
        	parm10 = POQ_NEW_CLIENT; // New client! They will need aliases sent! BAM VOTEMAP ADD
        };
        
        void() DecodeLevelParms =
        {
        //	if (serverflags)
        	if (!deathmatch)	
        	{
        		if (world.model == "maps/start.bsp")
        			SetNewParms2 ();		// This WAS SetNewParms(); but we are changing! BAM VOTEMAP ADD
        new episode
        	}
        	
        	self.items = parm1;
        	self.health = parm2;
        	self.armorvalue = parm3;
        	self.ammo_shells = parm4;
        	self.ammo_nails = parm5;
        	self.ammo_rockets = parm6;
        	self.ammo_cells = parm7;
        	self.weapon = parm8;
        	self.armortype = parm9 * 0.01;
        	self.pflag = parm10; // Need to preserve state of whether aliases have been sent BAM VOTEMAP ADD
        };
        oh ya and if i add void()interrmission running thing to the top of vote than i start to get:\

        client.qc(20): error: Type mismatch on redeclaration of intermission_running (see original definition vote.qc(1))
        client.qc(51): error: Unknown value "SetNewParms2"
        client.qc(99): error: Unknown value "SetNewParms2"
        client.qc(17: error: type mismatch for +. Types function and float not allowed
        client.qc(27: error: type mismatch for =. Types function and float not allowed
        client.qc(38: error: Unknown value "SetNewParms2"
        client.qc(40: error: type mismatch for &&. Types function and float not allowed

        ...maybe im supposed to float it at vote?

        Comment


        • #19
          ok i did have to float it, i have almost everything fixed but now i have

          client.qc(99): error: Unknown value "new"

          and im completly lost on this lst error

          Comment


          • #20
            allright fixed that by commenting it out, but i think it broke somthing, or i dont know how to use this voting

            Comment


            • #21
              Um, look up in DecodeLevelParms () a couple lines down, right before self.items = parm1;. For some odd reason you had "new episode" in there without commenting it out.

              Code:
              void() DecodeLevelParms =
              {
              //	if (serverflags)
              	if (!deathmatch)	
              	{
              		if (world.model == "maps/start.bsp")
              			SetNewParms2 ();		// This WAS SetNewParms(); but we are changing! BAM VOTEMAP ADD
              new episode
              	}
              	
              	self.items = parm1;
              Remove that infliction!

              Comment


              • #22
                i have .... but how do i know this is working cos according to the first post all i have to do is type the maps name and i can vote on it, but i get somthing like this:

                e1m4
                //out of consile
                no weapon

                ?!?!

                Comment


                • #23
                  Well, that tells me something with your bindings isn't right. If you type in "e1m4" and "no weapon" pops up, then somewhere along the line the wrong impulse is being executed.

                  The way Baker explains how to do it should work flawlessly, but if you are implementing this code into an existing mod, then that is more than likely where the problem lies. Trace down the alias of "e1m4" for example and see if it is overwritten by another alias, incorrect impulse, or whether the bindings were even sent.

                  If all else fails, examine how the code interacts with surrounding code, if you add something in the wrong order, the wrong place, or not at all, there is obviously many problems that will arise. Examine the basics, it's where the simple and troublesome mistakes are made but also most easily fixed.

                  Comment


                  • #24
                    hmm i think i shoud do some kind of online testing, because in singleplayer that kept popping up

                    and then i decided to swich to a multiplayer mode, and it seemed to work fine [i also found that the door sound was no precheched]

                    Comment


                    • #25
                      Ah, yes, I remember now. I had that same problem, and was confused for the longest time why my code worked hours before, then quit working. For some odd reason the way clients handle singleplayer vs multiplayer that special vote-map code won't work in singleplayer mode.

                      It is also a good idea for serious testing, to use a dedicated server.

                      Comment


                      • #26
                        You would be best starting a multiplayer server, either coop or deathmatch, depending on your mod type. The votes require the server not to be "paused" when the console is down. You should do "changlevel e1m4" in the console if you want to change level, anyway.

                        Don't define intermission_running as a function. vote.qc needs to be listed in progs.src after client.qc, because vote.qc has code looking for intermission_running, and the compiler hasn't (at that point) seen the code in client.qc that makes intermission_running.

                        Comment


                        • #27
                          I'll consider adding this to RMQ, it seems useful.

                          Having all the maps listed in the qc (hardcoded) seems not ideal, is it possible to parse a text file instead or just look in the maps directory and compile a list?

                          Recompiling the mod everytime a map is added isn't optimal.
                          Scout's Journey
                          Rune of Earth Magic

                          Comment


                          • #28
                            Originally posted by golden_boy View Post
                            I'll consider adding this to RMQ, it seems useful.

                            Having all the maps listed in the qc (hardcoded) seems not ideal, is it possible to parse a text file instead or just look in the maps directory and compile a list?

                            Recompiling the mod everytime a map is added isn't optimal.
                            I agree. Every once in a while I think about that.

                            One solution would be frik_file, but there are weaknesses to that as some maps [e1m1 thru e4m8 + start, end, dm1-dm6] will be pak0.pak and pak1.pak and frik_file doesn't understand pak files.

                            Eventually I think this will be solved by an extension that can somehow return the list of available maps to QuakeC -- OR ... can output a .txt file list the list of maps for Frik_file to read them.

                            Something I'll eventually look into... probably long before Quake Remake is released I would guess.
                            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


                            • #29
                              Frik file... This came up before, when we discussed AIDA (hellsmash field computer). DrS said it was a bit obscure, mildly put. So everybody shut up about it :-E

                              Hm, I'll add this as it is, because even if only 3 people are playing, voting is nice to have and it's not much QC.
                              Scout's Journey
                              Rune of Earth Magic

                              Comment


                              • #30
                                vote.qc can't be both before weapons.qc and after client.qc, obviously.

                                Thus, add

                                float intermission_running;

                                to defs.qc.

                                Tutorial should be changed to include this.
                                Scout's Journey
                                Rune of Earth Magic

                                Comment

                                Working...
                                X