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
Marnetmar
Posts: 304
Joined: Tue Aug 23, 2011 3:23 pm

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

Post by Marnetmar »

I have multiple sectors and want them all to flicker simultaneously, how can I do this?
User avatar
Enjay
 
 
Posts: 27140
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

What sort of flickering do you want? Do you want the sectors all to go to a predetermined light level with each flicker or do you want a bunch of different sectors that are at different light levels already to increase/decrease their light level by the same amount but stay different to each other.

If it's the first, it's pretty easy. I would do it with a restarting script and [wiki]Light_ChangeToValue[/wiki] with a randomised delay in there so that they don't flicker at a regular time interval.

The second is a bit more complicated. I do it by having a "flickerfactor" variable and then using it like this (from one of my levels):

Code: Select all

int flickerfactor;

Script 203 OPEN
{
	flickerfactor = random (4,16);
	Light_LowerByValue (63, flickerfactor);
	delay(random(2,8));
	Light_RaiseByValue (63, flickerfactor);
	delay(random(16,50));
	Restart;
}
That will lower every sector tagged 63 by whatever number was chosen for "flickerfactor", waits for a random delay, uses the same flicker factor to increase the lights back to what they were, waits another random time and then restarts. Note, you have to decrease and increase by the same value (rather than using one flicker factor for the decrease and another for the increase) otherwise the lights will get slowly brighter or duller overall depending on which random values are chosen.
Lork
Posts: 37
Joined: Sat Jan 09, 2010 11:07 pm

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

Post by Lork »

Blue Shadow wrote:You mean like sword slash and such? Not currently.
Hmm, is there a way to fake it with projectiles or something? Having fine control over the angle and how many enemies can be hit would be nice, but not essential for me. What I want to do is make a 4 directional (or 8 if I can) dash move that will stun enemies and knock them back if it connects with them, so having a lot of range or a true "swing" arc isn't really necessary.
User avatar
Ravick
Posts: 2051
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

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

Post by Ravick »

You could make it with some very 'short-living' invisible projectiles. Just spawn them in the 'arc' you want and make them disapear in 1 frame. It's a kludge, but I guess it'd work.
Warhawk
Posts: 161
Joined: Tue Mar 27, 2012 5:48 pm

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

Post by Warhawk »

How to make a weapon that shoots multiple projectiles that spread like a shotgun?
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 »

[wiki]A_FireCustomMissile[/wiki]

0-length frames let you do multiple things at once
use "frandom(minimum, maximum)" for pitch and angle

Beyond that, the wiki should be read.

Lork wrote:How do I make a melee attack that hits an arc in a specified direction rather than a fixed point in front of the player?
Shitty fake option: As above, firing one projectile after the other going down a line.

Buggy real option: Fire a dummy missile that instantly calls [wiki]A_SpawnItemEx[/wiki] before disappearing, to spawn a projectile at the location of your choice which then moves along the specified arc.
User avatar
Enjay
 
 
Posts: 27140
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

How do I make it so that when the player crosses a line, after being frozen (or before, I guess, either way, he's getting frozen :P) he is forced to look at a specific thing?

I assume that I will have to get the player's position in relation to that thing and then use [wiki]SetActorAngle[/wiki] but I don't know how to get the angle of the thing in relation to the player. Failing that, I will just for him to face south. With the setup in the map, that will work 99% or the time anyway.

As a bonus question, how could I make it so the plater turns smoothly to the correct facing rather than just snapping into position?


[edit]
Well, I'm sure that this is not going to be the best way to do this but, putting that aside, I'm dead chuffed that I was able to produce...

Code: Select all

    if (GetActorAngle(0) >0.76)
    {
    	While ((GetActorAngle(0) - 0.75) > 0)
    	{
    	SetActorAngle (0, GetActorAngle (0) - 0.01);
    	delay(1);
		}
	}

    if (GetActorAngle(0) <0.74)
    {
    	While ((GetActorAngle(0) - 0.75) <0)
    	{
    	SetActorAngle (0, GetActorAngle (0) + 0.01);
    	delay(1);
		}
	}
Simply because it works and a few years ago I was struggling to make a script where a platform and a door moved after each other. Yay! Go me or something.

Now, I wonder if I can get view pitch in here somehow? [/edit]

[edit2] Wait wut? So, no wonder I was struggling with pitch. I was messing with numbers like 0-90 and the range is actually something like -16384 to 16384. [/edit2]
Last edited by Enjay on Wed Feb 27, 2013 1:10 pm, edited 2 times in total.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Enjay wrote:I assume that I will have to get the player's position in relation to that thing and then use [wiki]SetActorAngle[/wiki] but I don't know how to get the angle of the thing in relation to the player.
All I know is that it has something to do with [wiki]VectorAngle[/wiki] (or I think anyway). Though how to utilize it, I haven't got a clue. :P
Warhawk
Posts: 161
Joined: Tue Mar 27, 2012 5:48 pm

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

Post by Warhawk »

How to make projectiles stick to monsters?
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

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

Post by amv2k9 »

Warhawk wrote:How to make projectiles stick to monsters?
The old way was a combination of the Archvile's A_Fire and +DONTFALL, along with some other tricks. If you want to see it in action, download the Bio-Pipebomb Launcher on Realm667. Now you can do it with A_Warp, which through some work could let you stick projectiles onto different parts of a monster, which you couldn't do with the A_Fire technique.
User avatar
Enjay
 
 
Posts: 27140
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

Not really a "how do I" but not worth its own thread. I know that there has been some restrictions on sector heights and step-ups. So, is a sector with floor -4224 and ceiling 1792 (total height 6016) OK? The biggest stepup is about 1600. Is that OK?

All in ZDoom Hexen format.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Enjay wrote:I know that there has been some restrictions on sector heights and step-ups.
You're referring to this and this, I presume?

I made a sector with that height, and didn't encouter any oddities. So I guess ZDoom doesn't suffer from this "limitation".
User avatar
timmyr0x0r
Posts: 200
Joined: Sat Mar 27, 2010 5:37 am

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

Post by timmyr0x0r »

This is super n00bey, but how do I use portals correctly again?
I am trying to reproduce the Non-euclidian geometry trick from that secret Duke Nukem 3d level (the "making two complete turns of the circular room to be back at the start" trick) but no results for now.
Attachments
Hmmmm....gif
User avatar
Enjay
 
 
Posts: 27140
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

Blue Shadow wrote:
Enjay wrote:I know that there has been some restrictions on sector heights and step-ups.
You're referring to this and this, I presume?

I made a sector with that height, and didn't encouter any oddities. So I guess ZDoom doesn't suffer from this "limitation".
Thanks for the reply. I've tried the heights too and not experienced any problems. So it seems OK but I was just a little worried that somehow it might not fail massively but create little oddties (such as the ones you can get where very large maps go outside a certain coordinate). However, like I said, it seems OK and with your trial backing me up, I can be more confident with it.
User avatar
Enjay
 
 
Posts: 27140
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

New Question - Am I correct in saying that there is no way to make a hi-res confont or to change which fonts are used in the menus?

I'm currently trying to use a HR font but the menus (especially the controls config) look odd with a HR font on the left and the regular confont on the right. :?
Locked

Return to “Editing (Archive)”