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
Andie
Posts: 53
Joined: Sun May 19, 2013 3:33 pm

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

Post by Andie »

cocka wrote:Here is an example wad:
transferlights.wad
I have rectangular sector A. There's a 3d floor B which appears at A, and is a lamp hanging from the ceiling; the room is very dark. Now, I need to make the floor of that 3d floor B bright, because it's a working lamp, but I don't need the floor of A to be bright, because it messes with dynamic lighting in the room. If I change brightness of 3d floor B, floor of A would be bright too, which is inappropriate. I checked out your example, but was unable to do that still. Can the trick with tranferring wall light do that? What is a line id, a number that Doom Builder shows at the bottom of screen on hovering the line, like "linedef57"?
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

but was unable to do that still.
Then I can't help you.
Can the trick with tranferring wall light do that?
What? It just transfers light from the lightest sector to the walls of the platform.
What is a line id, a number that Doom Builder shows at the bottom of screen on hovering the line, like "linedef57"?
It just stands for executing line actions. Such as: Setlinetexture, setlineblocking, setlinespecial, setlinemonsterblocking, Teleport_Line, Line_SetTextureOffset, Line_SetBlocking, Line_SetTextureScale, Line_AlignCeiling, Line_AlignFloor, TranslucentLine, Polyobj_ExplicitLine
Fallentemp
Posts: 28
Joined: Sun Dec 30, 2012 10:58 pm

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

Post by Fallentemp »

I'm in need of a little assistance, is there a way to make a monster stop firing after a certain amount of shots are fired? say like my pistol guy shoots 7 times and then stops for a few moments and then starts to fire again for another 7 rounds, if so how would i go about that?

i would think a reload script would work for a Monster but i have no idea how to go about that, at the few wads i looked at that had such features it was far too messy to decipher on how it was done.
User avatar
cortlong50
Posts: 753
Joined: Mon Jun 24, 2013 7:12 pm
Location: UT-WA

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

Post by cortlong50 »

how do i get the colors from my palette to use on sprites? i cant export it.
User avatar
DrDoctor
Posts: 132
Joined: Fri Nov 06, 2009 5:04 am

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

Post by DrDoctor »

I'm trying to recreate the secret level condition from Doom 64 map "Cat and Mouse" where you kill the cyberdemon within a certain time limit, a room with the secret level switch opens.

This is the code I got thus far
Spoiler:
What I'm aiming for is if you kill the cyberdemons (4 of them) within a time limit, the secret room is revealed. If they are killed outside the time limit, the map just ends. Right now the latter happens regardless of the time limit. If anyone knows how to fix this, I'd appreciate it. The print functions were just there for testing purposes.
User avatar
Cardboard Marty
Posts: 1149
Joined: Sat Oct 23, 2004 8:29 am
Graphics Processor: nVidia with Vulkan support
Location: Robot Mountain
Contact:

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

Post by Cardboard Marty »

Fallentemp wrote:I'm in need of a little assistance, is there a way to make a monster stop firing after a certain amount of shots are fired? say like my pistol guy shoots 7 times and then stops for a few moments and then starts to fire again for another 7 rounds, if so how would i go about that?

i would think a reload script would work for a Monster but i have no idea how to go about that, at the few wads i looked at that had such features it was far too messy to decipher on how it was done.
Hey look, a question I can answer! The easiest way to do this is to give your monster an inventory item.

Code: Select all

      Missile:
        ZMP1 E 0 A_JumpIfInventory("AutoPistolMag",12,"Reload") // Right as the monster is about to shoot, it checks for "AutoPistolMag", which will make sense below!
        ZMP1 E 10 A_FaceTarget
        ZMP1 F 4 BRIGHT A_CustomBulletAttack(8,3,1,3)
        ZMP1 F 0 A_CustomMissile("WWPistolCasing",32,10,random(260,280)) // This is just a casing and you don't need it to have this work.
        ZMP1 E 0 A_GiveInventory("AutoPistolMag",1) // After the monster shoots, we give him an inventory item. This is counting how many shots he's fired.
        goto See
So basically, the beginning of the Missile state is checking to see if the pistol has been fired 12 times. If it has, it jumps to the reload state.

Code: Select all

      Reload:
        ZMP1 E 0 A_TakeInventory("AutoPistolMag",12) // This takes the inventory item away completely! This is really the only bit in here you need, the rest is for the "effect"
        ZMP1 E 8 A_PlaySound("919m/magout")
        ZMP1 E 8 A_CustomMissile("SpentClip1",32,10,random(260,280))
        ZMP1 D 16 A_PlaySound("919m/magin2")
        goto See
This is the code for the inventory item. You don't have to name it anything clever, so "PistolMagazine" or "Poopybutts" will do just fine.

Code: Select all

ACTOR AutoPistolMag : Ammo
{
    Inventory.MaxAmount 12
} 
I hope that helps!
User avatar
Andie
Posts: 53
Joined: Sun May 19, 2013 3:33 pm

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

Post by Andie »

cocka wrote:
but was unable to do that still.
Then I can't help you.
Can the trick with tranferring wall light do that?
What? It just transfers light from the lightest sector to the walls of the platform.
What is a line id, a number that Doom Builder shows at the bottom of screen on hovering the line, like "linedef57"?
It just stands for executing line actions. Such as: Setlinetexture, setlineblocking, setlinespecial, setlinemonsterblocking, Teleport_Line, Line_SetTextureOffset, Line_SetBlocking, Line_SetTextureScale, Line_AlignCeiling, Line_AlignFloor, TranslucentLine, Polyobj_ExplicitLine
I see, thank you, we just misunderstood each other a little there.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

DrDoctor:
if you kill the cyberdemons (4 of them) within a time limit, the secret room is revealed. If they are killed outside the time limit, the map just ends. Right now the latter happens regardless of the time limit.
Yes because if tests only once. So at the beginning you have secret = 0 and four living cyberdemons.

Code: Select all

if(thingcount(T_CYBERDEMON,0)>0 && secret==0)
So the first part of the statement will always be true AND the second one is also true here. So it prints the "bye, bye" string, waits 2 seconds and exits.

As for the other statement:

Code: Select all

if(thingcount(T_CYBERDEMON,0)>0 && secret==1)
First part will be TRUE AND the second part will be FALSE. TRUE AND FALSE will be FALSE! So the content of script 254 won't be executed.

In script 255 this won't be executed either (reason: if condition will always be true):

Code: Select all

else
{
 suspend;
}
Moreover, it doesn't make sense.

Correct version:

Code: Select all

script 254 OPEN
{
	until(ThingCount(T_CYBERDEMON,0) == 0)
	{
		delay(3);
	}
	if(secret == 0)
	{
		print(s:"duh secret is revealed dawg!");
		door_open(3,64);
	}
	else
	{
		print(s:"bye bye");
		delay(70);
		Exit_Normal(0);
	}
}
You don't need script 255.
User avatar
Ravick
Posts: 2053
Joined: Sun Aug 22, 2010 10:59 pm
Location: Tubarão, Brasil
Contact:

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

Post by Ravick »

Is it possible to turn a solid 3D floor into non-solid and vice-versa in game?
User avatar
Enjay
 
 
Posts: 27281
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

No, the floors are setup when the map starts and their solidness cannot be changed during gameplay. The usual solution is to move one floor out of the way very quickly (by moving the control sector up or down) and replace it with another one with the required properties. Of course, there are many situations where that won't be practical (e.g. when you want to change the properties of a floor while an actor is standing on it).
User avatar
DrDoctor
Posts: 132
Joined: Fri Nov 06, 2009 5:04 am

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

Post by DrDoctor »

cocka wrote:
Correct version:

Code: Select all

script 254 OPEN
{
	until(ThingCount(T_CYBERDEMON,0) == 0)
	{
		delay(3);
	}
	if(secret == 0)
	{
		print(s:"duh secret is revealed dawg!");
		door_open(3,64);
	}
	else
	{
		print(s:"bye bye");
		delay(70);
		Exit_Normal(0);
	}
}
You don't need script 255.
Cool beans, thanks.
Fallentemp
Posts: 28
Joined: Sun Dec 30, 2012 10:58 pm

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

Post by Fallentemp »

Marty Kirra wrote:
Fallentemp wrote:I'm in need of a little assistance, is there a way to make a monster stop firing after a certain amount of shots are fired? say like my pistol guy shoots 7 times and then stops for a few moments and then starts to fire again for another 7 rounds, if so how would i go about that?

i would think a reload script would work for a Monster but i have no idea how to go about that, at the few wads i looked at that had such features it was far too messy to decipher on how it was done.
Hey look, a question I can answer! The easiest way to do this is to give your monster an inventory item.
Spoiler:
So basically, the beginning of the Missile state is checking to see if the pistol has been fired 12 times. If it has, it jumps to the reload state.
Spoiler:
I hope that helps!

Thanks! you really helped a noob mapper out.
User avatar
Andie
Posts: 53
Joined: Sun May 19, 2013 3:33 pm

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

Post by Andie »

Is there a way to make a sprited Actor (a prop basically, like this butcher's knife from Blood: https://dl.dropboxusercontent.com/u/4458274/sprite.jpg) which wouldn't always face the player? I don't mean an Actor with sprite angles, maybe such thing was done using just mid textures? I should have tried them before asking probably, shame on me — just wanted to be sure before diving into all the extra work.
Last edited by Andie on Thu Aug 15, 2013 9:47 am, edited 1 time in total.
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm

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

Post by Mikk- »

Using Mid-textures is the only solution at the moment. just make the sprite into a texture and place it as a mid-texture normally. You'll have to modify the texture offsets in the map-editor for it to show at the correct height, though.
User avatar
Ghostbreed
Posts: 1114
Joined: Wed Mar 24, 2010 6:19 am

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

Post by Ghostbreed »

How do I import and use custom skyboxes?
Locked

Return to “Editing (Archive)”