Let's analyse the states of our UberShotgun. Note: These functions are not frames, and will not be counted as part of any jump function or a Goto command with an offset. If is specified it will skip that many frames from the beginning of the state. If the last frame defined has a duration of -1, it will be displayed forever. Wait - Loops the last frame until otherwise instructed by a function.Not needed if you've already defined -1 as a duration, because it may cause problems. There are also several special commands you can execute:.is an optional function that will be performed by the actor.If you specify more than one letter, the and will be repeated for every frame (one for each letter). The sprite names are usually representative of what they are, in this case, the three are: ( Uber Shot gun Pickup), ( Uber Shot gun), and ( Uber Shot gun Flash). is the first four letters of the sprite name.Within a state there is a certain form to be observed. With this method, you are able to make brand new sequences, to brand new weapons. This removes the previous limitations of DeHacked or Whacked where you couldn't add in more frames, but could only replace the current ones. These tell ZDoom what is going on and what to do at certain frames. The next chunk in the code defines the Actor states of the weapon. Read all about these various properties you can set for weapons on the Weapon and Inventory pages. Since this weapon was meant to use the same shells as the other shotguns, inheriting makes it a somewhat shorter process by taking out the unneeded pieces of code that need to be written. ( Inventory.Pickupmessage "You got the UBER SHOTGUN!")Īlso, notice how this did not define an ammo type.Like the pickup message, if we wanted to define a custom pickup message, then we could put in a line of code that looks like this This weapon inherits all of its missing properties from the original shotgun. There are other properties you can set here, but they are not all required for every weapon. The lower this value, the higher the priority. So if you run out of ammo, you might switch to the Super Shotgun, rather than the Pistol, because its priority is higher. ( Weapon.SelectionOrder 350) - Tells ZDoom how much priority this weapon has.If the weapon shoots a custom projectile, such as a rocket, the sound played will be the projectile's spawn sound. ( AttackSound "weapons/ubersgf") - Tells ZDoom what sound to play when A_FireBullets or A_CustomPunch are called.There are other ways to set weapon slots, but this is the simplest by far. ( Weapon.SlotNumber 3) - Tells ZDoom that the weapon will occupy slot 3, like the other shotguns.( Weapon.AmmoUse 4) - Tells ZDoom how much ammo to use when firing the weapon, provided the use argument in the relevant codepointers is set.This is NOT the maximum amount of ammo it can hold. ( Weapon.AmmoGive 12) - Tells ZDoom how much ammo to give the player when this weapon is picked up.( Inventory.PickupSound "misc/usgpickup") - Tells ZDoom what sound to play when the item is picked up, as be defined in the SNDINFO lump.Next there are various weapon properties, such as the ammo type the weapon uses, and how much it uses with each shot. All the information pertaining to this actor must be within these brackets.Īctor properties See Actor properties for a full list The brackets ("") define the start and end of the code block. Note: In order to make a weapon, the actor always has to inherit from Weapon or another actor that does inherit from Weapon, such as SuperShotgun. So our actor is going to be named "UberShotgun", it will inherit all the properties of the super shotgun ("SuperShotgun"), and its DoomEd Number will be 20024. (ACTOR UberShotgun : SuperShotgun 20024) - Describes the actor that is going to be defined within the following code block.Let's analyse this code.ĭefining an actor See DECORATE format specifications for more information Now that big chunk of code describes the functions and states of a shotgun. USHG A 7 A_GunFlash // While on fire state it spawns the weapon's flash. Select: // This state is entered when you select this weapon. Ready: // This state is entered when you have this weapon selected.ĭeselect: // This state is entered when you deselect the current selected weapon. Spawn: // This state is entered when you drop the weapon. A basic weapon in the decorate lump would look like this:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |