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 Blue Shadow » Wed May 23, 2012 10:30 pm

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.
User avatar
Blue Shadow
 
Joined: 14 Nov 2010

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

Postby FDARI » Thu May 24, 2012 2:25 am

oODemonologistOo wrote:
Code: Select allExpand view
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
User avatar
FDARI
Bronies eunt domus
 
Joined: 03 Nov 2009

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

Postby Reactor » Thu May 24, 2012 11:57 am

Thanks for the reply, I've modified the properties of the line right away. It's looking good!
User avatar
Reactor
The militarist
 
Joined: 03 Feb 2011
Location: Hungary

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

Postby insightguy » Sun May 27, 2012 7:16 am

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
insightguy
It's always the adorable one that kills you...........
 
Joined: 23 Mar 2011

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

Postby terranova » Sun May 27, 2012 7:50 am

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


Huh? They fire in your back or something?
User avatar
terranova
Vertex Core
 
Joined: 20 Aug 2011
Location: What dinosaurs?

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

Postby Blue Shadow » Sun May 27, 2012 8:04 am

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

PolyObjects
User avatar
Blue Shadow
 
Joined: 14 Nov 2010

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

Postby insightguy » Sun May 27, 2012 9:13 am

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
insightguy
It's always the adorable one that kills you...........
 
Joined: 23 Mar 2011

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

Postby ChronoSeth » Sun May 27, 2012 3:21 pm

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

What is the "wrong way"?
User avatar
ChronoSeth
You are totally unique... just like everyone else.
 
Joined: 05 Jul 2010

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

Postby Vaecrius » Sun May 27, 2012 8:23 pm

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

Postby cypherphage » Mon May 28, 2012 2:56 am

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
cypherphage
 
Joined: 27 Feb 2011

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

Postby insightguy » Mon May 28, 2012 6:22 am

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
insightguy
It's always the adorable one that kills you...........
 
Joined: 23 Mar 2011

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

Postby cocka » Mon May 28, 2012 8:39 am

http://zdoom.org/wiki/A_FireBullets

This might be helpful for this problem. Have you used that?
User avatar
cocka
 
Joined: 02 Jul 2011
Location: Hungary

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

Postby insightguy » Mon May 28, 2012 8:53 am

I'm looking for projectile bullets, not hitscan. nice try anyway
User avatar
insightguy
It's always the adorable one that kills you...........
 
Joined: 23 Mar 2011

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

Postby cocka » Mon May 28, 2012 9:01 am

Oh, I see.
User avatar
cocka
 
Joined: 02 Jul 2011
Location: Hungary

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

Postby Blue Shadow » Mon May 28, 2012 9:28 am

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 allExpand view
A_FireCustomMissile("Bullet", frandom(-5, 5), 1, 0, 0, 0, frandom(-5, 5))
User avatar
Blue Shadow
 
Joined: 14 Nov 2010

PreviousNext

Return to Editing

Who is online

Users browsing this forum: Galaxy_Stranger and 3 guests