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
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

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

Post by Matt »

Frustration wrote:two of the same monster in the same room and they start to attack you, the attack sound cancels the other ones out and sounds really off sync
SNDINFO

Code: Select all

$limit <name of your sound> 0
Yholl wrote:Wanted to try having you spawn with slightly better equipment the harder the difficulty was.
ACS

Code: Select all

if(GameSkill()>2) GiveInventory("Clip",100);

My question: Trying to do headshots. Imps keep aiming up, setting their own heads on fire and dying.

What is the cleanest, most spaghetti-free, easily generalizable way to prevent this?

(I'm using an A_Warp loop with a single actor rather than calling A_SpawnItemEx every frame; also, I'd like to be able to headshot a critter in the middle of its attack sequence so magically clearing the head out of the way is less than ideal)
User avatar
Ravick
Posts: 2053
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

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

Post by Ravick »

Blue Shadow wrote:It's definitely that the problem isn't in that line itself.

Do you have this line at the top of your script lump?

Code: Select all

#include "zcommon.acs"
If you do, then your copy of zdefs.acs file might be out of date and doesn't have all of the definitions/constants.
Today I was wondering that it should be something like that because it is the DoomBuilder that is not compiling the line, not GZDoom. Thanks!

But how do I update zdefs.acs? :?:
User avatar
XCVG
Posts: 561
Joined: Fri Aug 09, 2013 12:13 pm

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

Post by XCVG »

Noob question here.How do I make it so that weapons don't keep firing when you hold down the button? Like a real semi-auto; one click one shot. I thought I knew how to do this, but I tried it and the engine locked up.

Code: Select all

ACTOR MagnumPistol : Weapon 10522
{
  obituary "%o was Killed by %k's Degale."
  attacksound "weapons/pistol"
  decal BulletChip
  Weapon.SlotNumber 2
  weapon.kickback 50
  inventory.pickupmessage "Equipped Deagle"
  weapon.kickback 25
  weapon.ammotype "Clip"
  weapon.ammouse 1
  Weapon.SelectionOrder 1
  +WEAPON.DONTBOB
  +WEAPON.NOAUTOFIRE
  //weapon.ammogive 25
  States
  {
  Ready:
    PISG A 1 A_WeaponReady
    Loop
  Deselect:
    PISG A 1 A_Lower
    Loop
  Select:
    PISG A 1 A_Raise
    Loop
  Fire:
    PISG A 4
    TNT1 A 0 A_GunFlash
    PISG B 6 A_FireBullets (5.6, 0, 1, 5, "BulletPuff")
    PISG C 4 A_SetPitch(pitch-0.7)
    PISG B 5 A_ReFire
    Goto Ready
  Flash:
    PISF A 7 Bright A_Light1
    Goto LightDone
    PISF A 7 Bright A_Light1
    Goto LightDone
  Hold:
    PISG A 1 A_ReFire
    Loop
  Spawn:
    PIST A -1
    Stop
  }
}
Yes, I know that normally I should be using inheritance, but this is a placeholder for a weapon that will be basically nothing like the Doom pistol.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Ravick wrote:But how do I update zdefs.acs? :?:
Download latest version of ACC, and extract its contents into ...\[Doom Builder directory]\Compilers\ZDoom directory, replacing its contents when asked to.

Note that the latest ACC version doesn't have all of the latest definitions for the ACS functions introduced in the developement builds of ZDoom and GZDoom. But still, it should help you with your issue.
User avatar
Ravick
Posts: 2053
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

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

Post by Ravick »

Thanks a lot! :D
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

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

Post by Matt »

XCVG wrote:Like a real semi-auto; one click one shot. I thought I knew how to do this, but I tried it and the engine locked up.

Code: Select all

  Hold:
    PISG A 1 A_ReFire
    Loop
Should be

Code: Select all

  Hold:
    PISG A 1 A_WeaponReady(WRF_NOFIRE)
    PISG A 0 A_ReFire
    Goto Ready
Explanation: A_Refire, at the very start of the frame, checks to see if you're holding the fire button down: if you are, then it jumps to the start of the Hold state; if not, then it plays the frame for the given duration and then goes to the next line.

Your original code resulted in a zero-length (seemingly) infinite recursion, causing a freeze. Even had it not frozen, however, your gun would have been unable to fire or deselect as it would have been looping the hold state.

Solution: Added a 1-tic frame before the A_ReFire call, then replaced the loop with goto ready. Also added an A_WeaponReady(WRF_NOFIRE) call just to let the gun bob even if someone was holding the fire button down while moving; you might want to get rid of this if you prefer the "jerking trigger death grip" effect.
User avatar
XCVG
Posts: 561
Joined: Fri Aug 09, 2013 12:13 pm

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

Post by XCVG »

That did it, thanks!
User avatar
Ravick
Posts: 2053
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

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

Post by Ravick »

Is it possible to get the value of a line's texture offset in game?
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

Is it possible to get the value of a line's texture offset in game?
What would be the reason for that?
User avatar
mizzouSCN
Posts: 33
Joined: Mon Jul 30, 2012 3:32 pm

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

Post by mizzouSCN »

Sorry to ask again, but is it possible to get ZDoom to export anything to a .txt file? I'm doing some playtesting, and I've put in lots of neat stat-trackers (shots fired, times hit, etc) but all I can do right now is print to screen & write it down manually. It'd make everything a lot faster if it would print to .txt file. Is it possible?
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

Command line option: +logfile "log.txt"
Fallentemp
Posts: 28
Joined: Sun Dec 30, 2012 10:58 pm

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

Post by Fallentemp »

Is there a way to give the death sprites different angles? say like you move to what the side of it would be it changes to say the side of a dead body instead of the single death sprite like the vanilla monsters?

Also is there a way to make lines block hitscan attacks but not monster sight? i remember reading about it somewhere but i can't remember where.
User avatar
Ravick
Posts: 2053
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

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

Post by Ravick »

cocka wrote:
Is it possible to get the value of a line's texture offset in game?
What would be the reason for that?
Oh, I'd use in some testings here, then I did wonder if it could be a way to do that, It doesn't, I guess.

It could be usefull for some complex texture moving effects.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Fallentemp wrote:Is there a way to give the death sprites different angles? say like you move to what the side of it would be it changes to say the side of a dead body instead of the single death sprite like the vanilla monsters?
If you have rotations for it, then sure, why not. It'd be the same as having rotations for pain or attack.
Also is there a way to make lines block hitscan attacks but not monster sight? i remember reading about it somewhere but i can't remember where.
You can use [wiki]Line_SetBlocking[/wiki].
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

for some complex texture moving effects.
Then, I think you can use [wiki]Line_SetTextureOffset[/wiki] or [wiki]Scroll_Wall[/wiki] as well.
Locked

Return to “Editing (Archive)”