Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
baja blast rd.

*** The "ask a miscellaneous editing question" thread ***

Recommended Posts

I don't actually know if/how subdirectories of the "sounds" folder in a pk3 should be referred to by SNDINFO, so I might have given wrong info in that regard, in that case sorry. Maybe the subdirectory actually shouldn't be specified - though if that's really the case, I wonder what happens if you place multiple different but same-named sound files into different subdirectories - if such a sound appears in SNDINFO, how is the engine supposed to know which one to use?

Agentbromsnor said:

If I rename the lump-name to "Weapons/SLASH"

I suppose you mean that you put a sound named "SLASH" into a subdirectory called "Weapons", because a slash character ("/") can't appear inside a file name.

Share this post


Link to post

Ah yes. I was just clearing that up. :)

I'm actually not sure what would happen if I spread the same sound lump over several sub-directories... I assume the engine would play them all at the same time?

Share this post


Link to post
Agentbromsnor said:

I assume the engine would play them all at the same time?

I'm pretty sure the engine wouldn't do that. But feel free to test it (ideally with different-sounding but same-named sounds in different subdirectories). I can't predict the result.

Share this post


Link to post

Another strange issue that I have is with the animation frames. This isn't a huge problem, but a bit of an oddity that I would like to understand better.

I have this player animation state:

		SwordAttackR:
			POWA D 3
			POWA E 3
			POWA F 3
			TNT1 A 0 A_TakeInventory("SwordDummy", 1)
		Goto see
This basically defines the attack animation of my player, using a dummy actor.

My weapon's fire-state looks like this:
		Fire:
			TNT1 A 0 A_JumpIfInventory("SwordDummyLeft", 1, "FireLeft")
			TNT1 A 0 A_GiveInventory("SwordDummy")
			TNT1 A 6
			TNT1 A 0
			{
				A_FireBullets(270, 0, -1, 1, 0, FBF_EXPLICITANGLE | FBF_NORANDOM, 30);
				A_PlaySound("SLASH");
			}
			TNT1 A 6
			TNT1 A 0 A_ReFire
		Goto Ready
As you can see, I used two empty frames with a duration of 6, adding up to 12 tics. However, the player animation uses three frames with each a duration of 3, adding up to 9, but if I lower either duration of the empty frames in my weapon's fire-state, the fire-state becomes too fast.

Another thing to mention is that whenever I start to press the fire-button in-game, the first attack-animation cycle seems more delayed than the ones proceeding it, and I can't figure out why. I read about the "NoDelay" flag in DECORATE; could that possibly help?

Share this post


Link to post
scifista42 said:

EDIT2: I'm not so sure anymore how sounds in subdirectories should be treated by SNDINFO, correct me if I said anything wrong.


Depends on whether you use a short name or a long name.

WHAT IS A SHORT NAME?

As you know, a wad lump's name can only be up to 8 characters long. Nine or more is not possible. A DOS-like extension isn't possible either. Eight characters, that's all.

On the other hand, in a ZIP, you can have a file named adirectory/asubdirectory/anothersubdirectory/reallysuperlongfilenamejustbecausewhynotlol.ahahahaevenmyextensionislong.

So in a ZIP, you get two possible names for a resource: the short name that mimics WAD restrictions (eight characters max, no extension, no path) and the long name. So the short name for the above example is just REALLYSU. For simplicity I'll use lowercase for long names and upper case for short names, but that's not an actual requirement.

Some examples:

textures/bob.png ==> BOB
textures/subdirectory/another/bobo.png ==> BOBO
textures/subdirectory/bobo.png ==> BOBO
bobonobobo.png ==> BOBONOBO
bobonobo.png ==> BOBONOBO

Notice that it's possible for several different files to have the same short name! (In fact it's also possible for several different files to have the same long name, but most ZIP utilities won't let you do that.)

Now there's the question of namespaces.

WHAT IS A NAMESPACE?

Read the wiki, but to make things simple, the namespace is the first directory -- stuff in the sounds directory (even in a subdirectory) are in the sounds namespace.

Now let's get back to long and short name. If you specify a short name, ZDoom will search for the first file that has that short name inside the appropriate namespace. If you want a texture named BOBO, it might find the second or the third example.

On the other hand, if you specify a long name, ZDoom will not look in the namespace. If you ask for subdirectory/bobo.png it won't find it because you forgot to give the full path, you should have used textures/subdirectory/bobo.png.

Share this post


Link to post
Agentbromsnor said:

As you can see, I used two empty frames with a duration of 6, adding up to 12 tics. However, the player animation uses three frames with each a duration of 3, adding up to 9, but if I lower either duration of the empty frames in my weapon's fire-state, the fire-state becomes too fast.

Another thing to mention is that whenever I start to press the fire-button in-game, the first attack-animation cycle seems more delayed than the ones proceeding it, and I can't figure out why.

After I looked into ZDoom's source code, I've found out that the engine apparently makes the player actor enter Melee or Missile state both when the weapon enters Fire state AND when the weapon calls A_FireBullets. Combining weapon logic and player actor logic is basically a hack, so expect gimmicky-ness like this to occur. If you want to find out for sure how exactly the engine handles automatic changes of the player actor's states, you'll have to study the source code, because the wiki apparently doesn't document this well.

Agentbromsnor said:

I read about the "NoDelay" flag in DECORATE; could that possibly help?

No.

Share this post


Link to post

That is very unfortunate... So I take it there isn't any way to get around this? I can deal with the frame duration thing, since it is working fine as it is, but that delay that occurs whenever the player first starts attacking is quite annoying and it disrupts the flow.

Perhaps I can make a short private YouTube video of my game to demonstrate it in action.

Share this post


Link to post

I think it'd be possible to get around it by multiple dummy inventory items and A_JumpIfInventory checks performed at the right places. It'd probably have to be more complicated that what you currently have. One possible idea: Make the weapon give a particular dummy inventory item at the beginning of its Fire state and take it away at the end of its fire state, then call A_JumpIfInventory every tic in the player actor's See animation to make him jump into his Melee or Missile state if he has this dummy item, but also call A_JumpIfInventory at the beginning of the player actor's Melee/Missile animations to make him jump back to See state if he doesn't have the dummy item. This kind of multi-check might help against the automatic state changes performed by the engine, but maybe it'll have to be even more complicated that the idea I've described here (for example requiring multiple dummy items given and taken at different times during the weapon's animation) in order to work alright and be foolproof.

EDIT: A potentially even better idea: Try to make your player character not to have any Melee and Missile states (just name them differently, and if your player class inherits from another class that defines them, you have to undefine them using "<statename>: stop") - if it works (if the engine accepts a player class without Melee and Missile states), the engine would not perform any automatic state changes to these states, so that you'll have to code these changes via A_JumpIfInventory by yourself, but at least you'll not be bothered by the automatic changes happening when you don't want them to (which, in case of your special player/weapon logic, would probably actually be helpful).

Share this post


Link to post

I'm already not using Melee or Missile states! I'm using custom states for the player's attack animations.

but also call A_JumpIfInventory at the beginning of the player actor's Melee/Missile animations to make him jump back to See state if he doesn't have the dummy item


How do you check if the player doesn't have a specific item using A_JumpIfInventory? Unless I'm misreading...

I did change it just now so that the weapon's dummy item is taken away at the end of both "Fire" states (left and right). It still has the same delay at the start, for now.

Edit: Wait... I just changed the left-facing "fire" state to also remove the dummy item at the end, and the delay seems to be gone now... I'll have to do some debugging to be sure.

Share this post


Link to post
Agentbromsnor said:

How do you check if the player doesn't have a specific item using A_JumpIfInventory?

First, here is a pseudocode that demonstrates how to check if the player DOES have a specific item, and if so, jump to an arbitrarily placed state called Player_Has_The_Item_State:

TNT1 A 0 A_JumpIfInventory("Some_Item",1,"Player_Has_The_Item_State")
... // Animation that will be executed if the player doesn't have the item

Unrelated_States_Can_Be_Here:
... // Unrelated animations can be here

Player_Has_The_Item_State:
... // Animation that will be executed if the player has the item
Now, a modification of the same pseudocode to check if the player DOESN'T have a specific item, and if so, jump to an arbitrarily placed state called Player_Does_Not_Have_The_Item_State:
TNT1 A 0 A_JumpIfInventory("Some_Item",1,"Player_Has_The_Item_State")
goto Player_Does_Not_Have_The_Item_State
Player_Has_The_Item_State:
... // Animation that will be executed if the player has the item

Unrelated_States_Can_Be_Here:
... // Unrelated animations can be here

Player_Does_Not_Have_The_Item_State:
... // Animation that will be executed if the player doesn't have the item
It's that simple!

Share this post


Link to post

Is there a DECORATE function that lets you check the player's velocity? I'd like to make a custom "running"-state, and it seems like this is the best way to do it. I think I've seen a DECORATE function before that lets you do this, but I can't remember it, and I couldn't find it on the ZDoom wiki (yet).

Share this post


Link to post

Thanks. I actually thought of an alternative just now as well.

I could use GetPlayerInput to determine if the player is pressing the run-key, in combination with the walking variable I'm already using.

Share this post


Link to post

I'm running into a very small technical issue with GZDoom it seems...

Whenever I jump and use my weapon in my platform-gamae, it normally animates fine, but sometimes it just doesn't animate whenever I jump and attack. It's not very frequent (around 4 times out of 10, I would say) but it's still frequent enough to annoy me.

There is no "jump" state in my game (yet), so there's no conflict there either. Is this normal?

Share this post


Link to post

Hey there. I have a lift that raises (fast) once you walk over a line on the actual lift platform. Now that's the one that rises to the next highest floor but for some reason it also moves the ceiling the same amount, making it more of an elevator. How can I just get a normal lift working that doesn't push the walls and ceiling up?

Share this post


Link to post

I'm not sure if this technically counts but how do you guys make your sprites, like for guns, items, monsters, etc.? I could use some spriting tips on making sprites look good.

Share this post


Link to post
Agentbromsnor said:

I could use GetPlayerInput to determine if the player is pressing the run-key, in combination with the walking variable I'm already using.

Remember that a player using a controller or autorun doesn't actually need a run key at all. Doom doesn't actually have a run function internally, and doesn't need to know it exists to move the player fast (in fact traditionally it doesn't). It's simply a keyboard input modifier. If you want to check if a player is running, you're better off checking their analogue inputs (<=6400 is normal, >6400 is "running"), especially as a controller can provide any value up to 12800 at all.

Share this post


Link to post
Agentbromsnor said:

Whenever I jump and use my weapon in my platform-gamae, it normally animates fine, but sometimes it just doesn't animate whenever I jump and attack.

Is this normal?

It might be a flaw in your design of the player behavior, or another gimmick in the engine's hardcoded player AI. If it's the latter, the only way to find out would be to go through ZDoom's source code, but I don't feel like doing it for you anymore.

rileymartin said:

I have a lift that raises (fast) once you walk over a line on the actual lift platform. Now that's the one that rises to the next highest floor but for some reason it also moves the ceiling the same amount, making it more of an elevator. How can I just get a normal lift working that doesn't push the walls and ceiling up?

Use "Floor Raise to Next Higher Floor" instead of "Lift Raise to Next Higher Floor".

SharkLordSatan said:

I'm not sure if this technically counts but how do you guys make your sprites, like for guns, items, monsters, etc.? I could use some spriting tips on making sprites look good.

According to the words of the OP, this thread is for asking questions without making whole threads for them, and since you already have a separate thread for your topic, why don't you keep it there?

Share this post


Link to post
Edward850 said:

Remember that a player using a controller or autorun doesn't actually need a run key at all. Doom doesn't actually have a run function internally, and doesn't need to know it exists to move the player fast (in fact traditionally it doesn't). It's simply a keyboard input modifier. If you want to check if a player is running, you're better off checking their analogue inputs (<=6400 is normal, >6400 is "running"), especially as a controller can provide any value up to 12800 at all.


That's a good point, yeah. I'm already using this for moving left and right:

A_JumpIf(GetPlayerInput(INPUT_SIDEMOVE, AAPTR_PLAYER1) < 0, "MovingLeft")
A_JumpIf(GetPlayerInput(INPUT_SIDEMOVE, AAPTR_PLAYER1) > 0, "MovingRight")
To my understanding, AAPTR_PLAYER1 checks the analogue input. Does this mean that running to the left would give a negative input of 6400? Sorry if this is a stupid question.

scifista42 said:

It might be a flaw in your design of the player behavior, or another gimmick in the engine's hardcoded player AI. If it's the latter, the only way to find out would be to go through ZDoom's source code, but I don't feel like doing it for you anymore.


I don't have anything related to jumping in my game yet, so I'm a bit puzzled, though I'm not ruling out any flaws in my code. I'm kind of afraid that it's an engine issue. Thanks for your help though.

Share this post


Link to post

A retarded question and a more complex one for you guys:

I'm making a short cutscene where a camera points to the marine as he picks up a phone, moves his head as he talks, etc. Can I control the sprite changes with ACS, or should I keep doing this?

ACTOR CutsceneMarine 8003
{
  height 64
  radius 1
  -SOLID
  +NOGRAVITY
  States
  {
  Spawn:
    MARI A 134 Bright // This makes it a huge pain to get the timing right though
    MARI B 280 Bright
    MARI C 340 Bright
    MARI D 140 Bright
    MARI E -1 Bright
    Stop
  }
}
Then, is there any way of me ensuring the legs in this screenshot won't clip?

Share this post


Link to post
Albertoni said:

Then, is there any way of me ensuring the legs in this screenshot won't clip?

Not really. That's a limit of using sprites in a 3D environment.

Share this post


Link to post

Can you use the SpidRefire/CPosRefir codepointers on a monster that's neither a SM nor a Chaingunner? Does the monster have to be a hitscanner?

Share this post


Link to post

@Dragonfly: Thanks!

@scifista & Gez: Ah well, time for some good old perspective tricks, since that's an advantage of a 3D environment. I kind of want this to work in both ZDoom and GZDoom.

@MaxED: Thanks for the laugh, man!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×