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
DoomKrakken
Posts: 3489
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

Huzzah for 500 pages! :D

Damn... got pushed to the 501st page... :(
User avatar
skaarjman
Posts: 33
Joined: Tue Mar 31, 2015 10:03 am
Location: done making ZDF free sprites

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

Post by skaarjman »

Share: gzdoom Rpg with individual username stat save. Login to load stats. Register to create username. Comming soon !
User avatar
SigFloyd
Posts: 163
Joined: Mon Feb 13, 2012 2:03 am

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

Post by SigFloyd »

Question: Is it possible for an element of a weapon sprite be affected by the player's choice of crosshair color settings? For example, the glowy bits of a rifle's sights reflect what color the player chose in ZDoom's crosshair settings. It would be awesome if it can be done.
User avatar
edward850
Posts: 5890
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

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

Post by edward850 »

Nope.
User avatar
SigFloyd
Posts: 163
Joined: Mon Feb 13, 2012 2:03 am

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

Post by SigFloyd »

Well damn, I'll look into having a few cycleable preset colors then.
User avatar
Kyle873
Posts: 667
Joined: Thu Jun 28, 2012 11:48 am
Location: Ontario, Canada

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

Post by Kyle873 »

skaarjman wrote:any way to make it shorter ?

Code: Select all

Script "item_pickup" (int itemid)
	{
		print(s:"Picked up item",d:item_ids[itemid-1]);
		if(wow_inventoryslot[0] != 0)
			{
				if(wow_inventoryslot[1] != 0)
					{
						if(wow_inventoryslot[2] != 0)
							{
								if(wow_inventoryslot[3] != 0)
									{
										if(wow_inventoryslot[4] != 0)
											{
												if(wow_inventoryslot[5] != 0)
													{
														if(wow_inventoryslot[6] != 0)
															{
																if(wow_inventoryslot[7] != 0)
																	{
																		if(wow_inventoryslot[8] != 0)
																			{
																				if(wow_inventoryslot[9] != 0)
																					{
																						if(wow_inventoryslot[10] != 0)
																							{
																								if(wow_inventoryslot[11] != 0)
																									{
																										if(wow_inventoryslot[12] != 0)
																											{
																												if(wow_inventoryslot[13] != 0)
																													{
																														if(wow_inventoryslot[14] != 0)
																															{
																																if(wow_inventoryslot[15] != 0)
																																	{
																																		Print(s:"Inventory is full.");
																																	}
																																else if(wow_inventoryslot[15] == 0)
																																	{
																																		wow_inventoryslot[15] = itemid;
																																	}
																															}
																														else if(wow_inventoryslot[14] == 0)
																															{
																																wow_inventoryslot[14] = itemid;
																															}
																													}
																												else if(wow_inventoryslot[13] == 0)
																													{
																														wow_inventoryslot[13] = itemid;
																													}
																											}
																										else if(wow_inventoryslot[12] == 0)
																											{
																												wow_inventoryslot[12] = itemid;
																											}
																									}
																								else if(wow_inventoryslot[11] ==0)
																									{
																										wow_inventoryslot[11] =itemid;
																									}
																							}
																						else if(wow_inventoryslot[10] ==0)
																							{
																								wow_inventoryslot[10] = itemid;
																							}
																					}
																				else if(wow_inventoryslot[9]==0)
																					{
																						wow_inventoryslot[9] = itemid;
																					}
																			}
																		else if(wow_inventoryslot[8] ==0)
																			{
																				wow_inventoryslot[8] = itemid;
																			}
																	}
																else if(wow_inventoryslot[7] ==0)
																	{
																		wow_inventoryslot[7] = itemid;
																	}
															}
														else if(wow_inventoryslot[6] ==0)
															{
																wow_inventoryslot[6] = itemid;
															}
													}
												else if(wow_inventoryslot[5] ==0)
													{
														wow_inventoryslot[5] = itemid;
													}
											}
										else if(wow_inventoryslot[4] ==0)
											{
												wow_inventoryslot[4] = itemid;
											}
									}
								else if(wow_inventoryslot[3] ==0)
									{
										wow_inventoryslot[3] = itemid;
									}
							}
						else if(wow_inventoryslot[2] ==0)
							{
								wow_inventoryslot[2] = itemid;
							}
					}
				else if(wow_inventoryslot[1] ==0)
					{
						wow_inventoryslot[1] = itemid;
					}
			}
		else if(wow_inventoryslot[0] ==0)
			{
				wow_inventoryslot[0] = itemid;
			}
	}

	
	
That is the most horrifying fucking thing I have ever seen.
User avatar
Kilkakon
Posts: 314
Joined: Fri Jul 09, 2004 11:53 pm
Location: Western Australia
Contact:

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

Post by Kilkakon »

Hi there guys,

I have a sword weapon that spawns a few health bonuses whenever it kills something. Currently I am doing this by giving the sword's puff a damagetype and then defining a death.damagetype on all of the enemies. This seems a rather roundabout way to go about things--is there a better alternative? The sword is using A_CustomPunch.
User avatar
epiccolton26
Posts: 53
Joined: Tue Apr 22, 2014 5:52 pm
Location: The depths of space, destroying entire solar systems

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

Post by epiccolton26 »

How would I make a basic reload function for weapons (particularly with the shotgun, as I want it to load in shell after shell, like in Doom 3)? I am making another personal mod with all the classic Doom weapons having a reload function based on their ammo give values (no special effects like recoil or shaking). Being a junior amateur at the ZDoom decoration code, I looked through other reloading weapons to see if it would help me, but right now it just looks like a crapload of complicated programming. A basic pistol and shotgun reload will help at the moment. I'll ask about the plasma rifle later.
User avatar
Kilkakon
Posts: 314
Joined: Fri Jul 09, 2004 11:53 pm
Location: Western Australia
Contact:

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

Post by Kilkakon »

Okay, very simple reload. First you need to make another ammo. Call it, for now, "AmmoUsedInClip", with a max capacity of 8, and nothing in backpacks. Make it the secondary ammo of your gun.

When you shoot, just after the firebullets, put a frame that has A_GiveInventory( "AmmoUsedInClip", 1 )

At the end of your fire frames, use A_JumpIfInventory( "AmmoUsedInClip", 8, "Reload" ). That forces a jump to reload when you've spent your clip, because each shot increases the ammo used count by one.

Then make a new state, call it "Reload", it would be similar to fire but instead of firing bullets, just have an animation and put in A_TakeInventory( "AmmoUsedInClip", 8 ).

Very basic version, but hey, just something to start you off.
User avatar
epiccolton26
Posts: 53
Joined: Tue Apr 22, 2014 5:52 pm
Location: The depths of space, destroying entire solar systems

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

Post by epiccolton26 »

Ok, I did what you said, but when I fire from the clip, the ammo goes to 9, then to 10, and IMMEDIATELY goes down to 0. Then, I can't use the weapon anymore because it (seems to) doesn't know what ammo to withdraw from. Here's my code so far:
Spoiler:
User avatar
Kilkakon
Posts: 314
Joined: Fri Jul 09, 2004 11:53 pm
Location: Western Australia
Contact:

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

Post by Kilkakon »

Okay, try switching a few lines around like this:

Code: Select all

Fire:
PISG A 4
PISG B 0 A_GiveInventory("PistolClip", 1) // moved here so the ammo is given at same time as bullets being fired
PISG B 6 A_FireBullets(5, 0, 1, 5, "BulletPuff")
PISG C 4
PISG B 5
PISG A 0 A_JumpIfInventory("PistolClip",10,"Reload")
PISG A 0 A_ReFire // moved here so the ammo check still happens while holding fire button down
Goto Ready
Flash:
PISF A 7 Bright A_Light1
Goto LightDone
PISF A 7 Bright A_Light1
Goto LightDone
Reload:
PISG B 0
PISG B 0 A_PlaySound( "weapons/sshotl", CHAN_WEAPON ) // epic reloading sound
PISG B 20 // this frame added so there's a reloading delay 
PISG B 0 A_TakeInventory("PistolClip",10)
Goto Ready
Spawn:
PIST A -1
Stop
If you still have issues, you can add Weapon.AmmoUse2 0 and Weapon.AmmoGive2 0. I'm not at my Doom PC at the moment so going off memory sorry~
User avatar
VGA
Posts: 506
Joined: Mon Mar 28, 2011 1:56 am

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

Post by VGA »

Inside the Eternal resource pack I got from realm667 there are some transparency gfx inside T_START and T_END markers. Do I need this stuff or should I delete them like the colormaps? I'm making a vanilla/limit-removing project.
User avatar
Kappes Buur
 
 
Posts: 4184
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

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

Post by Kappes Buur »

VGA wrote:Inside the Eternal resource pack I got from realm667 there are some transparency gfx inside T_START and T_END markers. Do I need this stuff or should I delete them like the colormaps? I'm making a vanilla/limit-removing project.
I guess you want to bring lumps from retres.wad into your own map, so that a separate resource wad is not needed.
You can delete those T_ markers and lumps in between.
User avatar
xenoxols
Posts: 2134
Joined: Mon Mar 18, 2013 6:08 pm
Preferred Pronouns: She/Her
Location: Behind you

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

Post by xenoxols »

Is there a simple way to make a mouse driven shop easily? I've taken a look at psychic's acs and it is way too long for me.
User avatar
edward850
Posts: 5890
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

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

Post by edward850 »

Psychic doesn't have a mouse interface.
Granted, Psychic also can actually be sanely played with any type of input, so that's hardly a problem. ;)
Locked

Return to “Editing (Archive)”