## 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

oODemonologistOo wrote:This code doesn't really work properly at times, it gives me odd results and it's quite possibly because I failed to convert the angle right. How can I do it ?

Edit:
Spoiler: Dismiss this and instead see FDARI's post below

ChronoSeth wrote:Unless you're using UDMF, in which case you can set the line's tag and flags directly.

Yep, you can do that in UDMF. As a matter of fact and as far as UDMF is concerned that special doesn't even exist in that format.

However, I believe he's using hexen-format, hence why I suggested the use of the special...

Reactor wrote:I am working under GZDoom conditions with Hexen...
Last edited by Blue Shadow on Thu May 24, 2012 6:01 am, edited 1 time in total.

Joined: 14 Nov 2010

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

oODemonologistOo wrote:
Code: Select all
`TNT1 A 0 ACS_ExecuteAlways(998, 0, random(-36,36), angle)Script 998 (int angle, int firstangle){   SetActorAngle(0, angle + firstangle);}`

This code doesn't really work properly at times, it gives me odd results and it's quite possibly because I failed to convert the angle right. How can I do it ? (First part is in decorate)
For reference, check out Definitions. ACS functions either take BYTE angles (0-255), or fixed point angles (0.0-0.1).

(Byte angles: 360 degrees divides a circle in 360 parts, this divides a circle in 255 parts, but is otherwise similar.)

Decorate uses the same angles as the zdoom engine, but for decorate expressions and functions it converts to a number of degrees (0-360). In your code, the decorate expression "angle" returns a number within 360 degrees, rounded off to an integer for ACS. You need to convert this to a fixed point angle.
Spoiler: Extra descriptions if the wiki doesn't make it clear
Spoiler: modified code
Spoiler: More modified code

FDARI
Bronies eunt domus

Joined: 03 Nov 2009

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

Thanks for the reply, I've modified the properties of the line right away. It's looking good!

Reactor
The militarist

Joined: 03 Feb 2011
Location: Hungary

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

how do you build poly objects in doom builder 2?

and how do you make "hitscan" projectiles without them firing the wrong way?

insightguy
It's always the adorable one that kills you...........

Joined: 23 Mar 2011

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

insightguy wrote:and how do you make "hitscan" projectiles without them firing the wrong way?

Huh? They fire in your back or something?

terranova
Vertex Core

Joined: 20 Aug 2011
Location: What dinosaurs?

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

insightguy wrote:how do you build poly objects in doom builder 2?

PolyObjects

Joined: 14 Nov 2010

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

terranova wrote:
insightguy wrote:and how do you make "hitscan" projectiles without them firing the wrong way?

Huh? They fire in your back or something?

I've seen people complaining about them firing the wrong way. Can it just be like a normal projectile or do special things need to be added to every "bullet's" decorate

insightguy
It's always the adorable one that kills you...........

Joined: 23 Mar 2011

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

That still doesn't explain what you mean...

What is the "wrong way"?

ChronoSeth
You are totally unique... just like everyone else.

Joined: 05 Jul 2010

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

Maybe like a projectile that shoots hitscans? (In which case you have to make sure that the projectile is no longer targeting its own shooter before it itself starts shooting)

Vaecrius
Team Bad Allocation, blast off at the speed of light!

Joined: 04 Jan 2004
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia

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

Hitscans and bullets aren't the same thing. Posting the code you think is in error and describing the unintended behavior would help.

cypherphage

Joined: 27 Feb 2011

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

hold on. I wasn't thinking strait.

2 problems:

1.How do you make them less accurate/spread more? I end up getting really accurate rapid fire!

2.enemies seem to be firing the bullets in the wrong direction. why?

insightguy
It's always the adorable one that kills you...........

Joined: 23 Mar 2011

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

http://zdoom.org/wiki/A_FireBullets

This might be helpful for this problem. Have you used that?

cocka

Joined: 02 Jul 2011
Location: Hungary

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

I'm looking for projectile bullets, not hitscan. nice try anyway

insightguy
It's always the adorable one that kills you...........

Joined: 23 Mar 2011

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

Oh, I see.

cocka

Joined: 02 Jul 2011
Location: Hungary

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

I guess you can use the angle and pitch parameters in A_FireCustomMissile and A_CustomMissile with frandom to randomize the spread. Angle and pitch are in degrees if I'm not mistaken.

Code: Select all
`A_FireCustomMissile("Bullet", frandom(-5, 5), 1, 0, 0, 0, frandom(-5, 5))`