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.
Locked
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

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

Post by FDARI »

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.)
User avatar
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

Post by Ryan Cordell »

+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 :p
Sodaholic
Posts: 1959
Joined: Sat Nov 03, 2007 4:13 pm

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

Post by Sodaholic »

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.
Sodaholic
Posts: 1959
Joined: Sat Nov 03, 2007 4:13 pm

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

Post by Sodaholic »

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...
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 »

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]]]]]) 
Its the second variable.

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]]]]]]]]]) 
There doesn't *seem* to be a vertical offset for monster rail attacks; just horizontal.
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 »

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).
Drake Raider
Posts: 474
Joined: Fri Jul 18, 2008 12:27 pm

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

Post by Drake Raider »

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?
User avatar
Davidos
Posts: 329
Joined: Mon Aug 29, 2005 2:52 am

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

Post by Davidos »

=.= 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...

Code: Select all

 PLAY A 0 A_JumpIf( - - ,"SeeWalk")
User avatar
Blox
Posts: 3728
Joined: Wed Sep 22, 2010 9:35 am
Location: Apathetic Limbo

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

Post by Blox »

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.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

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

Post by FDARI »

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:

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
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.
User avatar
Davidos
Posts: 329
Joined: Mon Aug 29, 2005 2:52 am

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

Post by Davidos »

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.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

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

Post by FDARI »

but it'd be handy if I knew the player's speed/velocity
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.

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
User avatar
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

Post by merlin86 »

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
User avatar
JustinC
Posts: 416
Joined: Tue Feb 23, 2010 11:58 am

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

Post by JustinC »

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
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....
User avatar
jbb666999
Posts: 74
Joined: Sun Feb 13, 2005 6:15 am

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

Post by jbb666999 »

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?
Locked

Return to “Editing (Archive)”