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
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

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

Post by amv2k9 »

jpalomo wrote:I'm having trouble making a weapon that functions like the TF2 minigun. I've managed to get it to spin up with alt fire and be able to fire while still holding down the alt fire key, but as soon as I let go it spins down even if I am still holding the primary fire key. Is there any way to check if either fire key is being pressed? A_Refire does not do this (it only checks for the key you initially pressed).
You could do an inventory hack where altfire serves as a toggle for the barrel spin, and have new Fire and Ready states that send it to the appropriate states depending on whether the "checker" inventory item is held. Some mod I've played lately does this... can't remember if it's Brutal Doom or Hideous Destructor.
Last edited by amv2k9 on Thu Jun 21, 2012 5:53 pm, edited 1 time in total.
User avatar
InsanityBringer
Posts: 3392
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

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

Post by InsanityBringer »

if you want it to be hold activated like TF2 itself you'll probably have to involve an ACS script using GetPlayerInput in addition to the inventory check. The script, when you have the minigun out, checks for the altfire input and if it's down, gives the player an inventory item. The weapon checks for this inventory item and when it first sees it, it goes into spin mode. When the item is taken away, it spins down. While its spinning, it's also A_WeaponReadying allowing you to fire. When you fire, the fire state will also check for the inventory item, and if its present, it skips the spinup and spindown animations when you start and stop firing it.

There will probably be minor hitches with hitting altfire during firing, but these should be solvable.
User avatar
jpalomo
Posts: 772
Joined: Mon May 17, 2010 9:45 am

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

Post by jpalomo »

I think I got it by adding JumpIf functions with CallACS and GetPlayerInput right after the A_Refire calls. It's a bit messy, but it will do.

EDIT:
Thanks. I got it working now. I don't even need A_Refire anymore with the setup I have.
User avatar
Reactor
Posts: 2091
Joined: Thu Feb 03, 2011 6:39 pm
Location: Island's Beauty, Hungary

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

Post by Reactor »

amv2k9 wrote:
Reactor wrote:I am referring the maximum width of a weapon, which is appropiate under GZDoom. Height is not a problem, width IS. Surely a Gauss pistol will not be that long like a Thermal Shok Launcher, so I need the maximum appropiate length for a weapon pickup sprite, so I can measure smaller weapons to them.
...Are you talking about the size of the actual sprite, or the size of the collision box of its pickup?
Hm. If there is a way to customize the hitbox for each weapon sprite, this is no problem :)
KPu3uC B Poccuu
Posts: 36
Joined: Sun May 22, 2011 9:51 pm
Location: Russia

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

Post by KPu3uC B Poccuu »

Radius & Height actor properties must help.
User avatar
Piter432
Posts: 77
Joined: Sat Oct 23, 2010 1:16 am
Location: Polska, Zawiercie

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

Post by Piter432 »

Is there a way to change monster health in acs?

For example: I want to change Zombieman health from 20 HP to 30 HP on medium skill, but when I select hard skill I want to change hp to 40.

I hope someone can understand what I write.
Zombieguy
Posts: 1880
Joined: Mon May 24, 2010 4:38 pm
Location: C:\Earth>

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

Post by Zombieguy »

I want to make a melee weapon. And after the weapon hits a bleeding actor, I want it to swich to a different sprite which includes bloodstains. How do I do that? Basically just like the chainsaw in brutal doom.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

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

Post by amv2k9 »

Zombieguy wrote:Basically just like the chainsaw in brutal doom.
Well, you could always look at the code of the Brutal Doom chainsaw.

As for an answer that isn't so lazy, I'd imagine that the way BD does it is some inventory hackery:

1) Bleeding enemy has custom painstate linked to damagetype only done by the chainsaw.
2) Enemy painstate calls A_GiveToTarget, and gives a dummy item.
3) Chainsaw checks for said dummy item, and jumps to Ready, Fire, etc states with bloodied blade sprites.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Marine wrote:Is there a way to change monster health in acs?

For example: I want to change Zombieman health from 20 HP to 30 HP on medium skill, but when I select hard skill I want to change hp to 40.

I hope someone can understand what I write.
You can do this with a combination of ACS and DECORATE.

Inherit from the original monster and modify its Spawn state to run an ACS script when it's first spawned in the game. The script will decide what the skill is and set the monster's health accordingly.

Things you want to look at:
  • [wiki]ACS_ExecuteAlways[/wiki]/[wiki]ACS_NamedExecuteAlways[/wiki] (if you're going for [wiki]named scripts[/wiki])
  • [wiki]SetActorProperty[/wiki]
  • [wiki]GameSkill[/wiki]
There is also the MonsterHealth property in [wiki=Skill_definition]Skill definition[/wiki] that can be used to scale monsters health, however, this will affect all monsters.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

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

Post by amv2k9 »

Marine wrote:Is there a way to change monster health in acs? For example: I want to change Zombieman health from 20 HP to 30 HP on medium skill, but when I select hard skill I want to change hp to 40.
Don't even need ACS to have the same monster with different amounts of health. Use ReplaceActor in a skill definition:

Code: Select all

skill hellish
{
  FastMonsters
  DisableCheats
  SpawnFilter = Hard
  Name = "Hellish"
  ReplaceActor = "Zombieman", "ZombiemanWithTenMoreHP"
}
User avatar
doony
Posts: 161
Joined: Wed May 27, 2009 8:34 pm
Location: more than a year developing a gameplay mod
Contact:

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

Post by doony »

the NEW WEAPONS ANIMATION sprites is freeware to use?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

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

Post by Xaser »

Huh?
User avatar
Enjay
 
 
Posts: 27139
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

I'm sure that I should know this but I can't think how to do it so....

How do I modify the rad suit so that it keeps its current behaviour and also give protection from the poison clouds spawned by Hexen poison mushrooms?
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

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

Post by amv2k9 »

Enjay wrote:I'm sure that I should know this but I can't think how to do it so....

How do I modify the rad suit so that it keeps its current behaviour and also give protection from the poison clouds spawned by Hexen poison mushrooms?
Make a CustomInventory Item that gives the Radsuit & a "PoisonCloud" damage-nulling Protection powerup on pickup?
User avatar
Enjay
 
 
Posts: 27139
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

It's the making of an item that nullifies the PoisonCloud damage type that is stumping me. I don't suppose you have an example?
Locked

Return to “Editing (Archive)”