Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Custom weapon scripts

  1. #1
    UTCollector88
    Guest

    Post 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. #2
    UTCollector88
    Guest
    In this in the wrong section? Should I do it again in the Programming the Unreal Script section?

  3. #3
    RattleSN4K3
    Guest
    Quote Originally Posted by UTCollector88 View Post
    In this in the wrong section?
    Kind of.

    Quote 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.
    Quote 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

  4. #4
    UTCollector88
    Guest
    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.

  5. #5
    NickG
    Guest
    Quote 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.

  6. #6
    RattleSN4K3
    Guest
    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.

    Quote 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.

    Quote 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).

  7. #7
    UTCollector88
    Guest
    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.

  8. #8

  9. #9
    UTCollector88
    Guest
    Cool!Thanks for that.

  10. #10
    UTCollector88
    Guest
    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?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •