Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Custom weapon scripts

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

  • Custom weapon scripts

    Hi Everyone

    It has been a while since I have been back to this forum. Anyway I am going to try and create a few custom weapons for UT3. I just need to brush up on Blender 2.6 with 5 or so tutorials and I am ready to go.

    I am wanting to ask with the script side of it I have been looking at the UT3ScriptSource 1.5 and I have noticed that for every UT3 weapon Epic games has a UTWeap_[weapon name].uc file, a UTAttachment_[weapon name].uc file, a UTAmmo_[weapon name].uc file and one or more UTDmgType_[weapon projectile name].uc files.

    I know I definitely will need a UTWeap uc file and probably a UTAmmon uc file for compiling. I don't know about the other two types though, what is the UTAttachment uc file for and can I or should I combine these parts into one big uc file?

    Is there anyone that is familiar with the UT3 ScriptSource I would appreciate some guidance?

  • #2
    In this in the wrong section? Should I do it again in the Programming the Unreal Script section?

    Comment


    • #3
      Originally posted by UTCollector88 View Post
      In this in the wrong section?
      Kind of.

      Originally posted by UTCollector88 View Post
      Should I do it again in the Programming the Unreal Script section?
      No need to, as the guys who will read the "Programming the Unreal Script section" section read this section as well (the UT3 forum is not that big ).

      To answer your questions:
      Generally, you don't need to stick to the naming convetion like "UTWeap_", "UTAttachment_" and so on. The "UTWeap_" file/class has the logic for the basic weapon. The "UTAmmo_" class is a item to be placed into a world/level which gives you ammo for the specific weapon (set in its defaultproperties). The "UTDmgType_" class is the damagetype. It used for naming the particular death for the weapon (e.g. "You are killed by ... (WEAPON)"). Some weapons also adds a special treatment in its damagetype class - like spawning gibs, etc. The "UTAttachment_" class is for the treatment on 3rd person models for any other weapons you'll see in a game except the one you're carrying - eg. the DualWielding method for a Enforcer, or the Laser targetting of the Avril.

      There are some tutorials for you a basic weapon.
      Originally posted by RattleSN4K3 View Post
      [...]
      If you don't know aynthing about coding a mutator, you can check this tutorial. That article is a bit outdated, but works fine.
      http://www.jadeskaggs.com/2009/03/26...-superstinger/
      As you'll working with Blender, you might check this tutorial as well.
      http://code.google.com/p/steam-punk-...tomGunTutorial

      Comment


      • #4
        Okay great! You have been a great help. Also if I combine all the contents (damage type, ammo, basic logic and 3rd person attributes) into one uc file will it still compile and create the necessary files the same as if I used the conventional naming system? I decided I will definitely have the main uc weapon file named after the name of the weapon I will create just for the sake of not getting confused and lost.

        Comment


        • #5
          Originally posted by UTCollector88 View Post
          Okay great! You have been a great help. Also if I combine all the contents (damage type, ammo, basic logic and 3rd person attributes) into one uc file will it still compile and create the necessary files the same as if I used the conventional naming system? I decided I will definitely have the main uc weapon file named after the name of the weapon I will create just for the sake of not getting confused and lost.
          You go ahead and try it haha. Just kidding I don't see what is the point of attempting such a thing. You want a separate ammo pickup from your weapon pickup do you not? You want to keep compatibility with weapon replacement and other mods, yes? You dont want to have to rewrite a bunch of onlyownersee/noowner see stuff, right? Are you having trouble getting organized? I suggest trying notepad++ (free) if you do not have a favorite IDE; You can save sessions, open all epics relative classes and your classes splitscreen and tabbed.

          Comment


          • #6
            Short: You should extend the existing classes.

            The UTWeapon class has a variable like "AttachmentClass" which has to derive from "UTAttachment". Otherwise casting the object would fail. You always have to extend the given classes in order to "extend"/customize content from UT3.

            Code:
            MyWeaponClass extends UTWeapon;
            Code:
            FooDamageType extends UTDamageType;
            Code:
            BarAttachment extends UTAttachement;
            Code:
            MyAmmo extends UTAmmoPickupFactory;
            Code:
            SomeProjetile extends UTProjectile;
            ...

            And the fact that every class definition cannont exist twice, you'll have to find a unique name for everything. That's why UnrealTorunament is often using the UT prefix.

            Originally posted by UTCollector88 View Post
            combine all the contents (damage type, ammo, basic logic and 3rd person attributes) into one uc file will it still compile
            Probably yes, but it won't work correctly as intended. Stick to the UT examples.

            Originally posted by UTCollector88 View Post
            create the necessary files the same as if I used the conventional naming system?
            Naming classes has nothing to do with the functional purpose of classes in general. Things are split up into several classes to logically split it and to have an opportunity to use a specific effect several times (the main idea of OOP languages - don't reinvent the wheel).

            Comment


            • #7
              Oh yeah, that reminds me! I forgot to ask is there a data dictionary on the UT3 variables or a list or something? Cause there are a heap of variables I've seen in UT3 scripts that I am not sure what they mean. Eg. PostBeginPlay and UTPawn, etc.

              Comment


              • #8
                here are some:
                http://udn.epicgames.com/Three/Unrea...Reference.html
                http://www.codekisk.com/unreal/ut3/scriptref/
                http://wiki.beyondunreal.com/

                Comment


                • #9
                  Cool!Thanks for that.

                  Comment


                  • #10
                    One other thing, if you want to add like an announcement/award like head shot or an award/announcement for getting 20 kills with the weapon/s where would you script that? Can you do that?

                    Comment


                    • #11
                      Originally posted by UTCollector88 View Post
                      One other thing, if you want to add like an announcement/award like head shot or an award/announcement for getting 20 kills with the weapon/s where would you script that? Can you do that?
                      http://wiki.beyondunreal.com/?ns106=...dvanced+search

                      Comment


                      • #12
                        Yeah, that is good but can you create your own new weapon announcement? That is what I meant to ask.

                        Comment


                        • #13
                          Originally posted by UTCollector88 View Post
                          Yeah, that is good but can you create your own new weapon announcement? That is what I meant to ask.
                          Yes. Read the source of those classes. Review how others have done this. For example, the "Unreal!!" reward in HO0815XX's ShockSniper: http://forums.epicgames.com/threads/...inal-(Updated)

                          Comment


                          • #14
                            Some other things I want to ask can you point the pickup sound for your custom ammo or weapon to a pickup sound of an existing weapon? Also what is the variable MaxDesirablility used for in weapon and ammo scripts? The variable is a number. Also what am I suppose to put for the variables Scale, Translation and CollisionHeight?

                            Comment


                            • #15
                              You should not run into problems using sounds from stock packages. MaxDesirability is for bot decisions, average weapon defaults are about 0.7, redeemer's is 1.5. I don't know what scale/translation you are referring to, you'll need to adjust these for most perceivable assets you create, and it will become apparent to you once the need arrives. The CollisionHeight to which you are referring may be that of the collision cylinders for pickups/dropped pickups, but some projectiles use them, too. To get a visual idea of how many unreal units some of these are, you can view the collision cylinders of pickups, flags and a few other things by placing them in a map in the editor and enabling the collision view flag in the editor viewport. Projectiles only seem to use collision cylinders in cases where the projectile needs collision notifications from other weapon fire. ex: shombos, redeemer denials, bio glob detonations.

                              Comment

                              Working...
                              X