The "How do I..." Thread

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

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

Postby NeuralStunner » Mon Apr 16, 2012 2:03 pm

NickPerrin wrote:How do I make a non-automatic weapon or fire mode? As in, you can't simply hold down the button to keep firing, but must press it each time you want to shoot.
Put the NOAUTOFIRE flag on the weapon, then don't provide A_Refire at the end of the Fire sequence.
User avatar
NeuralStunner
O'Neill with it.
 
Joined: 21 Jul 2009
Location: The Colonies

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

Postby NickPerrin » Mon Apr 16, 2012 2:44 pm

NeuralStunner wrote:Put the NOAUTOFIRE flag on the weapon, then don't provide A_Refire at the end of the Fire sequence.


I tried NOAUTOFIRE already , but it returns this:
"weapon.noautofire" is an unknown actor property

EDIT: Wait, figured it out. I checked gzdoom.pk3 and found the noautofire flag on the rocket launcher. What I couldn't figure out was that you need a '+' in front of it. Fixed.
User avatar
NickPerrin
 
Joined: 12 Apr 2012

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

Postby Project_Hellbane » Mon Apr 16, 2012 4:10 pm

How would I make a sprite rotate using decorate? Like pick random between 360 degrees?
User avatar
Project_Hellbane
The Double Barrel Shotgun is a Shotgun, but with two barrels. - Todd Howard
 
Joined: 27 Oct 2011
Location: The Inner Graves

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

Postby amv2k9 » Mon Apr 16, 2012 4:18 pm

Project_Hellbane wrote:How would I make a sprite rotate using decorate? Like pick random between 360 degrees?
1. Name the sprite's different angles something like AGUYA0, B0, C0, etc.
2. Code up something like this:

Code: Select allExpand view
States
{
Spawn:
 TNT1 A 0
 TNT1 A 0 A_Jump(256,"A","B","C","D","E","F","G","H")
 Wait
A:
 AGUY A 1
 Loop
B:
 AGUY B 1
 Loop
...
User avatar
amv2k9
Satanic Redux, Order & Chaos, Mutation, and Weapons of Rebellion Series Dev
 
Joined: 10 Jan 2010
Location: Southern California

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

Postby NickPerrin » Mon Apr 16, 2012 4:30 pm

I'm using A_FireCustomMissile and it's working just fine. However, It seems that every projectile the player fires with this spawns right inside the player. I'm wondering if there's a way to spawn a projectile using this action further away from the firing actor than default? (Useful for smoke, casings, rockets coming out of the tip of a barrel etc.)

I have tried some solutions. One can use TNT1 for the first few frames to make this invisible until it's in the right place and "pops in", but then your angle and pitch are not really where you want them by the time they get to the desired "pop-in" spot, and the speed may be wrong too. Alternatively, you can spawn a superfast invisible projectile that in turn spawns the slower, visible projectile, getting closer to the desired effect.

But is there a simpler way? Something that makes the projectile spawn a certain distance forward from the outset?
User avatar
NickPerrin
 
Joined: 12 Apr 2012

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

Postby Zombieguy » Mon Apr 16, 2012 5:07 pm

How come this barrel won't play its "pain" sound? Well, it plays after its death state, but that's it. It also doesn't spawn the specified objects in its pain/wound state.

Spoiler:
Zombieguy
 
Joined: 24 May 2010
Location: C:\Earth>

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

Postby FDARI » Mon Apr 16, 2012 5:17 pm

It wasn't what I had in mind when I wrote it, but some kinds of placement are really hard to do with custom missile codes might actually be achieved with A_Warp. You can use A_Warp to jump forward and then jump back. Something like this:
Code: Select allExpand view
fire: // version a) does not fire if player cannot move forward
  PLAY X 6 A_Warp(AAPTR_DEFAULT, 45,0,0,  0,  WARPF_INTERPOLATE, "InPositionToFire")
  // if you get here, the desired position was unavailable
  goto ready
inpositiontofire:
  PLAY X 0 A_FireCustomMissile("missile")
  PLAY X 4 A_Warp(AAPTR_DEFAULT, -45,0,0, 0, WARPF_INTERPOLATE | WARPF_NOCHECKPOSITION)
  // Nocheckposition means that you'll go back even if an obstruction has magically come along
  // You MAY want to avoid nocheckposition, and accept that the player was warped ahead instead, but I think not
  // ...
Code: Select allExpand view
fire: // version b) warps, fires and returns
  PLAY X 0 A_Warp(AAPTR_DEFAULT, 45,0,0, 0, WARPF_INTERPOLATE | WARPF_NOCHECKPOSITION)
  PLAY X 0 A_FireCustomMissile("missile")
  PLAY X 4 A_Warp(AAPTR_DEFAULT, -45,0,0, 0, WARPF_INTERPOLATE | WARPF_NOCHECKPOSITION)
  // ...
AAPTR_DEFAULT means "self" in this instance, making the player jump to a position 45 units ahead of itself, and then from its new position to a position 45 units behind itself (or right back whence it came). WARPF_INTERPOLATE is used to preserve original interpolation info.
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

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

Postby Apothem » Mon Apr 16, 2012 5:38 pm

Zombieguy wrote:How come this barrel won't play its "pain" sound? Well, it plays after its death state, but that's it. It also doesn't spawn the specified objects in its pain/wound state.


A wild guess would say that your pain chance isnt set on the actor. Or at least I dont see one, and I know that the barrel by default doesnt have one.
User avatar
Apothem
ACS scripting makes my head go BooM!
 
Joined: 29 Nov 2003
Location: Performing open heart surgery on an ACS compiler.

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

Postby Zombieguy » Mon Apr 16, 2012 5:47 pm

Thanks a ton! Silly me, again.
Zombieguy
 
Joined: 24 May 2010
Location: C:\Earth>

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

Postby insightguy » Mon Apr 16, 2012 10:43 pm

How do I make a block actor (For, ya know, blocking) that:

Can't deflect hit scans
Completely blocks any melee attacks and projectiles OR
(Preferably, but non necessarily due to possible limitations on the zdoom engine)
lessens the damage of melee attacks and projectiles
User avatar
insightguy
It's always the adorable one that kills you...........
 
Joined: 23 Mar 2011

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

Postby cypherphage » Tue Apr 17, 2012 7:07 am

I want to make a weapon that weakens enemies with each hit, but its seems like powerprotection doesn't stack on monsters. It seems like I can 1 or 100 compies, and only the first has any effect.
Spoiler:
User avatar
cypherphage
 
Joined: 27 Feb 2011

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

Postby oODemonologistOo » Tue Apr 17, 2012 9:43 am

How can I make a projectile go out for a few tics normally, then change its direction to the opposite of it's current ? I tried using thrustthing with angle paramater taken from decorate and put as "-angle" in the ACS, but that didn't work.
User avatar
oODemonologistOo
undecided
 
Joined: 17 Jul 2007
Location: one of the labs of hell

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

Postby cypherphage » Tue Apr 17, 2012 12:37 pm

I don't think there is any need for acs, try "A_SetAngle(angel+180)".
User avatar
cypherphage
 
Joined: 27 Feb 2011

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

Postby Snarboo » Tue Apr 17, 2012 6:10 pm

I'm trying to think of a sane way to have ammo pickups that only give the player what they need so as to avoid situations where the player wastes an ammo pickup because they are nearly at full ammo. User variables and arguments seem like the best solution, but I can't remember if CustomInventory items support that feature. I'd really like to avoid using ACS if possible.
User avatar
Snarboo
Cool Frog
 
Joined: 29 Nov 2005

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

Postby Project_Hellbane » Wed Apr 18, 2012 3:01 pm

How do you make translations?
User avatar
Project_Hellbane
The Double Barrel Shotgun is a Shotgun, but with two barrels. - Todd Howard
 
Joined: 27 Oct 2011
Location: The Inner Graves

PreviousNext

Return to Editing

Who is online

Users browsing this forum: No registered users and 3 guests