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.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

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 5:01 am, edited 1 time in total.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

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

Post by FDARI »

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 [wiki]Definitions[/wiki]. 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
User avatar
Reactor
Posts: 2091
Joined: Thu Feb 03, 2011 6:39 pm
Location: Island's Beauty, Hungary

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

Post by Reactor »

Thanks for the reply, I've modified the properties of the line right away. It's looking good!
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

how do you build poly objects in doom builder 2?

and how do you make "hitscan" projectiles without them firing the wrong way?
User avatar
Tapwave
Posts: 2096
Joined: Sat Aug 20, 2011 8:54 am
Preferred Pronouns: No Preference
Graphics Processor: nVidia with Vulkan support

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

Post by Tapwave »

insightguy wrote: and how do you make "hitscan" projectiles without them firing the wrong way?
Huh? They fire in your back or something?
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

insightguy wrote:how do you build poly objects in doom builder 2?
[wiki]PolyObjects[/wiki]
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

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
User avatar
ChronoSeth
Posts: 1631
Joined: Mon Jul 05, 2010 2:04 pm
Location: British Columbia

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

Post by ChronoSeth »

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

What is the "wrong way"?
User avatar
hideousdestructor
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 hideousdestructor »

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)
User avatar
cypherphage
Posts: 213
Joined: Sun Feb 27, 2011 2:54 am

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

Post by cypherphage »

Hitscans and bullets aren't the same thing. Posting the code you think is in error and describing the unintended behavior would help.
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

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?
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

http://zdoom.org/wiki/A_FireBullets

This might be helpful for this problem. Have you used that?
User avatar
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

I'm looking for projectile bullets, not hitscan. nice try anyway
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

Oh, I see.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

I guess you can use the angle and pitch parameters in [wiki]A_FireCustomMissile[/wiki] and [wiki]A_CustomMissile[/wiki] 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))
Locked

Return to “Editing (Archive)”