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
Remmirath
Posts: 2561
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

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

Post by Remmirath »

I vote for 1 and 4

The 4th one is: <!>
User avatar
bagheadspidey
Posts: 1490
Joined: Sat Oct 20, 2007 10:31 pm
Contact:

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

Post by bagheadspidey »

Hirogen2 wrote:So I have (1) a true-color sprite which (2) uses a color set (a limited 32 color set still) other than the Doom green for the suit. The former makes me wonder how to do translation at all on it, and for the latter, how to set up the PlayerPawn decorate definition so that gzdoom can recolor the sprite according to the player's likes.
First, Graf's Mantra (tm):
Translations on PNGs are undefined. There is no guarantee that they may work correctly.
The image will be converted to the doom palette by the engine before the translation is applied. This means (if you are still going to try this) you should use the green range from the doom palette, and translate that to your custom color of green or any other player colors. It also means if your player has a turquoise hat, it's going to get translated to blue or gray or something when the translation is applied. So to fix that, the hat would also need to be colored using the doom palette, and then translated to turquoise when the player picks his uniform color.

In other words, trying to apply translations to images not using colors from the current PLAYPAL will not work out very well, and applying translations to non-doom-format images is not officially supported.
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

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

Post by Ceeb »

Here's something I need a hand with, but doesn't warrant it's own thread.

I have a barrier that can be cut down with a chainsaw. However, it falls down immediately; I want the player to have to saw at it for a few seconds. I don't know how to do that kind of thing. :|

Code: Select all

int script3talk = 1;

script 3 (void) //Wood barrier is destroyed
{
if(script3stopper == 0)
{
if(checkweapon("GasChainsaw"))
{
script3stopper = 1;
activatorsound("woodbreak",127);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA2");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA3");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA4");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA5");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA6");
setlineblocking(1,off);
}
else
{
if(script3talk == 1)
{
script3talk = 0;
print(s:"\csA chainsaw would make quick work of this.");
}
}
}
}
User avatar
Remmirath
Posts: 2561
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

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

Post by Remmirath »

Maybe the delay is too short. Try to increase it at least to 15 tics.
carlcyber
Posts: 163
Joined: Thu Jan 27, 2005 1:04 am

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

Post by carlcyber »

Because once script3stopper == 0 and checkweapon("GasChainsaw") evaluates true, the wall falls down. You need an extra variable to simulate the health of the wall.

Code: Select all

int woodhealth = 20;

script 3 (void) //Wood barrier is destroyed
{
    if(script3stopper == 0)
    {
        if(checkweapon("GasChainsaw"))
        {
            if(--woodhealth == 0)
            {
                script3stopper = 1;
                // ...
            }
        }
        else
        {
            // ...
        }
    }
} 
ShailsTSPT
Posts: 50
Joined: Tue Oct 28, 2008 3:51 am

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

Post by ShailsTSPT »

Guys you passes through my question so here it goes again:

How do I make it so if a player presses use in a linedef it executes a script that shows a message on the screen of all the players in the game? PS: I only now that scripts go in the BEHAVIOR lump nothing more >.< know nothing about script and all that. But I may end up needing to use what im asking
User avatar
Remmirath
Posts: 2561
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

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

Post by Remmirath »

Copy this in the Doom Builder script editor:

Code: Select all

#include "zcommon.acs"

script 1 (void)
{
   print(s:"Hello World!");
}
Then assign to a linedef action 80, with the first parameter set to 1, and make it so that it can be activated by the player when he presses the Use key.
ShailsTSPT
Posts: 50
Joined: Tue Oct 28, 2008 3:51 am

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

Post by ShailsTSPT »

Thanks Morpheus that really helped me!
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

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

Post by Ceeb »

Thanks carl. I'll try that. :)

Edit:

I think I'm doing it right, but uh, how do I subtract? Here's the modified script. I've noted where I get the error. It... Makes no fucking sense to me. :bang:

Code: Select all

int woodhealth = 30;

script 3 (void) //Wood barrier
{
if(script3stopper == 0)
{
if(checkweapon("GasChainsaw"))
{
if(woodhealth == 0)
{
script3stopper = 1;
activatorsound("woodbreak",127);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA2");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA3");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA4");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA5");
delay(3);
setlinetexture(1,SIDE_FRONT,TEXTURE_MIDDLE,"WOOGA6");
setlineblocking(1,off);
}
else
{
woodhealth - 1; //this is the problem, it says there's a "missing assignment operator"
}
}
}
}
User avatar
Ryan Cordell
Posts: 4349
Joined: Sun Feb 06, 2005 6:39 am
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia (Modern GZDoom)
Location: Capital of Explodistan

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

Post by Ryan Cordell »

I think you should actually use "woodhealth--". I know that that slowly decreases the variable/integer/whatever in increments.. But I'm not sure if it can be used standalone or in a loop.
User avatar
bagheadspidey
Posts: 1490
Joined: Sat Oct 20, 2007 10:31 pm
Contact:

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

Post by bagheadspidey »

To expand on that, here's what you're trying to do in that line: subtract one from woodhealth. That means you want to assign a value to woodhealth that is one less than the current value of woodhealth. So there are different ways to write it:

woodhealth = woodhealth - 1;
woodhealth -= 1;
woodhealth--;
--woodhealth;

All four will work, but think of the last three as shortcuts for the first way of writing it. In the first case, the equals sign is an assignment operator; the variable on the left side of the equation will be assigned the value on the right side of the equation.

So what if you wanted woodhealth to be half of its previous value instead of one less than its previous value?

woodhealth = woodhealth / 2;
woodhealth /= 2;

Hopefully that helps explain why it says there is a "missing assignment operator" -- because there is. You calculated the value of woodhealth minus one but didn't assign that value to any variable.
ShailsTSPT
Posts: 50
Joined: Tue Oct 28, 2008 3:51 am

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

Post by ShailsTSPT »

Another question:
How can I make it so if I pick up a item a wall opens up with monsters? And how can I do it so if I kill ALL the monsters that came out of that wall another wall opens with more?
User avatar
Remmirath
Posts: 2561
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

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

Post by Remmirath »

There's the wiki for these kind of actions:

http://zdoom.org/wiki/ThingCount

http://zdoom.org/wiki/ACS_Execute

The first link has a clear example of what you want to achieve.
User avatar
ThatOneZDoomer
Posts: 225
Joined: Sun Jun 01, 2008 1:33 am
Preferred Pronouns: She/Her
Location: Where I'm at of course

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

Post by ThatOneZDoomer »

I have another question I don't think is worthy for a topic of it's own...

According to the wiki, when using DrawBar for health and armor, it's possible to use an inventory item to show that max that the bar will draw. Health seems to take it's max from the player, which I'm fine with, while armor seems to default to 100 max. I want the bar for armor to display over 100. Here's what I done..

Code: Select all

		DrawBar "SHIEBAR1", "SHIEBAR2", Armor BlueArmor, Vertical, 20, 169;
However, in game, the bar is always empty, but works up to 100 if I don't include BlueArmor. By inventory item, does it mean an actual item that's a subclass of inventory? While on the subject, is it possible to display an inventory item using DrawBar? I don't think I have been able to do it without getting an error before start up.
Henderick
Posts: 50
Joined: Sun Mar 08, 2009 9:11 am
Location: Germany

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

Post by Henderick »

I only have another question..
In DECORATE: For example A_Explode has "bool hurtshooter" Default: true
How can I change it to false? I get an error if changed to "false" or something like this, and 0, 1 or any other numbers don't change it.
Locked

Return to “Editing (Archive)”