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
LanHikariDS
Posts: 179
Joined: Tue Aug 04, 2015 11:30 pm
Location: Playing in the snow

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

Post by LanHikariDS »

Gez wrote:
LanHikariDS wrote:How do I recreate the cut sliding door function from Doom II?
https://tcrf.net/Doom_II:_Hell_on_Earth ... ding_Doors
I figure ZDoom reenables this, provided I add in GDOORF/GDOORB textures, but I don't know what linedef type it uses, if it does, as 124 registers as "Walkover, end level, secret exit", and that's not what I need. When I google it, I get Polyobjects, which isn't what i want.
No, this function was not recreated in ZDoom. If you don't want to use polyobjects to make an actual sliding door, you can try the [wiki]animated door[/wiki] effect, though you will have to provide textures for the doors at various levels of openness.

The cut "sliding door" effect is not convincing or useful for modding; it has no value except as a curiosity.
I've seen it, and I know what it looks like. I'm willing to privide my own texture, as I have to make it anyway. It's not that I want a horizontally sliding door, but one that can be shot and seen through. I know the animation would be choppy woth the Doom II one, but I don't mind
User avatar
kevansevans
Spotlight Team
Posts: 435
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support
Contact:

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

Post by kevansevans »

So I'm trying to make an arachnotron stand on the ceiling instead of moving on the floor. Everything works fine except the sprite location:

https://www.dropbox.com/s/djlity4rk6rkw ... 1.png?dl=0

After I set YScale to -1.0, the sprites show up above it's hitbox. i've looked all over to see if I can change the position of where it draws, and i really don't want to manually edit each sprite just to have an upside down enemy. Any solution?
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 »

Alrighty... finally screwing around with ACS.

I'm modding Guncaster. Again. This time, I'm attempting to make it so that the maximum amount of Tiberium cells and TNT bundles increases with every "HammerspaceCounter" obtained (which are obtained with every backpack after the first one you pick up).

I believe I found the prices and stuff that correspond to each item in the item menu. When I added the code, saved, compiled the scripts, and then ran the thing, nothing different happened. No glitches, but also no change of any kind. What am I doing wrong here?

Code: Select all

int global_shop_items_int[MAX_SLOTS][3] =
{
	{	800,	1,		1	},
	{	400,	1,		1	},
	{	500,	1,		1	},
	{	800,	1,		1	},
	{	1000,	1,		1	},
	/*Tiberium*/{	500,	16+1*CheckInventory("HammerSpaceCounter"),		1	},
	{	8000,	1,		1	},
	{	10000,	1,		1	},
	{	400,	1,		1	},
	{	4000,	8,		1	},
	{	1500,	12,		1	},
	{	3000,	10,		1	},
	/*Dynamite*/{	200,	30+3*CheckInventory("HammerSpaceCounter"),		1	}
};
EDIT: OK... I have no clue how it was able to compile this code with the stuff I added, because when I tried to do it again, it gave me some "syntax error" crap. I can plainly see that I'm doing something wrong, but how do I make this right?
User avatar
kevansevans
Spotlight Team
Posts: 435
Joined: Tue Oct 05, 2010 12:04 am
Graphics Processor: nVidia with Vulkan support
Contact:

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

Post by kevansevans »

Spoiler:
Put the check inventory as a separate variable instead if having it called out in the array. The amount can't update if it's declared once. Then set up a function that readjusts the prices. Example:

Code: Select all

Int currentHammerCount = 0;
Script "getInventoryOfHammer" (void)
{
   currentHammerCount = checkInventory("HammerSpaceCounter");
}
Script "update prices" (void)
{
//adjusst the array here and use currentHammerCount as the modifier
}
Have the getInventoryOfHammer script get called out whenever a new HammerSpaceCounter is given, followed by the price updater.
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 »

I get most of this... except for the last part. How do I adjust the array there? Do I redefine the entire array under "Script 'Update Prices'"?

I'll have you guys know that I don't know much about ACS, and I have next to no experience in writing the stuff... so you'll need to explain as clearly as you can.
User avatar
Wilcocliw
Posts: 30
Joined: Wed Sep 09, 2015 3:43 am

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

Post by Wilcocliw »

how can i have 2 inventory slots with each 1 weapon like in BF3 and BF4 and COD?
User avatar
zyzxzexe
Posts: 19
Joined: Sat Nov 22, 2014 11:13 pm

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

Post by zyzxzexe »

amv2k9 wrote:
zyzxzexe wrote:Hi I was wondering how to make a weapon that the longer u hold it the more ammo it drains and the more damage it will do when fired.
Using a combination of [wiki]A_Refire[/wiki] and [wiki]A_JumpIfInInventory[/wiki], check to see how long the player has been holding the fire button, and move to different states accordingly.

Code: Select all

ACTOR ChargeLevel : Inventory
{
 Inventory.Amount 1
 Inventory.MaxAmount 10
}

ACTOR ChargerGun : Weapon // Only states relevant to the example will be shown
{
 States
 {
 Fire:
  GUNZ BCDE 2
  TNT1 A 0 A_GiveInventory("ChargeLevel")
  TNT1 A 0 A_Refire("Fire")
 CheckChargeLevel:
  TNT1 A 0 A_JumpIfInventory("ChargeLevel",10,"ChargeAttackLV1")
  TNT1 A 0 A_JumpIfInventory("ChargeLevel",9,"ChargeAttackLV2")
  // You get the idea; a check for every amount of the ChargeLevel item, which represents how long you've been charging the gun. 
  // The amounts are checked highest to lowest, because A_JumpIfInventory checks for at least that much, not exactly that much.
 ChargeAttackLV1:
  GUNZ F 2 A_FireCustomMissile("ChargeProjectile1")
  Goto FireFinish
 ChargeAttackLV2:
  GUNZ F 2 A_FireCustomMissile("ChargeProjectile2")
 FireFinish:
  TNT1 A 0 A_TakeInventory("ChargeLevel")
  GUNZ GHI 2
  Goto Ready
 }
}

This code works but i have the charge lvl set to go up to, 1000, so does anyone know a way to just get the number of "chargelevel" in my inventory, instead of just using 1000 A_JumpIfInventory?
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 »

kevansevans wrote:So I'm trying to make an arachnotron stand on the ceiling instead of moving on the floor. Everything works fine except the sprite location:

https://www.dropbox.com/s/djlity4rk6rkw ... 1.png?dl=0

After I set YScale to -1.0, the sprites show up above it's hitbox. i've looked all over to see if I can change the position of where it draws, and i really don't want to manually edit each sprite just to have an upside down enemy. Any solution?
[Don't do that]. Inverted Y scales aren't supported. GZDoom only supports it incidentally, as such its rendering behaviour is undefined.
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 »

kevansevans wrote:
Spoiler:
Put the check inventory as a separate variable instead if having it called out in the array. The amount can't update if it's declared once. Then set up a function that readjusts the prices. Example:

Code: Select all

Int currentHammerCount = 0;
Script "getInventoryOfHammer" (void)
{
   currentHammerCount = checkInventory("HammerSpaceCounter");
}
Script "update prices" (void)
{
//adjusst the array here and use currentHammerCount as the modifier
}
Have the getInventoryOfHammer script get called out whenever a new HammerSpaceCounter is given, followed by the price updater.
Question... How do I update the shop prices listed in the array, using that "update prices" script? Should I restate the array, but add the multipliers like I did in my previous attempt? Or is this something else entirely?
User avatar
Rowsol
Posts: 1000
Joined: Wed Mar 06, 2013 5:31 am
Contact:

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

Post by Rowsol »

Is there a limit to the amount of sound clips you can use with $random in sndinfo? I ask because while there's no errors, it seems to be biased and play the first 50 or so way more than the last 30 ish.
Wilcocliw wrote:how can i have 2 inventory slots with each 1 weapon like in BF3 and BF4 and COD?
Don't get whatcha mean. You want to only be able to carry 2 weapons? I guess you could just unbind your weapon slots besides 1 and 2... :)
User avatar
Wilcocliw
Posts: 30
Joined: Wed Sep 09, 2015 3:43 am

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

Post by Wilcocliw »

DoukDouk wrote:
wildweasel wrote:
DoukDouk wrote:Would it be possible for the player to have a limited inventory? As in only be able to hold a weapon in a certain slot at one time? Like if he were to see a weapon on the ground, he would be required to press E in order to either pick it up or switch it with the weapon that currently takes up that number slot.
It is certainly possible, and has been done in a few mods, but bear in mind that this requires some ACS and Decorate working in concert. The typical method involves replacing the usual weapon pickups with "fake" ones that handle the actual pickup logic (giving the weapon, applicable ammo, and adding a flag that indicates that its slot is full). You can see working examples of such code in my old, somewhat unfinished mod, Magnum Opus, where I've commented some portions of the code to hopefully help you out.
Thanks, this fits the bill perfectly.
I got myself interested in how you did that, but how can you read that Compiled ACS?
CRxTRDUDE
Posts: 52
Joined: Fri Nov 18, 2011 11:11 am
Location: Form nowhere with blob

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

Post by CRxTRDUDE »

I think it's the decorate you need to check out not the ACS.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

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

Post by wildweasel »

No, you'll need both parts; look for a SCRIPTS lump as well, which handles the on-screen messages and ammo retention.
User avatar
Wilcocliw
Posts: 30
Joined: Wed Sep 09, 2015 3:43 am

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

Post by Wilcocliw »

wildweasel wrote:No, you'll need both parts; look for a SCRIPTS lump as well, which handles the on-screen messages and ammo retention.
could you explain what the Compiled ACS do?
or is this non-important?
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

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

Post by wildweasel »

ACS needs to be compiled to work. ZDoom can't simply interpret the raw source code, so it needs to be run through the ACC compiler in order for ZDoom to work with it. [wiki]ACS[/wiki] has more information.

I feel like I should say at this point that if you don't know what these things are, a COD-style weapon slot system is going to be a bit beyond your skill, and maybe you should start with the basics first.
Locked

Return to “Editing (Archive)”