Announcement

Collapse
No announcement yet.

My custom weapon models are acting weird.

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

  • #16
    IKR! I was just havin fun.


    However,

    If the next sentence is incorrect than the rest is hogwash. (I can't remember)

    objerror will shut it all down. If so, then the whole map depends on some dead body to have min/max/model values. Even though my code is half a joke, it's not self destructive.

    Maybe you have some model_instance place holders in your map that you intend to worry about later and you don't want their lack of values to stop the game...

    That is of course only if objerror stops the script. I can't remember.
    Last edited by MadGypsy; 10-27-2013, 11:32 PM.
    http://www.nextgenquake.com

    Comment


    • #17
      depends on the engine. main advantage is that you get a nice stack trace.
      Some Game Thing

      Comment


      • #18
        I was reworking some of my above code. How do I check if a model is already precached? Also how do I tell if a path provided for .model worked?

        I know engines do these things. I want to know the QC way, if any.
        Last edited by MadGypsy; 10-28-2013, 01:31 AM.
        http://www.nextgenquake.com

        Comment


        • #19
          dupe precaches are fine, not sure why you'd need to check that (unless if you were doing it in a think or something).
          you can't ensure that the path was valid. servers might skip loading it. What you can do is to check that the setmodel also set a size (which will happen with nq), unless its a sprite. So really there's no reliable way.
          You can check if the file exists with a few different extensions - but only extensions.

          I don't know if you're trolling or not with all those checks for null. You realise QC (like C) has no concept of null for numerical types, right?
          Some Game Thing

          Comment


          • #20
            i did not know number null doesn't exist. I had to check for an empty string and a '0 0 0' vector, so I figured I would throw null in.

            as far as the rest goes, I'm not too serious about it as a whole. This was something different to mess with for a night before I get back to making objects do things tomorrow. Checking if things were precached etc was just a way to make smarter code.
            http://www.nextgenquake.com

            Comment


            • #21
              That code.
              By the way, to make inf. spawning monsters, should I add trigger_multiple with targetspawn which will create monsters and wait X so they'll spawn in defined time?

              Comment


              • #22
                I just skimmed this thread quickly, so i dont exactly knowthe jist of your goal, but if you just want infinite spawning monsters, you could modify their death function. For example with the soldier...

                Code:
                void() army_respawn =
                {
                	self.solid 		= SOLID_SLIDEBOX;
                	self.movetype 	= MOVETYPE_STEP;
                	setmodel (self, "progs/soldier.mdl");
                	setsize (self, '-16 -16 -24', '16 16 40');
                		
                	setorigin(self, self.origin + '0 0 22');	
                	
                	self.th_stand 	= army_stand1;
                	self.th_walk 	= army_walk1;
                	self.th_run 	= army_run1;
                	self.th_missile = army_atk1;
                	self.th_pain 	= army_pain;
                	self.th_die 	= army_die;
                
                	self.health 	= (cvar ("skill")) * 30;//R00k 
                	self.takedamage = DAMAGE_AIM;
                	
                	walkmonster_start ();
                };
                and in the army_die function add

                Code:
                	self.think = army_respawn;
                	self.nextthink = time + 20;
                at the end.
                www.quakeone.com/qrack | www.quakeone.com/cax| http://en.twitch.tv/sputnikutah

                Comment


                • #23
                  Probably is what I needed. I'll do that with other monsters too. And should I just put them on the map? Nothing else?

                  Comment

                  Working...
                  X