The "How do I..." Thread

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Sgt. Shivers
Posts: 1743
Joined: Fri Jun 22, 2012 5:39 am

Re: The "How do I..." Thread

Post by Sgt. Shivers »

How could I make a weapon that imitates the firing style of the quake 2 chaingun? By this I mean it starts off firing at an average speed then slowly speeds up.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: The "How do I..." Thread

Post by Matt »

Create an inventory item.

Have the gun's ready state constantly take that inventory item away.

Set up as many firing states as you have firing speeds. At the end of each one, give the player 1 of that item.

In the Hold state, check how many of that item the player has. The more the player has, the higher-speed firing state you will jump to.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: The "How do I..." Thread

Post by Matt »

Dortold wrote:DECORATE/ACS n00b, here. Using some very basic ACS I've made a SectorDamage sector that hurts players and monsters at a rate of 2dmg per 8tics. What I'm trying to do is make it so that if the player has any armour the damage goes to that and doesn't touch his health. So even if he had just 13 armour, he would take 0 health damage for 8*13 tics in the damage sector, after which time his armour would be completely depleted and he would take health damage once more.

Code: Select all

SCRIPT 1 OPEN                   {
    SectorDamage (1,2,"None",666,DAMAGE_PLAYERS | DAMAGE_NONPLAYERS | DAMAGE_IN_AIR);
    DELAY (8);
    Restart;
}
(The 666 is there because having it at zero made the player invulnerable when he picked up a keycard. I told you I was a n00b. :p)
I haven't got the slightest idea but I'll quote this since it was on the bottom of the last page.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

I haven't tried this, so it might work and it might not:

Edit the existing armor vests and give them 100% resistance to a special damage type (use [wiki=Actor_properties#DamageFactor]DamageFactor[/wiki]) that will only be used by the damaging floor. Example:

Code: Select all

ACTOR GreenArmor2 : GreenArmor
{
  DamageFactor "Blah", 0 // Change the type to anything you want, but it should be the same as the one used by SectorDamage
}

Code: Select all

SCRIPT 1 OPEN                   {
    SectorDamage (1,2,"Blah",666,DAMAGE_PLAYERS | DAMAGE_NONPLAYERS | DAMAGE_IN_AIR);
    DELAY (8);
    Restart;
}
User avatar
Dortold
Posts: 52
Joined: Sun Jan 27, 2013 9:57 am
Contact:

Re: The "How do I..." Thread

Post by Dortold »

Thank you very much, Blue Shadow (and Vaecrius for bumping my question). That's definitely helped me along.

My only problem now is getting the armour to absorb 100% of the damage from SectorDamage yet still only absorb 33.335% from enemy attacks, etc. Is there any way to specify Armor.SavePercent for different damage types like one can do with DamageFactor?
User avatar
xxninja666xx
Posts: 28
Joined: Sat Jan 26, 2013 10:48 am
Location: Capital Wasteland

Re: The "How do I..." Thread

Post by xxninja666xx »

Ok, another moronic question by me: How do I make my custom Player.SoundClass work? When I define it with parameter $playersound, zdoom gives me an error that sounds reserved for players can't be reassigned, but when I use $playersounddup then it gives me an error that pain1 (a sound file) is not a player sound. What do I do wrong? Here's the SNDINFO code:

Code: Select all

$playersounddup commando male *pain100 pain1
$playersounddup commando male *pain75 pain2
$playersounddup commando male *pain50 pain3
$playersounddup commando male *pain25 pain4
$playersounddup commando male *death $random (death1, death2, death3)
$playersounddup commando male *xdeath $random (death1, death2, death3)
death1 death1
death2 death2
death3 death3
pain1 pain1
pain2 pain2
pain3 pain3
pain4 pain4
PS. I've read the wiki article and done it according to what it said, so don't reply with a link to the article about SNDINFO
PS2. Sorry for asking so many questions, but I'm kind of a newbie in DECORATE and still learning.
User avatar
jpalomo
Posts: 772
Joined: Mon May 17, 2010 9:45 am

Re: The "How do I..." Thread

Post by jpalomo »

$playersounddup is for existing player sounds. Also, you need to define $random separately from the player sound.

Code: Select all

$random commando/death {death1 death2 death3}
$playersound commando male *pain100 pain1
$playersound commando male *pain75 pain2
$playersound commando male *pain50 pain3
$playersound commando male *pain25 pain4
I don't remember how to use a logical name (in the example above: commando/death) as a player sound though.
User avatar
xxninja666xx
Posts: 28
Joined: Sat Jan 26, 2013 10:48 am
Location: Capital Wasteland

Re: The "How do I..." Thread

Post by xxninja666xx »

Ok, thanks for the help. Now it doesn't come up with any error. However, my custom sounds don't want to play when hit or killed. Instead I get default doomguy grunts. The custom Player.SoundClass is set in decorate but it doesn't work. What seems to be the problem?

EDIT: Nevermind. I figured that on my own. I just had to add quotation marks to the sound class in SNDINFO.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: The "How do I..." Thread

Post by Matt »

I've long wanted to make a projectile that would inherit its shooter's momentum. One possibility that came to mind was [wiki]A_SpawnItemEx[/wiki] followed by [wiki]A_RearrangePointers[/wiki] in the projectile itself, but how would I check a player's crouch status?

And how does the normal situation work anyway? Do you always shoot from a non-crouching position once you let go of the crouch key and there's nothing blocking you from standing, or are you shooting from crouched until you're standing, or can you shoot from a position somewhere in between?
User avatar
Orangestar
Posts: 23
Joined: Sat Mar 17, 2012 12:51 pm
Contact:

Re: The "How do I..." Thread

Post by Orangestar »

I don't know if I'm allowed to bring this back up but I'm still wondering what's wrong with my 3D floor.
yohyzo10
Posts: 3
Joined: Fri Jun 22, 2012 9:05 pm

Re: The "How do I..." Thread

Post by yohyzo10 »

How do you remove blocking from a thing so you can walk through it?
User avatar
Enjay
 
 
Posts: 27135
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: The "How do I..." Thread

Post by Enjay »

Orangestar wrote:I don't know if I'm allowed to bring this back up but I'm still wondering what's wrong with my 3D floor.
Can you upload the file somewhere so that people can take a look?
User avatar
Ravick
Posts: 2051
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

Re: The "How do I..." Thread

Post by Ravick »

yohyzo10 wrote:How do you remove blocking from a thing so you can walk through it?
You could try by changing flags like SOLID, NOCLIP or NOINTERACTION on it, depending of your needs.
Lork
Posts: 37
Joined: Sat Jan 09, 2010 11:07 pm

Re: The "How do I..." Thread

Post by Lork »

How do I make a melee attack that hits an arc in a specified direction rather than a fixed point in front of the player?
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

Re: The "How do I..." Thread

Post by Blue Shadow »

You mean like sword slash and such? Not currently.
Locked

Return to “Editing (Archive)”