Announcement

Collapse
No announcement yet.

Persistent variables.

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

  • Persistent variables.

    I was thinking of working on a re imagining of the first episode of quake in a non linear, more exploration based style. Something a bit like the way Dark Souls or Metroid work. I also wanted to take more inspiration from the Cthulhu mythos and perhaps add some new monsters and bosses along the way.

    I haven't looked into coding this yet, but the idea basically hangs on one thing. How feasible is it to have a powerup or boss creature that will not respawn, even if you leave the map and return to it?

    Has anybody done this before and what are the possible methods?

    Thanks for reading.

  • #2
    capn', I recently started a thread where we discussed how digs(awesome mapper) created a lone .bsp that plays as if it's "three" levels(I think three). Here's Seven's idea on how that may work:

    http://quakeone.com/forums/quake-tal...tml#post130132

    with the use of Runes. I think you can do it if it is in one gaming session, or from a loaded saved game. I don't think you can exit the game and have it remember though. But I'm not sure.
    Name's damage_inc, and killing is my business. Don't worry though, it's nothing personal! Oh wait... maybe it is

    Comment


    • #3
      that's an interesting thread, I'm definitely planning to use QC though, so I'm hoping I can find a more sophisticated approach than hacking existing items.

      Perhaps looking up the runes in the QC would be a good place to start though!

      Maybe I could do something like having phantom inventory objects that tell the game a certain boss is dead, so when the level loads that boss is despawned, or never spawns at all.

      Comment


      • #4
        Code:
        if(!(self.flags & FL_SOMEFLAG))
        {
        	self.solid = SOLID_SLIDEBOX;
        	self.movetype = MOVETYPE_STEP;
        	setmodel(self, "progs/boss.mdl");
        	//etc..
        }
        ..hmmm, probably make it never show up again. So if tht monster was used in other maps it wouldn't be in those either. Simple fix would be to simply include the name of the map for it not to appear in (after defeat) as an argument in the if statement.
        Last edited by MadGypsy; 03-22-2013, 08:11 PM.
        http://www.nextgenquake.com

        Comment


        • #5
          Originally posted by capnbubs View Post
          I was thinking of working on a re imagining of the first episode of quake in a non linear, more exploration based style. Something a bit like the way Dark Souls or Metroid work. I also wanted to take more inspiration from the Cthulhu mythos and perhaps add some new monsters and bosses along the way.

          I haven't looked into coding this yet, but the idea basically hangs on one thing. How feasible is it to have a powerup or boss creature that will not respawn, even if you leave the map and return to it?

          Has anybody done this before and what are the possible methods?

          Thanks for reading.
          1- sorry for my poor english
          2- the player in quake save some stuff between levels (you know, armor, health, weapons, runes) this stuff is saved in "parms" defined in defs.qc and client.qc
          in client.qc you can find

          void() SetChangeParms =
          {
          if (self.health <= 0)
          {
          SetNewParms ();
          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;
          };

          void() SetNewParms =
          {
          parm1 = IT_SHOTGUN | IT_AXE;
          parm2 = 100;
          parm3 = 0;
          parm4 = 25;
          parm5 = 0;
          parm6 = 0;
          parm7 = 0;
          parm8 = 1;
          parm9 = 0;
          };

          void() DecodeLevelParms =
          {
          // if (serverflags)
          if (!deathmatch)
          {
          if (world.model == "maps/mansion2.bsp")
          SetNewParms (); // take away all stuff on starting 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;
          };
          Yeahh, but maybe you have a question : how can i use this parms in qc?
          First you need to know qc only have the limit of 16 parms this is very very veryy a little number. But a parm is wasted in qc 1.06
          (armortype)
          In inside 3d you can find this code by FrikaC


          If you need a bit more than 10-16, I should note that parm9's use in Quake is kinda pointless. It stores the "armortype" variable, a variable with only 4 possible values all of which are already flagged in .items.

          So all you need to do to free up parm9 is add this to the bottom of DecodeLevelParms:

          if (self.items & IT_ARMOR1)
          self.armortype = 0.3;
          else if (self.items & IT_ARMOR2)
          self.armortype = 0.6;
          else if (self.items & IT_ARMOR3)
          self.armortype = 0.8;
          else
          self.armortype = 0;
          So using this trick you have 8 parms for quake and 8 parms for your custom mod. Well you have 8 parms for you 8 parms = 8 monsters or bosses ? nope. you can use the parms 9-16 like parm 1 (items) so you will have a limit of 24 variables for a single parm. (you know items have values based in multiples of 2 (2, 4 , 8,........, 838860 (do not use above 8388608 because is innestable).
          24 * 8 is 192 so you will have 192 diferent monsters to not-respawn in levels.
          You only need to assign a value for the different bosses/monsters (inclusive items or stuff like exploboxes)
          parm 10 will be something like (i think ) Bosses_episode1
          parm 11 will be something like (i think ) Bosses_episode2
          parm 12 will be something like (i think ) Bosses_episode3
          parm 13 will be something like (i think ) Bosses_episode4

          etc.

          For example when you kill a specific boss you will have to add this in a frame of death animation (you defined all the stuff before something like PARM_MONSTER_CTHON = 1; )

          ...
          self.enemy.Bosses_episode1 = self.enemy.Bosses_episode1 + PARM_MONSTER_CTHON;
          Where self enemy is the player (you can also specific the player with: local entity pl;
          pl = find(world, classname, "player");
          )
          The second definition is to call the "not respawn" in the function of monster.
          void() monster_boss =
          {
          local entity pl;
          pl = find(world, classname, "player");


          if (pl.enemy.Bosses_episode1 & PARM_MONSTER_CTHON)
          return;

          PD: In my game "dead morning" and "black days" based in darkplaces engine i am using Frik_file to do the work (you do not need parms and you can carry an unlimited number of stuff between levels)
          Check this mod http://www.quaddicted.com/reviews/tdk11.html This uses the parms to save monsters in levels (not really easy to understand use of this but this is great, you can decompile the progs.dat using frikdec)
          If you have questions about qc Inside3d is the best place about this http://forums.inside3d.com/viewtopic...light=frikfile
          Last edited by nahuel; 03-23-2013, 04:27 AM.
          the invasion has begun! hide your children, grab the guns, and pack sandwiches.

          syluxman2803

          Comment


          • #6
            Thank you nahuel, that is exactly what I needed to know!

            I shall continue with my project as planned knowing that I won't hit a brick wall when I attempt to code this particular feature.

            Thank you again for taking the time to give such an in depth answer.

            Comment


            • #7
              ya u could easily us something like parm15 and hold up to 255 bitwise items of thing the player has seen/encountered/taken and depending on the map spawn said entity for the player. the map could precahe the entity bit dynamically spawn it. this should work even with saved games.
              www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

              Comment

              Working...
              X