Announcement

Collapse
No announcement yet.

Need QuakeC help: can't get decals/bulletholes to work with spawned in BSP entities.

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

  • Need QuakeC help: can't get decals/bulletholes to work with spawned in BSP entities.

    Need QuakeC help: can't get decals/bulletholes to work with spawned in BSP entities.

    I spawn a bsp model in game. Though when you shoot it there are particle effects, there are no bullet holes/decals.
    I can't figure out how to make them stick to it. I look in the darkplaces source to no avail, the quakec source, and google.
    No mention of this.
    spawnfunc_misc_clientmodel(); //(Also tried spawnfunc_func_clientwall, same thing)
    self.solid = SOLID_BSP;
    self.movetype = MOVETYPE_PUSH;
    how do I get decals/bulletholes to go on it, if possible? Is there a flag? The non-entity 0 movers in the map get bullet holes...

    I notice entity 0 gets bullet holes, and other entities (movers, doors in the map) also get bullet
    holes and decals. They aren't entity 0 but are part of the map.

    Engine: darkplaces.
    QuakeC: Xonotic

    I asked on IRC but was told to fuck off they won't help me.

  • #2
    MOVETYPE_FOLLOW I believe is the best way, but its sorta tricky because its got some .vector fields for relative origin and relative angles to the follow_ent which I believe is set via .aiment field. The bullethole model can be any kind, even a sprite would work I suppose, but if your aiment is gonna move or be moving, then you need to have a .think happening it pretty fast else the updating will look choppy. I used time + frametime as its nextthink but you could also have the nextthink = aiment.nextthink and that would better synchronize it better. Post more detailed code here if you want showing what you are doing.

    Comment


    • #3
      Xonotic / Darkplaces has in-built engine stuff for bulletholes. It doesn't use QC to spawn a model, follow the thing etc.

      What happens is a particle effect happens, and some particle effects (by effectsinfo.txt) also do decals: blood, bullet holes, etc.

      I can't get it to do it on BSP models I spawn in. The particle effect happens, but not the decal. It does it fine on the world (entity 0) and doors etc (brush entities) spawned by the world.

      On IRC they will not tell me how to get it to work with BSP entities I spawn in in QC after.

      Comment


      • #4
        Hrm, did not know that. The guy who could answer this here is Seven. He knows effectinfo.txt stuff extremely well.

        Originally posted by Haeylleh View Post
        Xonotic / Darkplaces has in-built engine stuff for bulletholes. It doesn't use QC to spawn a model, follow the thing etc.

        What happens is a particle effect happens, and some particle effects (by effectsinfo.txt) also do decals: blood, bullet holes, etc.

        I can't get it to do it on BSP models I spawn in. The particle effect happens, but not the decal. It does it fine on the world (entity 0) and doors etc (brush entities) spawned by the world.

        On IRC they will not tell me how to get it to work with BSP entities I spawn in in QC after.

        Comment


        • #5
          However looks like Seven has not been active here since June.
          QuakeOne - Quake 1 Resurrection - View Profile: Seven

          Apparently his last post stated he is leaving here and he meant it.

          Comment


          • #6
            Originally posted by Cobalt View Post
            However looks like Seven has not been active here since June.
            QuakeOne - Quake 1 Resurrection - View Profile: Seven

            Apparently his last post stated he is leaving here and he meant it.
            Do not lose hope , you can try to PRIVATE MESSAGE him, and if he has his Quakeone account setup to deliver him messages via email that he has received a PM, he'll see not only the message you sent, but if you provide him a email to reply to , he very well may contact you back.

            I thought he stated he was leaving these forums, so out of respect for him and his choice, I recommend you do provide a reply email. This will allow him to stick to his guns about not wishing to visit here again, while also facilitating the capacity to answer your questions.


            No promises though, and just keep in mind that this is all based on flimsy assumptions.
            Last edited by Mindf!3ldzX; 07-29-2015, 03:39 PM. Reason: Sorry dude, fixed it for you.
            Want to get into playing Quake again? Click here for the Multiplayer-Startup kit! laissez bon temps rouler!

            Comment


            • #7
              It's interesting that it works on entities that come with the map, but not spawned entities. They really told you off? What dicks.

              When you say you spawn a bsp model, do you mean you make an entity with a ".bsp"-file .model, or use use the modelindex (eg. "*2") described in the .bsp file to make the model?

              Actually, I see you're using a custom spawn function from within the engine. You could argue that it is a bug that decals aren't enabled for entities spawned this way. Is there a place for xonotic bug reports?

              In the first Quake mission pack, they wrote some quakec to handle bullet holes for shotguns. In hipholes.qc, you can see how they did it, but it's definitely not as great as engine/graphic decals.

              Comment


              • #8
                Originally posted by Zop View Post
                ...
                Yep. Then glined me. I go in there once or twice a year, only when I'm totally stuck. They said they didn't like my views, and would not help me.

                Yes, .bsp file. Compiled set map pieces. It's nice to use bsp because it has volume and thus bullet penetration and ballistics work with them. Fun .

                Really wish I could figure out how to get decals to work for them.

                Comment


                • #9
                  Noticed something.

                  Just discovered this:
                  When you shoot right next to the model, where it intersects the world, it will
                  put parts of the decal on. Same with if something gets gibbed.

                  (Here the world (entity 0) is the grass, the bungalow is a bsp model)

                  Directly shooting the model gives no decal, and blood won't put stains on it when directly
                  dripped onto it.







                  ----
                  Screenshots of other buildings, city generation code and models.
                  (all free/opensource ofcourse)





                  If anyone could ask on irc.anynet.org #darkplaces and #qc ...
                  I'd be great to have decals working for real on the buildings.

                  Comment


                  • #10
                    Seems like decals appear if you shoot the model near where it is near a plane of
                    the realworld (entity 0).
                    Also blood dripping sometimes works, but never does a decal be left on a wall that
                    is not near a plane of the world(ent0)





                    Don't know why nor how to enable it on the .bsp models totally.
                    ---

                    Comment


                    • #11
                      I was looking at effectsinfo.txt, and it seems you can control if a particle spawner's particles can create decals, or not. And so, from the pics, I think the particles emitted from the ground can cause decals onto your models.

                      I'm partial to thinking it has to do with the entity number, or perhaps a decal check isn't done on spawned entities, but in either of these cases, you'd have to change the source code of the engine. I can't imagine it would be easy for anyone, except for the person who wrote the engine, so that's you're best bet.

                      Comment


                      • #12
                        Could you ask on irc.anynet.org #darkplaces .
                        They won't talk to me.

                        Comment


                        • #13
                          (I've done some having on DP before, so If I just knew what to do..., I can recompile it etc, atleast for linux)

                          Comment


                          • #14
                            If only this worked (it doesn't)

                            self.allowdecals = TRUE;
                            spawnfunc_func_clientwall(); //Sets solid right away, otherwise similar to clientmodel

                            mutators/mutator_spawnvehicles.qc:15291:5: error: unexpected identifier: allowdecals
                            mutators/mutator_spawnvehicles.qc:15291:5: error: there have been errors, bailing out


                            (was worth a shot given the engine code
                            entrender->allowdecals = true;

                            Comment


                            • #15
                              (Doesn't work in CSQC either)

                              Could one of you ask on the IRC?
                              Maybe they'll answer for you

                              Comment

                              Working...
                              X