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
insightguy
Posts: 1730
Joined: Tue Mar 22, 2011 11:54 pm

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

Post by insightguy »

DoomKrakken wrote:There are various ways that can happen. The most common of which is that the XF_HURTSOURCE flag in the A_Explode function (which is set by default) isn't cleared. To clear that, you'd put a 0 in the "flags" parameter.

But I don't know if that's the case. Could you post some code? That'd really help us diagnose the problem sooner...
This did it, thanks!
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Cherno wrote:no matter if it's true or false, the code doesnt seem to work.
Be more specific - what happens when you spawn that actor?

And in your case, the CVAR needs to be server, since the caller isn't a player.
User avatar
Cherno
Posts: 1311
Joined: Tue Dec 06, 2016 11:25 am

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

Post by Cherno »

The JumpIf part is completely ignored, it just plays the normal Spawn state.


Edit: Nevermind, it is working now. I'm not sure what went wrong but changing the CVAR to server again did the trick.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

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

Post by Apeirogon »

I need thrust actor in one of the randomly taken direction, left-right-up, inside anonymous function.
How do i make so?
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

Do you have code for us to work with? It'll be hard coming up with code completely tailored to you if we don't see where you want to go with this...
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

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

Post by Apeirogon »

Its half done and in future may be rewrited/slightly changed when i start balancing monster.
Spoiler:
I wish insert in second part of if/else block, where A_JumpIfCloser(456, "null"), previous version of attack
Spoiler:
User avatar
Ryuhi
Posts: 368
Joined: Tue Feb 21, 2017 11:00 pm

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

Post by Ryuhi »

Is there any way to apply thrust to a non-shootable actor (namely pickups?) Haven't had any luck finding anything, and that flag seems to be the key (aside from combos that contain it)
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

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

Post by Apeirogon »

Define mass of pickup?
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

Maybe give them a ThrustThing action, defined within the pickup's definition, under its Spawn state.

Ok, so I've heard of being able to define/use an array of pointers in ZScript. Does anyone know how I can do that?
User avatar
cambertian
Posts: 344
Joined: Thu May 07, 2015 4:24 pm
Graphics Processor: nVidia with Vulkan support
Location: New England Area, USA

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

Post by cambertian »

I'm making a mod that operates on health points instead of a health percent. I've already figured out most of the hard stuff - how to make it so damage is only dealt in multiples of 10, etc. - but I want armor to work in a specific way.
Instead of blocking a percent of damage and dissipating by a percent, I want it to block X points of damage before dissipating by 1 point. (So if the player takes, say, 3 points of damage, his armor goes down by a point.)

However, that's not my current trouble either - though I will get back to it! Instead, I'm having trouble with making a new Armor class to accommodate this behavior. I can't seem to access one of the item's custom properties:

Code: Select all

Script error, "health.pk3:zscript/hp/armor.zc" line 25:
Unknown identifier 'protectAmount'
I tried "invoker" as well, just in case, but it still errors out.

Also, if you can check some of my logic, that'd be great!

Code: Select all

class CustomBaseArmor : Inventory
{
	int protectAmount; // Amount of HP to protect before going down a point
	
	property ProtectionAmount: protectAmount;
	
	Default
	{
		-INVENTORY.INVBAR
		+INVENTORY.IGNORESKILL
		+INVENTORY.UNTOSSABLE
		+INVENTORY.PERSISTENTPOWER
		+INVENTORY.HUBPOWER
		+INVENTORY.ISARMOR
		Inventory.Amount 10;
		CustomBaseArmor.ProtectionAmount 2;
	}
	
	override bool ShouldStay() // To keep the player from picking up more than one shield
	{
		let lastShield = FindInventory("CustomBaseArmor", true);
		
		if (lastShield != NULL)
		{
			if ((protectAmount <= lastShield.protectAmount) && (Amount <= lastShield.Amount)) // Make sure the player doesn't get a bad shield either
			{
				return true;
			}
			
			RemoveInventory(lastShield);
		}
		
		return false;
	}
}
User avatar
UltimateSavage
Posts: 1
Joined: Tue Oct 17, 2017 12:54 am

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

Post by UltimateSavage »

I have found resources from NAM and wanted to use them for the own project.
But I have faced a problem. All graphics are black-and-white.
I try to change a color palette, but i can't found NAM palette. I have chosen Duke Nukem palette, but nothing has occurred too, sprites are still black-and-white.

What needs to do, to make them color, like in original game?

Image
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

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

Post by Gutawer »

cambertian wrote: However, that's not my current trouble either - though I will get back to it! Instead, I'm having trouble with making a new Armor class to accommodate this behavior. I can't seem to access one of the item's custom properties:

Code: Select all

Script error, "health.pk3:zscript/hp/armor.zc" line 25:
Unknown identifier 'protectAmount'
You need to cast lastShield to the CustomBaseArmor type by doing:

Code: Select all

let lastShield = CustomBaseArmor(FindInventory("CustomBaseArmor", true));
Otherwise FindInventory returns an Inventory type, which doesn't have a field called protectAmount, therefore the compiler errors out. By telling the compiler "Hey, this Inventory item is going to be a CustomBaseArmor", it knows that the protectAmount field exists on the item, and the code can successfully compile.
User avatar
Clay
Posts: 190
Joined: Fri Sep 22, 2017 9:52 pm
Location: That one secret you always miss.
Contact:

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

Post by Clay »

Is there a way to still have a sky while I am using a texture/flat with transparency on my ceiling? The transparent part only shows black.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

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

Post by Nevander »

UltimateSavage wrote:I have found resources from NAM and wanted to use them for the own project.
But I have faced a problem. All graphics are black-and-white.
I try to change a color palette, but i can't found NAM palette. I have chosen Duke Nukem palette, but nothing has occurred too, sprites are still black-and-white.

What needs to do, to make them color, like in original game?
Try changing the base resource to the NAM.GRP.
User avatar
Cherno
Posts: 1311
Joined: Tue Dec 06, 2016 11:25 am

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

Post by Cherno »

SomeOtherDoomGuy wrote:Is there a way to still have a sky while I am using a texture/flat with transparency on my ceiling? The transparent part only shows black.
You can make the sky as usual and then place a 3D sector of the transparent texture as the ceiling underneath it.
Locked

Return to “Editing (Archive)”