Announcement

Collapse
No announcement yet.

Hybrid Flashlight Mod

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

  • Hybrid Flashlight Mod

    K, this is my first post here, and I combed for anything similar before typing this, but the only posts i found were the posts that got me as far as i already am. also, I apologize for the giant images.

    I'm trying to develop a somewhat realistic armor-mounted torch for use in Quake, specifically DarkPlaces, and even more specifically, the Quake HD pack. I have the Sneep flashlight, and I've got the other one, the torch developed by either Seven or Nahuel (not sure which one credit goes to for the version i'm using currently; i'm sure someone can set me straight on that). SO, without further ado, the screenshots. And if for some reason the images don't work, let me know.







    Screens from standard Quake. Introduction, Castle Of The Damned, and Necropolis. It's running in DP, but all effects are set to standard. Now let's look at the same places in my HD version.







    That dynamic lighting leaves a bit of light to be desired. Specifically that hallway in Castle Of The Damned. Later levels (Gloom Keep, for instance) have whole long hallways with as little light. And to be honest, I like this; I like it that dark. It's a great way to further ramp up tension. But in a hallway like the one in Gloom Keep, when you've got a Knight or a Fiend coming after you and your whole screen is just black and you're trying to shoot, that ceases to be scary and becomes more irritating than anything.

    I know I'm beating a dead horse saying all this; you all know a modded DarkPlaces game can be brutally dark in some places, and some of you probably learned how to deal with that in those situations. But I think my personal taste leans toward having a dull little armor light to click on as i fumble around in the dark. and that adds a tension all its own. So i set out to attain that. found the two mods mentioned above, and instantly discovered I would love to find a way to mesh the two.

    Sneep's Light:





    and the Torch:





    What I'm shooting for is an armor-mounted light, like with Sneep's light. instead of the single point light, however, i want to get a projection similar to the Torch (but not angled to simulate the light being held; it's cool with the torch, but i'm going for efficiency, rather than effect) i want to center it up, so it's aligned with the crosshair instead of just below it, but if i were to be able to get the rest of it to work, that would be a moot point. and i would love to be able to step up the range slightly; the Sneeplight's infinite distance is a bit excessive in this case, especially since it generates a bloom on whatever it hits, and the Torch has a nice range effect, but i would extend it a few feet for Quake use. the final result would be something akin to the Quake 4 flashlight, but with limited reach.



    i've been toying with it for a few days now, but i know very little about the Quake-C coding, so although I can follow tutorials, I get lost completely when it comes to linking up files to code in the .qc documents. but seeing the two mods pulling off these features in separate places leads me to believe i've got everything i need to do this right here, if i could figure out how to piece it all together.

    So my question would be, where would I start for all of this? So far I've got the click sounds for the armor mounted light working, although I need to figure out how to pre-cache the sound effects so it doesn't harass me with the message telling me to. where would i find the code in the Torch files that lets me alter things like range or alighment? I'm guessing that specific flashlight projection is an image file in his progs folder?

    The last thing I need to figure out is how to get these mods to load in my Quake HD game. i couldn't tell you exactly what all is in it, but it was downloaded as a pack from ModDB some time ago (pre-epsilon, i think; still has original sfx). but loading these mods into it crashes the game to desktop immediately. i'm sure it's a simple explanation, but hell if i know what it is, and without any error message upon crash, i have no clues to go on.

    okay, that's my spiel. any ideas?

  • #2
    hello abel, the torch above was an example from BD code
    https://www.dropbox.com/s/gdo2hn2f6q...h_centered.rar

    check this, you can edit the cubemap

    impulse 30 to toggle the flashligh
    the invasion has begun! hide your children, grab the guns, and pack sandwiches.

    syluxman2803

    Comment


    • #3
      Nahuel, that's fantastic. that's just about everything i was looking for. i played with the cubemap a bit to expand the light radius and smoothed the fade a bit around the edges. the results being:





      and some distance shots to show that fade kicking in. very nice.





      and once i get it going on Quake HD, i'll probably sharpen up the middle of the cubemap and desaturate it a little.

      so the only things i need to fix at this point is to get the click sound pre-cached so it will leave me alone with the message, and then get it working in Quake HD. i'm not sure what's crashing it when i try to run a mod in that particular version, but whether i run it from the in-game mods list or add it to the shortcut to autorun, it won't let the program continue with any of the three torch mods in.

      when setting a precache line in defs.qc, what does the number at the end denote? for instance, in the line below:

      string(string s) precache_sound2 = #76;

      what is #76 referring to, and how do i determine the number for my click sound, or do i put something else in place of it? or am i looking in the wrong place entirely?

      Comment


      • #4
        to precache sounds open world.qc
        In this mod you need to precache just two sounds

        in the function
        Code:
        void() worldspawn
        add
        Code:
        precache_sound ("misc/click.wav");	
        precache_sound ("misc/clickoff.wav");
        after
        Code:
        W_Precache ();
        save and close. open fteqccgui and compile!


        Aniway you can resize the cubemap (the cubemap texture is pretty small, you can do it for example 512 * 512 or 1024 * 1024 with a nice texture ).
        Also you can recompile the source code and change the flaslight power.
        open flashlight.qc

        Code:
        void(vector org,entity e) FlashLight =
        {
           newmis = spawn();
           newmis.owner = self;
           setmodel(newmis, "");
           newmis.origin = org;
           newmis.angles_y = newmis.angles_y - 180; 
           newmis.owner = e;
           newmis.light_lev = 650;
           newmis.color = '2 2 2';
           newmis.skin = 200;  
           newmis.viewmodelforclient = self;
           newmis.think = checkflaslight;
           newmis.nextthink = time;
        };
        So you can see
        newmis.light_lev = 650;

        this is the value of the flashlight!! change it

        Code:
           newmis.color = '2 2 2';
        is the intensity and colour of the light, you can change it for another values like "0.5 0.5 0.6", edit the cubemap (change the color of the cubemap for example), you can obtain different ligth values
        the invasion has begun! hide your children, grab the guns, and pack sandwiches.

        syluxman2803

        Comment


        • #5
          awesome. thank you again for the help, man. this is looking badass, and doing just what i want it to do, so eventually when i get it up and running on the HD pack, i'll post pics again, or maybe some video.

          Comment


          • #6
            so it's been a minute since i've visited this, and i got back to it over the last couple of days. Since my last post, i've managed to get the flashlight working in the HD version, albeit by a bit of a workaround. i had to get all of the individual mods that were in that HD download i had before. still have no idea what was keeping it from running in the previous version, but i've got a custom-build now that works great. Some pics, as promised.









            SO. now i've got another issue to treat on it. In Mission Pack 1, on the Introduction map, there's a little bridge thing you lower to get into the lobby proper. you know, this one?





            so when i have my torch mod in, this happens:



            so you can probably tell something is missing here. it's not any of the mod packages in the Rogue folder (the .pk3's). i pulled all of them out and it didn't affect it. so i went into the original Winquake. turns out that the flashlight does the same thing there. other fun side effects include a slight reduction in brightness (you can see it in the picture), disabling of gravity in the passageway to Hard difficulty, and disabling of the forcefields, such as the one you can see in the Easy passageway. on both HD and original Quake. so i'm a bit dumbfounded there as to what i should even look for.

            Comment


            • #7
              In a mod I made time ago I setup the light so it make monsters angry. I do not know if you did too, but if you did not I think it works well.

              It was something like:
              far away, no effect.
              middle distance, makes the monster angry if it the light blob is in front of him.
              near distance, makes the monster.
              Contradiction is truth. Fear is freedom. Rights are privileges. Job is a commodity. Ignorance is strength.

              Comment


              • #8
                the gravity and rotatey things in hipnotic require the hipnotic gamecode. they won't exist with a hacked up vanilla progs.dat (unless you explicitly added them)
                you should have received some warnings about missing spawn functions when loading the map.
                Some Game Thing

                Comment


                • #9
                  the light trick would be cool to implement. i was toying with the idea of a time limit on the flashlight, and then a cooldown timer, kind of like the armor torch in Doom 3 BFG, but it seemed like that would be sort of going backwards after having gotten the torch working. i may still try to figure that one out at some point.

                  as for the bridge issue, i suspected that the differences in source code could be the culprit. so with that issue, would i have to find a way to compile a mission-pack-specific version of the mod? and how would i do that?

                  Comment


                  • #10
                    looking into it more, that seems to be exactly what i need. if i can get a copy of source code that includes all the elements for each mission pack, i can basically re-craft this mod with that extra data and it should work. running the mod is removing absolutely every enemy, weapon, and mechanic that wasn't in the core game.

                    Comment


                    • #11
                      i know i'm posting all over the place here; sorry, sort of keeping a running commentary of my progress as i go to keep my issues listed, and so other newbs that want to do something similar have a step by step. so i found source code for the mission packs on this site, actually, at the following location:

                      Quake Navigator

                      in the "Quake C" section, in rogue and hipnotic devkits. the main issue i'm having is that in the mod Nahuel linked me above, i can't find where in defs.qc the author added commands pertaining to the flashlight. and i'm getting error messages on compile for the flashlight.qc, which shouldn't be having any issues since it was error free on the core-game version. will keep updating; Nahuel, if you're watching, do you remember the author of that mod (unless it was you)?
                      Last edited by abel1389; 01-21-2015, 10:30 PM.

                      Comment


                      • #12
                        @abel1389

                        You should probably post your error messages. Also, the mod Nahuel linked you will require several dp extensions so you'll need to grab dpextensions.qc and you'll need to also make sure that is defined in the progs.src and have it in your compile folder. You can get the latest dpextensions.qc from Here if you download the source for DPMOD or just use the one in the mod he provided the link for you to download. Also make sure the the impulse is defined in weapons.qc so you can turn the flashlight on and off. You'll also need to make sure you have a call for FlashLight('-10 0 0',self); in PutClientinServer() function in client.qc.

                        Otherwise I don't see anything that would stop the mod from working once you get those things added correctly.

                        Good Luck.

                        Comment


                        • #13
                          if you use dpextensions your mod will only work with Darkplaces (and maaaaaybe FTE, MAYBE. Spike once told me "summin summin, other engine extensions, FTE summin" so it might wurk )
                          http://www.nextgenquake.com

                          Comment


                          • #14
                            i've got dpextensions in there, so no worries there. i actually don't think this mod would run at all on plain old winquake, because when setting the lighting to "flares", it doesn't show up.

                            this was the error message i was getting.



                            and my flashlight code, largely just repurposed from the center torch link:



                            now, somehow, i fixed it; i don't really know how, although i think the entry in client.qc played a part, so thank you for that. if i can retrace my steps to see what i tweaked, i'll share more detail. suffice to say, the flashlight is in nearly full working order in SoA. the only two issues i'm having now are:

                            1. when the Dark Places lighting settings are set to "high" or "full", something blocks off the light, almost like my character is in front of it. my guess would be that the origin point of the light is causing issues, although it works fine when lighting is set to "normal".

                            2. very minor issue: firing the proximity mine launcher causes the flashlight to toggle. not a big deal, but still curious. i searched weapons.qc for any other mention of impulse 30, but couldn't find anything.

                            Comment


                            • #15
                              @abel1389

                              Your error message was because you were missing depextensions.qc or the specific extension viewmodelforclient and .pflags is part of the TENEBRAE_GFX_DLIGHTS extension. Glad you got it fixed.

                              1. This is caused by your own shadow more than likely. The torch you use is not offset very well from the player and so you will cast a shadow in the way. YOu can remedy this by giving the player this effect in PutClientInServer:

                              Code:
                              self.effects = EF_NOSHADOW;
                              Just add that near the bottom of that function. It will prevent you from producing a shadow from the flashlight. Now you can also fix this by projecting the light farther out. Likely by using a traceline and fixing the light position on the trace_endpos. That would also work.

                              2. I have no idea about the proximity mine. Need more details.
                              Last edited by PrimalLove; 01-22-2015, 07:25 PM.

                              Comment

                              Working...
                              X