The "How do I..." Thread
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.
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.
Re: The "How do I..." Thread
Is there a way to let an actor pass through others without at the same time making it near invulnerable to missiles?
+THRUACTORS causes missiles to pass through (so you have to shoot some nearby floor to get them).
+THRUSPECIES only allows passing actors of a specific kind.
I want it to pass through all non-damaging/non-explosive actors, I suppose. (Active collision detection off, passive collission detection off against non-missile actors.)
+THRUACTORS causes missiles to pass through (so you have to shoot some nearby floor to get them).
+THRUSPECIES only allows passing actors of a specific kind.
I want it to pass through all non-damaging/non-explosive actors, I suppose. (Active collision detection off, passive collission detection off against non-missile actors.)
- Ryan Cordell
- Posts: 4349
- Joined: Sun Feb 06, 2005 6:39 am
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Capital of Explodistan
Re: The "How do I..." Thread
+THRUSPECIES would work, but you'd have to define the same species for all the actors you want it to pass through.
And I don't think you can define more than one species, sadly
And I don't think you can define more than one species, sadly

Re: The "How do I..." Thread
Is there a way to lower a monster's attack height? There is a monster that shoots both projectiles and rails, and it's too high. (looks like it's coming out of their eyes, not their gun)
I don't want to change the actor's physical height.
I don't want to change the actor's physical height.
Re: The "How do I..." Thread
Double post to ask another question: How do I rebuild nodes in DoomBuilder 2? It doesn't seem to be doing it automatically when I need it to. So how do I manually make it do so?
Also, is the question from my previous post possible? There's got to be some way to change enemy attack height...
Also, is the question from my previous post possible? There's got to be some way to change enemy attack height...
Re: The "How do I..." Thread
Sodaholic wrote:Is there a way to lower a monster's attack height? There is a monster that shoots both projectiles and rails, and it's too high. (looks like it's coming out of their eyes, not their gun)
I don't want to change the actor's physical height.
Code: Select all
A_CustomMissile (string missiletype[, float spawnheight[, int spawnofs_horiz[, angle angle[, int aimflags[, angle pitch]]]]])
However...
Code: Select all
A_CustomRailgun (int damage [, int offset [, color ringcolor [, color corecolor [, int flags [, bool aim [, float maxdiff [, str pufftype[, float spread_xy[, float spread_z]]]]]]]]])
Re: The "How do I..." Thread
Hate to doublepost but I have a question of my own: How do you get PNGs to show up properly when used as TITLEPIC & the credits page, and also the menu graphic (above New Game, Load Game, etc)?
-All have the same physical dimensions as the gfx they replace.
-All have the same filename as the gfx they replace.
-All were saved as 8-bit PNGs prior to importing.
-After importing, all of them were converted to Doom Graphic format & switched to the Strife palette (the mod is for Strife).
-I made a gameinfo section in MAPINFO and specified the new images.
The normal titlescreen & credits come up, and the menu graphic is also the same.
The only thing that happens differently is that the console background displays a glitched graphic (I didn't make a CONBACK lump so it's just using TITLEPIC).
-All have the same physical dimensions as the gfx they replace.
-All have the same filename as the gfx they replace.
-All were saved as 8-bit PNGs prior to importing.
-After importing, all of them were converted to Doom Graphic format & switched to the Strife palette (the mod is for Strife).
-I made a gameinfo section in MAPINFO and specified the new images.
The normal titlescreen & credits come up, and the menu graphic is also the same.
The only thing that happens differently is that the console background displays a glitched graphic (I didn't make a CONBACK lump so it's just using TITLEPIC).
-
- Posts: 474
- Joined: Fri Jul 18, 2008 12:27 pm
Re: The "How do I..." Thread
How do I check the players health, and write a script that heals both a monster of a given tag and the player who activated it after certain conditions are met?
Re: The "How do I..." Thread
=.= Right.
So, after 6 years of trying to get something to work I finally give up.
I'm trying to write a non-acs, Decorate, Logic state in A_Jumpif that checks how fast a player is moving, doesn't matter what way.
I'm doing this in such a fashion that the player will slown down their walking animation when below a certain velocity... unfortunately, none of the statements I've tried so far are not working.
The statement to jump to is called "SeeWalk" ...
Anybody feel like writing it out for me or something?
The player has regular walking and running speeds.
Thanks in advance...
So, after 6 years of trying to get something to work I finally give up.
I'm trying to write a non-acs, Decorate, Logic state in A_Jumpif that checks how fast a player is moving, doesn't matter what way.
I'm doing this in such a fashion that the player will slown down their walking animation when below a certain velocity... unfortunately, none of the statements I've tried so far are not working.
The statement to jump to is called "SeeWalk" ...
Anybody feel like writing it out for me or something?
The player has regular walking and running speeds.
Thanks in advance...
Code: Select all
PLAY A 0 A_JumpIf( - - ,"SeeWalk")
Re: The "How do I..." Thread
You could of course make the player spawn an actor, that disappears if the player is close enough. And if said player isn't close enough, he gains an item.
And if that item is in the player's inventory, make it continue said pace. If it isn't, it goes to the walking sequence.
Yes, so much for DECORATE. It's probably going to be a real pain to pull off, but it should (read: should) work.
And if that item is in the player's inventory, make it continue said pace. If it isn't, it goes to the walking sequence.
Yes, so much for DECORATE. It's probably going to be a real pain to pull off, but it should (read: should) work.
Re: The "How do I..." Thread
Using Pythagoras? Velocity^2 is much easier to get, than velocity itself.
Say you wanted to work with speeds 3, 9 and 20 (random ascending values on my part).
Velocity^2 thresholds become: 3*3=9 ; 9*9 = 81; 20 * 20 = 400
Works equally well in three and two dimensions. I'm going to write out 2d with an extra "CheckFloor", since you mentioned walk and run.
2d:Any use to you?
If you want distinct graphics for the different states, insert frames with graphics and non-0 duration in each state. If not, replace all calls of "goto UnknownState" with a call to a new state which shows graphics and passes some time. As it is, this code is an infinite 0-delay loop. (Unless the actor is in the air, in which case it works until he lands.)
Performance: It may, or may not (I just don't know) be more efficient for the CPU, if you define a user variable and assign "velx * velx + vely * vely" to it at the beginning of the "UnknownState" in my example. Use the calculated user-variable in subsequent jump checks.
Say you wanted to work with speeds 3, 9 and 20 (random ascending values on my part).
Velocity^2 thresholds become: 3*3=9 ; 9*9 = 81; 20 * 20 = 400
Works equally well in three and two dimensions. I'm going to write out 2d with an extra "CheckFloor", since you mentioned walk and run.
2d:
Code: Select all
UnknownState:
PLAY O 4 A_CheckFloor("GroundVelocityState") // O represents a flying/falling state, airborne; if you want it.
loop
GroundVelocityState:
PLAY A 0 A_JumpIf(velx * velx + vely * vely > 400, "RUN")
PLAY A 0 A_JumpIf(velx * velx + vely * vely > 81, "Fast")
PLAY A 0 A_JumpIf(velx * velx + vely * vely > 9, "Slow")
// Crawl: (label not required)
/* INSERT CODE EXTREME SLOWNESS and TOTAL STILLNESS */
goto UnknownState
RUN:
/* INSERT CODE MAXIMUM SPEED */
goto UnknownState
Fast:
/* INSERT CODE HIGH SPEED */
goto UnknownState
Slow:
/* INSERT CODE LOW SPEED */
goto UnknownState
If you want distinct graphics for the different states, insert frames with graphics and non-0 duration in each state. If not, replace all calls of "goto UnknownState" with a call to a new state which shows graphics and passes some time. As it is, this code is an infinite 0-delay loop. (Unless the actor is in the air, in which case it works until he lands.)
Performance: It may, or may not (I just don't know) be more efficient for the CPU, if you define a user variable and assign "velx * velx + vely * vely" to it at the beginning of the "UnknownState" in my example. Use the calculated user-variable in subsequent jump checks.
Re: The "How do I..." Thread
Hmmmhmm, I Know, I tried doing that, but it'd be handy if I knew the player's speed/velocity, fun fact is, it seemed to only work when the player is strafing while running forward/backward...
I'll see what I can get.
I'll see what I can get.
Re: The "How do I..." Thread
Do you mean that you want to use the actual player velocity (as opposed to the velocity to the power of two) for some purpose? I don't see what you would need it for, so I'm not sure if I understand you correctly.but it'd be handy if I knew the player's speed/velocity
The best reason for "monitoring" code in a player class to fail would be unmanageable state jumps. I tested an implementation of my example, which works well, but not if I hold fire. It just logs velocity*velocity and its assessment of that movement (run, jog, walk, crawl).
EDIT: Added player velocity test with two classes. Internal and external monitoring of velocity. Logs velocity^2 and its assessment of that speed. External monitoring is based on missile/givetotarget/custominventory-hack, to stay purely in decorate.
- Attachments
-
PlayerVelocityTest.pk3
- (1.34 KiB) Downloaded 20 times
- merlin86
- Posts: 154
- Joined: Tue Jan 29, 2008 4:02 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11 Pro
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: The "How do I..." Thread
Hope that's it the right place. 
How can I make with acs,an armor with rechargeable shields like Halo?
Because i don't find anything about this.
Thank you

How can I make with acs,an armor with rechargeable shields like Halo?
Because i don't find anything about this.
Thank you
Re: The "How do I..." Thread
You can do it in decorate, atleast thats how i did it for the rechargeable shields (armor) in the fighter levels in killian read....basically I put a give inventory in all the cycles of movement and still states....you may have to play around with the timing and stuff, but its pretty easy to do....merlin86 wrote:Hope that's it the right place. :)
How can I make with acs,an armor with rechargeable shields like Halo?
Because i don't find anything about this.
Thank you
Re: The "How do I..." Thread
I have an editing question. I decided to make a random spawner for the Doom gore effects and a number of the gore effects that hang from the ceiling do not hang at the proper level. They seem to be hovering below the ceiling or too high. I'm not a very good programmer and am pretty much at the level of monkey see monkey do. I'm trying to teach myself but I seem to be caught on this bug. Any advise?