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

Some Slade questions for a mod I'm making.

Question

Hi. I've started to mod with slade and I'm making a custom mod.

I want to replace the pistol with a burst firing rifle. I have some expirience with coding, and I know how to make it replace the pistol by adding a new player class and all that in Decorate.

But I don't know how the code would look like to make the weapon itself function.

 

Second question is if I could make the dead marines lying around to be a random colour like the multiplayer marines. (Think Green, Gray, Red, Brown)

Share this post


Link to post

Recommended Posts

  • 0

It all lies in the states. Look at any of the weapons on the wiki and their fire states. You can tweak any of them so they behave like an entirely different gun. Hell, you could make the default Pistol fire rockets with a very simple change from A_FireBullets to A_FireMissile. So all you need to do is replace the pistol and then alter the fire state to fire a bullet, then have some kind of frame delay and change then do it again and maybe one more time if you want three burst. To practice, I would try to make the default pistol burst fire. Study the state names, look at what they are in the IWAD. Re-code it to fire three times in one press.

 

For the dead marines that is simple. Create several inherited copies of the dead marine actor and then use the translation properties on them to change the green armor to other colors. Then, replace the dead marine actor with a RandomSpawner that randomly picks from these new versions. That's actually a cool idea and I might make one too.

Share this post


Link to post
  • 0


   I tried but it didn't work it still functions like the normal pistol. Her'es th code I tried.

 

Spoiler

Actor Repeater : Weapon
{
    Game Doom
    Weapon.SelectionOrder 1900
    Weapon.AmmoUse 1
    Weapon.AmmoType Clip
    +Weapon.NOAUTOFIRE
    Tag "$TAG_RIFLE"
    States
    {
    Ready:
        PISG A 1 A_WEAPONREADY
        Loop
    
    Deselect:
        PISG A 1 A_LOWER
        Loop
    
    Select:
    PISG A 1 A_RAISE
    Loop
    
    Fire:
    PISG A 4
    PISG B 6 A_FIREPISTOL
    PISG C 4
    
    PISG A 4
    PISG B 6 A_FIREPISTOL
    PISG C 4
    
    PISG A 4
    PISG B 6 A_FIREPISTOL
    PISG C 4
    
    PISG B 5 A_REFIRE
    Goto Ready
    
    Flash:
    PISF A 7 Bright A_Light1
    Goto LightDone
    PISF A 7 Bright A_Light1
    Goto LightDone
    
    Spawn:
    Pist A -1
    Stop
    }
}

 

Share this post


Link to post
  • 0

The tics aren't faster so it will still fire 3 times at the same speed as the default. You'll need to speed up the tics and maybe cut out some of the frames for the right effect.

 

Try this (it might look really bad since I just wrote it up just now without testing, but it should explain what I mean):

Fire:
	PISG A 4
	PISG B 4 A_FirePistol
	PISG C 2
	PISG B 4 A_FirePistol
	PISG C 2
	PISG B 4 A_FirePistol
	PISG A 4
	PISG B 5 A_ReFire
	Goto Ready
Flash:
	PISF A 3 Bright A_Light1
	Goto LightDone

 

Share this post


Link to post
  • 0
3 minutes ago, MasterRhan said:

Yes, even if I used the noautofire flag you could still hold the button for autofire.

That's not what that flag does. That flag prevents accidental firing when holding the fire button and switching guns. By default the Rocket Launcher and BFG have the flag.

Share this post


Link to post
  • 0

Yea with my code above something different should at least be happening, even if horribly ugly and broken. lol

Share this post


Link to post
  • 0
Quote

Are you sure the player has the custom weapon at all, and not the regular pistol?

Yes. Here's my code for the player replacer.

Spoiler

Actor BCDPLAYAH : DoomPlayer
{
    Player.WeaponSlot 1,Fist,Chainsaw
    Player.WeaponSlot 2,Repeater
    Player.WeaponSlot 3,Shotgun,SuperShotgun
    Player.WeaponSlot 4,Chaingun
    Player.WeaponSlot 5,RocketLauncher
    Player.WeaponSlot 6,PlasmaRifle
    Player.WeaponSlot 7,BFG9000
    Player.StartItem "Repeater"
    Player.StartItem "Fist"
    Player.StartItem "Clip", 50
}

 

Share this post


Link to post
  • 0

Yeah, the class works now, same with the weapon, but if I've fired the gun I can't switch weapons, if I try to do it I can't fir again and the weapon stops bobbing.

Share this post


Link to post
  • 0

Here you go.

Spoiler

Actor Repeater : Weapon
{
    Game Doom
    Weapon.SelectionOrder 1900
    Weapon.AmmoUse 1
    Weapon.AmmoType Clip
    +Weapon.NOAUTOFIRE
    Tag "$TAG_RIFLE"
    States
    {
    Ready:
        PISG A 1 A_WEAPONREADY
        Loop
    
    Deselect:
        PISG A 1 A_LOWER
        Loop
    
    Select:
    PISG A 1 A_RAISE
    Loop
    
    Fire:
            PISG A 4
            PISG B 5 A_FIREPISTOL
            PISG C 2
            PISG B 5 A_FIREPISTOL
            PISG C 2
            PISG B 5 A_FIREPISTOL
            PISG A 4
            Goto Ready
    
    Flash:
    PISF A 4 Bright A_Light1
    Goto Ready
    
    
    Spawn:
    Pist A -1
    Stop
    }
}
   

 

Share this post


Link to post
  • 0

It works now. Thanks!

Sorry to annoy you more now, but how should I start with the color translation thing, I've already used an actor inheriting from the deadmarine, but what next?

Share this post


Link to post
  • 0

Another weapon, question. In smooth Doom there is an option to make the ssg gib enemies.

Is there away I can do it for vanilla doom? It's odd that the ssg already doen't gib for zombiemen because of their low health vs. ssg's high damage. Is it because it's a bullet weapon?

Share this post


Link to post
  • 0

I'dlike to thank both of you for the help, I'm now making the random corpses. I've defined them and given them a cokour. Al is fine with spawning them. But if I try to spawn them with a randomspawner replacing the deadmarines, nothing appears.

Code for spawner:

Spoiler

Actor CorpseRandomizer : Actor replaces DeadMarine
{
    DropItem "Indigodeadmarine", 144, 2
    DropItem "reddeadmarine", 144, 3
    Dropitem "browndeadmarine", 144, 4
    DropItem "greendeadmarine", 144, 1
    DropItem "bluedeadmarine", 144, 5
    DropItem "blackdeadmarine", 144, 6
}

 

Share this post


Link to post
  • 0

Use the "Edit" button instead of posting multiple times in a row.

 

The second word "Actor" in your code should probably be "RandomSpawner" instead. Also the number 144 makes it possible that nothing will get spawned sometimes, use number 255 to prevent that.

 

Also, SSG doesn't gib because each of its 20 pellets counts as an individual source of damage, and each of them does too little damage to gib even Doom's weakest monsters.

Edited by scifista42

Share this post


Link to post
  • 0

Changed my code to.

Spoiler

Actor CorpseRandomizer : RandomSpawner replaces DeadMarine
{
    DropItem "Indigodeadmarine", 255, 2
    DropItem "reddeadmarine", 255, 3
    Dropitem "browndeadmarine", 255, 4
    DropItem "greendeadmarine", 255, 1
    DropItem "bluedeadmarine", 255, 5
    DropItem "blackdeadmarine", 255, 6
}

But now if I try to run it I get this error

"Script error, "bloodcolourdemons.wad:DECORATE" line 90:
Unexpected '.' in definition of 'BCDPLAYAH'"

Even If I've not changed a thing in line 90.

 

Spoiler

Actor BCDPLAYAH : DoomPlayer
{
    Player.WeaponSlot 1,Fist,Chainsaw
    Player.WeaponSlot 2,Repeater,
    Player.WeaponSlot 3,Shotgun,SuperShotgun (This is line 90)
    Player.WeaponSlot 4,Chaingun
    Player.WeaponSlot 5,RocketLauncher
    Player.WeaponSlot 6,PlasmaRifle
    Player.WeaponSlot 7,BFG9000
    Player.StartItem "Repeater"
    Player.StartItem "Fist"
    Player.StartItem "Clip", 50
}

 

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
×