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.

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

Postby Remmirath » Sun May 10, 2009 3:42 pm

I vote for 1 and 4

The 4th one is: <!>
User avatar
Remmirath
Slowest mapper on Earth
 
Joined: 23 Dec 2007
Location: My house
Discord: Remmirath#0424
Twitch ID: TheRemmirath
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby bagheadspidey » Sun May 10, 2009 7:26 pm

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
bagheadspidey
 
Joined: 20 Oct 2007

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

Postby Ceeb » Sun May 10, 2009 8:26 pm

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 allExpand view
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
Ceeb
Official Idoit Of ZDoom
Banned User
 
Joined: 11 Jun 2008
Location: Castle Wut

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

Postby Remmirath » Mon May 11, 2009 4:55 am

Maybe the delay is too short. Try to increase it at least to 15 tics.
User avatar
Remmirath
Slowest mapper on Earth
 
Joined: 23 Dec 2007
Location: My house
Discord: Remmirath#0424
Twitch ID: TheRemmirath
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby carlcyber » Mon May 11, 2009 5:16 am

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 allExpand view
int woodhealth = 20;

script 3 (void) //Wood barrier is destroyed
{
    if(script3stopper == 0)
    {
        if(checkweapon("GasChainsaw"))
        {
            if(--woodhealth == 0)
            {
                script3stopper = 1;
                // ...
            }
        }
        else
        
{
            // ...
        }
    }
}
 
carlcyber
 
Joined: 27 Jan 2005

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

Postby ShailsTSPT » Mon May 11, 2009 7:14 am

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
ShailsTSPT
 
Joined: 28 Oct 2008

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

Postby Remmirath » Mon May 11, 2009 9:04 am

Copy this in the Doom Builder script editor:

Code: Select allExpand view
#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.
User avatar
Remmirath
Slowest mapper on Earth
 
Joined: 23 Dec 2007
Location: My house
Discord: Remmirath#0424
Twitch ID: TheRemmirath
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby ShailsTSPT » Mon May 11, 2009 10:10 am

Thanks Morpheus that really helped me!
ShailsTSPT
 
Joined: 28 Oct 2008

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

Postby Ceeb » Mon May 11, 2009 12:06 pm

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 allExpand view
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
Ceeb
Official Idoit Of ZDoom
Banned User
 
Joined: 11 Jun 2008
Location: Castle Wut

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

Postby Ryan Cordell » Mon May 11, 2009 12:43 pm

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
Ryan Cordell
PDA Man
 
Joined: 06 Feb 2005
Location: Capital of Explodistan
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia (Modern GZDoom)

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

Postby bagheadspidey » Mon May 11, 2009 2:38 pm

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.
User avatar
bagheadspidey
 
Joined: 20 Oct 2007

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

Postby ShailsTSPT » Wed May 13, 2009 9:12 am

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?
ShailsTSPT
 
Joined: 28 Oct 2008

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

Postby Remmirath » Wed May 13, 2009 11:17 am

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
Remmirath
Slowest mapper on Earth
 
Joined: 23 Dec 2007
Location: My house
Discord: Remmirath#0424
Twitch ID: TheRemmirath
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby ThatOneZDoomer » Mon May 18, 2009 6:21 am

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 allExpand view
      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.
User avatar
ThatOneZDoomer
Still too lazy for a new avatar
 
Joined: 01 Jun 2008
Location: Where I'm at of course

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

Postby Henderick » Mon May 18, 2009 9:07 am

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.
Henderick
Hmm......
 
Joined: 08 Mar 2009
Location: Germany

PreviousNext

Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 1 guest