Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Samurai77

I really need help coding a DECORATE file

Recommended Posts

I just recently followed a tutorial on how to add custom sprites to doom as well as coding them. In the part where he teaches how to code a DECORATE, I've pretty much typed in the same line of code 1 to 1 as the tutorial (a part from naming the weapon obviously.) it runs for him just fine but when I run my wad it just gets script errors. I'm honestly at my wits end and there is no other video out there that can help me because their methods don't work anymore.

 

This is the error I keep getting by the way. I could really use some guidance here. 

Screenshot (101).png

Edited by Samurai77

Share this post


Link to post

Here you go. 

 

ACTOR MummyPharaoh: DoomPlayer {
    Player.WeaponSlot 1, Fist, AncientScarab
    Player.WeaponSlot 2, Pistol
    Player.WeaponSlot 3, Shotgun, SuperShotgun
    Player.WeaponSlot 4, Chaingun
    Player.WeaponSlot 5, RocketLauncher
    Player.WeaponSlot 6, PlasmaRifle
    Player.WeaponSlot 7, BFG9000
}

ACTOR AncientScarab: Weapon Replaces Chainsaw 20000 {
    Weapon.SelectionOrder 50
    Weapon.AmmoUse 5
    Weapon.AmmoGive 100
    Weapon.AmmoType "Clip"
    Inventory.PickupSound "weapon/getweapon"
    Inventory.PickupMessage "Layla picked up an Ancient Scarab!"
    States {
        Spawn:
        SCAR A -1
        Stop
        
        Select:
        BETL A 1 A_Raise
        Loop
        
        Deselect:
        BETL A 1 A_Lower
        Loop
        
        Ready:
        BETL A 1 A_WeaponReady
        Loop
        
        Fire:
        BETL BCD 4
        Goto Poopiefire
        
        PoopieFire:
        BETL E 0 A_PlaySound ("weapon/attack",CHAN_WEAPON, 0.7
        BETL E 0 A_Recoil(4)
        BETL E 5 A_FireCustomMissle("PoopieMissle",0,2,-8)
        BETL D 5
        BETL D 0 A_Refire("PoopieFire")
        Goto Ready
    }
}

Share this post


Link to post

Your code is missing closing ')' at 

BETL E 0 A_PlaySound ("weapon/attack",CHAN_WEAPON, 0.7

 

Share this post


Link to post

Ok XD Thank you for pointing that. However another script error popped up after i fixed it. 

 

Script error, "ankh.wad:DECORATE" line 42:
Invalid parameter 'a_firecustommissle'  

Share this post


Link to post

okay so new problem I fixed the other error now i have this error 

 

Script error, "ankh.wad:DECORATE" line 42:
Expected ')', got ','.

 

Updated code. 

 

ACTOR MummyPharaoh: DoomPlayer {
    Player.WeaponSlot 1, Fist, AncientScarab
    Player.WeaponSlot 2, Pistol
    Player.WeaponSlot 3, Shotgun, SuperShotgun
    Player.WeaponSlot 4, Chaingun
    Player.WeaponSlot 5, RocketLauncher
    Player.WeaponSlot 6, PlasmaRifle
    Player.WeaponSlot 7, BFG9000
}

ACTOR AncientScarab: Weapon Replaces Chainsaw 20000 {
    Weapon.SelectionOrder 50
    Weapon.AmmoUse 5
    Weapon.AmmoGive 100
    Weapon.AmmoType "Clip"
    Inventory.PickupSound "weapon/getweapon"
    Inventory.PickupMessage "Layla picked up an Ancient Scarab!"
    States {
        Spawn:
        SCAR A -1
        Stop
        
        Select:
        BETL A 1 A_Raise
        Loop
        
        Deselect:
        BETL A 1 A_Lower
        Loop
        
        Ready:
        BETL A 1 A_WeaponReady
        Loop
        
        Fire:
        BETL BCD 4
        Goto Poopiefire
        
        PoopieFire:
        BETL E 0 A_PlaySound ("weapon/attack",CHAN_WEAPON, 0.7)
        BETL E 0 A_Recoil(4)
        BETL E 5 A_Fire ("PoopieMissle",0,2,0,-8)
        BETL D 5
        BETL D 0 A_Refire("PoopieFire")
        Goto Ready
    }
}

ACTOR PoopieMissile : Actor 20001 {
    +RANDOMIZE
    
    Decal "Scorch"
    Projectile
    
    Radius 6
    Height 8
    Speed 20
    Damage 15
    
    DeathSound "weapon/plasmax"
    
    States {
        Spawn:
        BAL1 AB 4 Bright
        Loop
        
        Death:
        BAL1 CDE 4 Bright
        Stop
    }
}

Share this post


Link to post
56 minutes ago, Samurai77 said:

Script error, "ankh.wad:DECORATE" line 42:

Invalid parameter 'a_firecustommissle' 

In this error you seem to have misspelled 'A_FireCustomMissile'.  That should fix your problem.

 

 

25 minutes ago, Samurai77 said:

        PoopieFire:

        BETL E 0 A_PlaySound ("weapon/attack",CHAN_WEAPON, 0.7)
        BETL E 0 A_Recoil(4)
        BETL E 5 A_Fire ("PoopieMissle",0,2,0,-8)

Here it looks like you're using A_Fire instead of A_FireCustomMissile - it has different parameters (the part in brackets) and eventually runs into a comma where it thinks it should be time to close the brackets.  Look up A_Fire and A_FireCustomMissile on www.zdoomwiki.com:
https://zdoom.org/wiki/Action_functions

So far looks like your mostly running into formatting errors.  Anytime you get the line the error is occurring on, it can help to just copy and paste from the wiki, or whatever source you're getting your script from.

 

Share this post


Link to post

Ok so I got the code fixed but now I have ANOTHER problem when I run the wad and pick up my custom weapon in game and I fire it no projectiles appear or damage the enemies. All the other effects like recoil and sounds are working. But again no projectiles...

Edited by Samurai77

Share this post


Link to post

This may have something to do with it. If it does not sure how to fix it.

 

Script warning, "ankh.wad:DECORATE" Line 43:

Unknown class name 'PoopieMissle' of type 'Actor'

 

I swear it feels like this program is just doing everything to prevent me from making mods XD

Share this post


Link to post

Again, you're spelling it "Missile" in one place and "Missle" in another. Maybe pick an easier name for your projectile? Like just "Scarab" perhaps

Share this post


Link to post

You're looking at it as if you fixed one mistake and that created another one. But the more accurate explanation is you had many mistakes there to begin with, and fixing the first one allows the parser to get to the point where the second one is noticed, and fixing the second one then allows... Just be patient and fix them all.

 

Also, learning what the error message is telling you exactly is an important skill. Don't try to blow past that. When you get an error message, take note of what the fix was so that you'll have something to go on next time it happens. The message is telling you something precise, not "There was a fucky wucky. Fix it." So try to learn what certain phrases are saying instead of treating it like the error is the program getting in the way. 

 

I get around 3-7 error messages pretty frequently. The difference between making something quickly and it taking a while is often being patient with and putting a lot of thought into the error messages, instead of treating them as something to quickly rush past so that you can do what you wanted to.

Share this post


Link to post

You make good points. I wish I wasn't so dumb with this stuff XD. Patience isn't really my strong suit lol. I appreciate the help, Everyone. 

Share this post


Link to post

Nah, you're not dumb, that's just how it is starting out. It's more about habits and familiarity. Here are a few tips that I use to help me with these issues:

 

I Copy and Paste as much as possible

I have the Doom Wiki (www.zdoomwiki.org) open at all times

If I've made something once, I just reuse the code and edit instead of re-writing from scratch every time

I test run often, so I have a better idea of what was changed or added that could be throwing an error

If I can't seem to find/fix errors, I work on something else for a bit and come back to it later or the next day.

 

Once you've got your first modded weapon or monster working properly, everything gets easier, trust me - I hope your weapon is coming along!

Share this post


Link to post

The first weapon works great! Though I cant seem to figure which line of text controls the rate of fire for weapons. Also cant seem to find a tutorial on how to make hit scan weapons. Dont get me wrong i love projectiles but hits scan weapons like the chain gun are fun too XD

Share this post


Link to post

Rate of fire of any weapon is controlled by how many frames you set in your Fire method per sprite. For example, if I have a line that says SHTG 2 A 8, it would stay on the sprite SHTG2A0 for the next 8 frames. The lower the number, the faster the frames.

 

As for custom hitscan attacks, you may want to look at this ZDoom Wiki article on A_FireBullets.

Share this post


Link to post

Thanks! One last question. I noticed that there is a number next to this line of code.

 

ACTOR AncientScarab: Weapon Replaces Chainsaw 20000 { 

 

Can anyone explain to me what this number exactly is? I only typed it in here cause that's how the guy typed it in his video tutorial. Do I need it to put in a number for each weapon I replace? 

Share this post


Link to post

The Replace and the entry number are for maps.  The entry number is necessary to call up the actor in a map editor and put it in levels, whereas the "Replaces" will replace all the instances of the replaced actor with the one you made. 'Replaces' is good for testing because its an easy way to load your stuff into already built levels.

 

The 'PoopieMissile' in your code will work fine without either, as just:

 

ACTOR Poopiemissile {

 

Projectiles don't get placed in a level like weapons ammo or monsters, so they don't need either 'Replaces' or an entry# to work properly.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×