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
rollingcrow
Posts: 733
Joined: Tue Mar 02, 2010 8:30 pm
Graphics Processor: nVidia with Vulkan support

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

Post by rollingcrow »

Ctrl+Alt+Destroy wrote:How would I display a bar of brass shells on the screen representing the amount of ammo the player has in a magazine (for a specific weapon), and then making each individual shell disappear after each shot? I basically want it to operate exactly like an ammo bar, except there's one shell representing each shell in the player's magazine.
Use IsSelected to check what happen is being used, then use InInventory for each number of ammo the weapon has to check whether or not to draw an image of a casing.
Spoiler: Example
User avatar
Ctrl+Alt+Destroy
Posts: 511
Joined: Tue Feb 05, 2013 9:31 pm
Location: In the unknown void of all-surpassing emptiness

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

Post by Ctrl+Alt+Destroy »

Is that SBARINFO code? I didn't know it could be done that way. MagSigmaX helped me with an ACS script yesterday to get it working. SBARINFO would probably work much more nicely than an ACS script, so I'll probably just do that. Thanks, Se7eNytes.
User avatar
Andie
Posts: 53
Joined: Sun May 19, 2013 3:33 pm

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

Post by Andie »

I created a trashcan actor, which changes its sprite upon getting damage. Problem is, when it enters death state, pain state or wound state (I tried all of them with different flags, properties and A_ChangeFlag — same result), it's no longer getting pushed when damaged — just stays there, blocking projectiles like a solid wall. What exactly happens when actor dies?
albiongeck
Posts: 182
Joined: Fri Mar 16, 2012 7:11 am
Contact:

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

Post by albiongeck »

Sounds like you could compare your actor to the Doom2 keen? It sounds like you want a similar thing.
User avatar
Andie
Posts: 53
Joined: Sun May 19, 2013 3:33 pm

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

Post by Andie »

You mean CommanderKeen class?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

Andie wrote:I created a trashcan actor, which changes its sprite upon getting damage. Problem is, when it enters death state, pain state or wound state (I tried all of them with different flags, properties and A_ChangeFlag — same result), it's no longer getting pushed when damaged — just stays there, blocking projectiles like a solid wall.
Have you used [wiki]A_NoBlocking[/wiki] in the actor's death state sequence?
Andie wrote:What exactly happens when actor dies?
A bunch of stuff.
  • If needed, unmorph on death is handled
  • Invulnerability GFX, if any, are removed
  • All the items in the actor's inventory are notified that the actor died
  • If the actor is a missile, it explodes. This branches to a different special handling.
  • The actor's target field is set to whatever killed it, a behavior that comes from Strife.
  • If the actor is a monster, a player, or has a Raise state, the CORPSE flag is set. (Unless it has the DONTCORPSE flag, obviously.)
  • The KILLED flag is set. (I don't think you can set this one from DECORATE; it's used internally only.)
  • The actor's height is modified. There's some special case handling here depending on damage type, since there's both a DeathHeight and a BurnHeight property to take into account if needed. By default, the height is halved.
  • If the actor has a special, and it can be activated by death, the special is activated.
  • If the actor has the COUNTKILL flag, the monsters killed statistic is increased.
  • Lots of stuff related to deathmatch, fragging, spree announcement, etc.
  • Related to the deathmatch stuff, if the actor is a player, there's more stuff that happens here, dropping the weapon, the viewheight, switching the view away from the automap if needed, and clearing out any extra light caused by a weapon.
  • Looking for a suitable Death state, according to damage type, with special handling for ice damage so as to use the generic freeze death if there's no specific state in the actor itself. This also handles the actor being gibbed by extreme damage.
  • Copy the damage type from the killing blow to the actor itself. It's a bit hacky in place.
  • If there is a suitable death state, the amount of tics to spend in it is shortened randomly by one to three tics.
  • If there is no death state at all, the actor is simply destroyed entirely to free system resources.
As you can see, nothing here changes the actor being shootable or no (though the height is changed).
User avatar
Andie
Posts: 53
Joined: Sun May 19, 2013 3:33 pm

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

Post by Andie »

Gez wrote:
Andie wrote:I created a trashcan actor, which changes its sprite upon getting damage. Problem is, when it enters death state, pain state or wound state (I tried all of them with different flags, properties and A_ChangeFlag — same result), it's no longer getting pushed when damaged — just stays there, blocking projectiles like a solid wall.
Have you used [wiki]A_NoBlocking[/wiki] in the actor's death state sequence?
Andie wrote:What exactly happens when actor dies?
A bunch of stuff.
  • If needed, unmorph on death is handled
  • Invulnerability GFX, if any, are removed
  • All the items in the actor's inventory are notified that the actor died
  • If the actor is a missile, it explodes. This branches to a different special handling.
  • The actor's target field is set to whatever killed it, a behavior that comes from Strife.
  • If the actor is a monster, a player, or has a Raise state, the CORPSE flag is set. (Unless it has the DONTCORPSE flag, obviously.)
  • The KILLED flag is set. (I don't think you can set this one from DECORATE; it's used internally only.)
  • The actor's height is modified. There's some special case handling here depending on damage type, since there's both a DeathHeight and a BurnHeight property to take into account if needed. By default, the height is halved.
  • If the actor has a special, and it can be activated by death, the special is activated.
  • If the actor has the COUNTKILL flag, the monsters killed statistic is increased.
  • Lots of stuff related to deathmatch, fragging, spree announcement, etc.
  • Related to the deathmatch stuff, if the actor is a player, there's more stuff that happens here, dropping the weapon, the viewheight, switching the view away from the automap if needed, and clearing out any extra light caused by a weapon.
  • Looking for a suitable Death state, according to damage type, with special handling for ice damage so as to use the generic freeze death if there's no specific state in the actor itself. This also handles the actor being gibbed by extreme damage.
  • Copy the damage type from the killing blow to the actor itself. It's a bit hacky in place.
  • If there is a suitable death state, the amount of tics to spend in it is shortened randomly by one to three tics.
  • If there is no death state at all, the actor is simply destroyed entirely to free system resources.
As you can see, nothing here changes the actor being shootable or no (though the height is changed).
No, I didn't use A_NoBlocking. Thank you for this list, It appears, though, that the game sets SHOOTABLE flag off after death by default — got to A_ChangeFlag during death state to set it up again. Well, to hell with it, it's good as it is.
User avatar
Ghostbreed
Posts: 1114
Joined: Wed Mar 24, 2010 6:19 am

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

Post by Ghostbreed »

Ported over the Dragon Claw from Heretic to Doom, how do I change ammo type so I can for example load it with cells?
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Make a new actor class that [wiki=Using_inheritance]inherits[/wiki] from the [wiki=Classes:Blaster]claw[/wiki], and change its [wiki=Actor_properties#Weapon.AmmoType]ammo type[/wiki].
User avatar
Orangestar
Posts: 23
Joined: Sat Mar 17, 2012 12:51 pm
Contact:

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

Post by Orangestar »

In ACS, how do I determine who gets sent a message about what? I know doing straight up hudmessage(<etc>); will send a message to the client that activated the script, but how do I make, say, a message which sends to all clients, or to a specific team?

(Yeah, I'm doing a Zandronum map so I really should ask them, but ZDoom has teams too and this map will work in ZDoom.)
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

how do I make the alt fire use Weapon.ammotype1 only while a Weapon.ammotype2 exists?
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

User avatar
Ghostbreed
Posts: 1114
Joined: Wed Mar 24, 2010 6:19 am

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

Post by Ghostbreed »

Blue Shadow wrote:Make a new actor class that [wiki=Using_inheritance]inherits[/wiki] from the [wiki=Classes:Blaster]claw[/wiki], and change its [wiki=Actor_properties#Weapon.AmmoType]ammo type[/wiki].
:) Thank you

EDIT: Regarding corrected bloodcolor, how do I implement it in the original enemies so that I can play it on the original WADs without removing the original actors and put out new ones?
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

What's wrong with making a one-lump mod with replacements featuring this change, and [wiki=How_to_autoload_files]autoloading[/wiki] it?
User avatar
Ghostbreed
Posts: 1114
Joined: Wed Mar 24, 2010 6:19 am

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

Post by Ghostbreed »

The new actor will collide with the original?
Locked

Return to “Editing (Archive)”