Announcement

Collapse
No announcement yet.

Need help with ExplodeTimer and Bone attachments

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

    Need help with ExplodeTimer and Bone attachments

    Here's what I'm doing.
    Making a grenade launcher for my map that's mostly subclassing the AR, specifically, the grenades.

    Here's the first problem, for PrimaryFire, I figured setting ExplodeTimer to 0.0 would result in a grenade that explodes on impact
    It isn't, it's reverting to the normal time of about 2 seconds(the charging bar is also borked, but they still charge for distance)

    [Edit]Turns out the PriFire nades are ignoring their damage values as well...

    Secondly, I'm using the ShieldGun model instead of the AR model
    The problem here is that in 3rd person, the weapon is upside down and facing backwards

    UT2004.Log result:
    Log: AttachToBone: No bone named [tip2] found in actor KGL's skeleton.
    Log: AttachToBone: No bone named [tip2] found in actor KGL's skeleton.
    Log: AttachToBone: No bone named [tip2] found in actor kGLAttachment's skeleton.


    Help please?
    Can post code if needed

    #2
    About the primary fire nades... are you sure you're spawning the right nades? Check your ProjectileClass.

    Comment


      #3
      First problem - Xyx has the answer. Check the Firemode class. You'll need to change the SpawnProjectile function to spawn your own class instead of the default.

      Second, it should be pretty obvious that you need to check the shield gun model to see what bones it uses. Tip2 is used in the Assault Rifle mesh for the altfire muzflash. The shield gun doesn't need a second muz flash, so it doesn't have a tip2 bone. Change it to 'tip' instead.

      Third: Look in the AssaultRifleAttachment class. See it has SetRelativeLocation and Rotation? In your custom class delete both of these, they're not needed for the shield gun attachment model.

      Comment


        #4
        Originally posted by DarkSaber
        First problem - Xyx has the answer. Check the Firemode class. You'll need to change the SpawnProjectile function to spawn your own class instead of the default.

        Second, it should be pretty obvious that you need to check the shield gun model to see what bones it uses. Tip2 is used in the Assault Rifle mesh for the altfire muzflash. The shield gun doesn't need a second muz flash, so it doesn't have a tip2 bone. Change it to 'tip' instead.

        Third: Look in the AssaultRifleAttachment class. See it has SetRelativeLocation and Rotation? In your custom class delete both of these, they're not needed for the shield gun attachment model.
        1. Thinking back to my code, I think the actual problem is that both Pri/Alt are subclassing Grenade
        kGL
        - kImpactNade(Pri)
        -- Nade_I(projectile class)
        - kRegNade(Alt)
        -- Nade_B(the projectile class)

        Actually... I think I'll redirect AltFire to the regular old AR nades and see what happens.

        2. Tried changing Tip2 to Tip, didn't work(doesn't help I barely know code short of defproperties)
        I'll do some more experimenting with this

        3. I'll look into that
        [Edit]#3(RelativeLocation/Rotation) I got working, thanks.

        As for my firemodes, I commented out the AltFire settings(back to the AR nades atm) and basically cloned the xweapons.Grenade code for my NadeI just so see if I could get the ExplodeTimer changes to hold. No luck

        Comment


          #5
          If you want a contact grenade, you just need to change the Hitwall function so it points to the explode function instead of setting the timer. If you do this, the grenade will explode if it hits an actor or any world geometry,and the timer will make it explode if it hangs in the air too long (Like it was fired off a really tall cliff or building). If I were you, I'd add some log statements in your grenade's code to see if you are spawning the correct grenade, and what functions are being called and which are not.

          The Shieldgun has a bone named Bone_Flash, that's probably the one you need.If you ever need to figure this out for yourself, check out the animations browser in the Unreal Level Editor. The view tab will allow you to find the bone names, ect.

          Post your weapon's code and your grenade's code and I'll check it out.

          Comment


            #6
            The Shieldgun has a bone named Bone_Flash
            Those names are never used, apart from certain cases. The attach alias is used instead, which in this case is actually 'tip1', thanks to whoever created the bone structure for the shieldgun_1st model (standard naming convention is simply 'tip', silly epic people ).

            So change it from tip to tip1, and it should work.

            Edit: the 3rd person model is named correctly, and is just 'tip' BTW.

            Comment


              #7
              Originally posted by ghouck
              If I were you, I'd add some log statements in your grenade's code to see if you are spawning the correct grenade, and what functions are being called and which are not.
              Or, in my humble opinion, even better, use this:
              Code:
              Level.Game.Broadcast(Instigator.Controller, "your message here", 'Say');
              This gives you immediate in-game feedback, which saves you having to dig through the log and trying to remember what happened under which circumstances.

              Comment


                #8
                Originally posted by Xyx
                Or, in my humble opinion, even better, use this:
                Code:
                Level.Game.Broadcast(Instigator.Controller, "your message here", 'Say');
                This gives you immediate in-game feedback, which saves you having to dig through the log and trying to remember what happened under which circumstances.
                The problem with this is that there are checks in the code that prevent you from spamming messages so its likeley you won't see every log message. Alternitively you can just use ClientMessage (which is much neater than the above code) however believe it suffers the same spam restrictions as other messages. Its good in situations where you just want to see that a certain class is being loaded but for actual debugging it can cause you some headaches.

                Anyways a better way to debug is to use the Log function and in game bring up the console and type showlog. This will bring you to a windowed game with the log window next to you. Now you can play and see the entire log and all its useful info at the same time.

                Comment


                  #9
                  This gives you immediate in-game feedback, which saves you having to dig through the log and trying to remember what happened under which circumstances.
                  Use the console command showlog so you can see the log in real-time. Doesn't work so well if your monitor is really small though, because it runs the game in a window.

                  Comment


                    #10
                    Thanks! Will try that!

                    Spam filtering is not an issue, though. It only lasts for one second. Any message occurring more than once per second is probably redundant.

                    Comment


                      #11
                      Originally posted by Xyx
                      Spam filtering is not an issue, though. It only lasts for one second. Any message occurring more than once per second is probably redundant.
                      The problem is that this message might repeat 5 times in one second causing the message system to stop sending messages breifly, while the message system is stopped another section of code might try to send a message during this time and it will be consumed.

                      Doesn't hurt to use it, just be aware of this and add a log statement as well so you can go back through the log later and check to see if you missed something. It will save you a headache some day.

                      Comment

                      Working...
                      X