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
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

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

Post by Gutawer »

Mav3r1ck wrote: EDIT: Gutawer, that method you showed me to randomize the switches at the start of each map. Can I also use the same method to randomize things?

Say for example, I have multiple map spots and at the start of a level only one is selected to spawn a weapon, health or some ammo?
Yeah, that's easy:

Code: Select all

script "Generate Map Spot + Spawn Item" OPEN {
    int mapSpotToSpawnAt = random(***FIRST MAP SPOT ID HERE***, ***LAST MAP SPOT ID HERE***);
    
    //then just use SpawnSpotFacing, Thing_Spawn, TeleportOther, whatever you want with the thing id set to mapSpotToSpawnAt.
}
User avatar
Mav3r1ck
Posts: 262
Joined: Thu Jul 16, 2015 11:09 pm

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

Post by Mav3r1ck »

Gutawer wrote:
Mav3r1ck wrote: EDIT: Gutawer, that method you showed me to randomize the switches at the start of each map. Can I also use the same method to randomize things?

Say for example, I have multiple map spots and at the start of a level only one is selected to spawn a weapon, health or some ammo?
Yeah, that's easy:

Code: Select all

script "Generate Map Spot + Spawn Item" OPEN {
    int mapSpotToSpawnAt = random(***FIRST MAP SPOT ID HERE***, ***LAST MAP SPOT ID HERE***);
    
    //then just use SpawnSpotFacing, Thing_Spawn, TeleportOther, whatever you want with the thing id set to mapSpotToSpawnAt.
}
Thanks!

I also have a bit more complicated one. Say for example I have a switch that's connected to four pillars and one is chosen at random when I hit the switch. Would I use this and change a few values or somethine else?

EDIT: Never mind, I figured it out. :)
User avatar
Rachael
Posts: 13960
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

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

Post by Rachael »

AlexMax wrote:This is an XY question, but I'm pretty sure if I can figure this out, the rest will follow.

Is it possible to "steal" something from the inventory of another player? For example, I would like to walk up to another player, interact with them somehow (either by pressing USE or by using a custom fist weapon) and by doing so take an inventory item out of their inventory and put it in my own.

+USESPECIAL tests on CustomInventory objects allows me to drop into an ACS_Execute, but I don't know how to know who both the mark and the thief are. Using an ACS_Execute with a custom weapon has a similar problem.
One thing you could try... I don't know if there are any ACS "drop" functions available that force you to drop an inventory item to the ground - if there isn't, they shouldn't be that hard to create. (I'd do it if I wasn't solving my own problems with QZDoom at the moment)

At any rate, once the item is dropped, it should then be feasible to relocate that item directly on top of the "thief", thereby forcing an inventory deposit.
User avatar
AlexMax
Posts: 64
Joined: Sat Apr 15, 2006 12:26 am
Preferred Pronouns: She/Her
Operating System Version (Optional): Windows 11 22H2
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

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

Post by AlexMax »

Eruanna wrote:Stuff
Yeah, the XY analogy is breaking down here. What I'm actually looking to do was to have a way that I can peruse the inventory of another player, and elect to steal something - but only if I'm close enough (and oh I forgot, only if they're unconscious, but not dead). For that, I essentially needed a way to grab the TID of something I was aiming at, or at the very least be in the context where I could identify both the mark and the thief somehow.

Yeah, I'm up to something monumentally stupid.

But I figured out a way. With ZDoom 2.5 (Zandronum 2.0), no less. It turned out to be a lot simpler than I had anticipated - SetActivatorToTarget is from 2009, and with that I can set the enemy as the activator, which opens up all the other possibilities. For those of you listening at home and not using ancient versions of ZDoom, you should probably use SetActivator with the proper second parameter.
User avatar
Rachael
Posts: 13960
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

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

Post by Rachael »

Interesting. Well, I am glad you have something worked out, then.
User avatar
Niwatorry
Posts: 23
Joined: Fri Jun 15, 2012 8:31 pm
Location: Floating above Hell itself

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

Post by Niwatorry »

comet1337 wrote:

Code: Select all

a_facetarget(0, 0)

a_firecustommissile("arachnotronplasma", 32, 9, 0, cmf_aimdirection | cmf_absolutepitch, pitch)
i think
Thank you!
I didn't know I can use "pitch" word as a substitution.
It worked perfectly, especially combined with FAF_MIDDLE flag(A_FaceTarget).
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 »

RSSwizard wrote:I use Zdoom not GZdoom (no modern openGL)

I like playing with Palettes for recoloring the game

I want to introduce a new "optimized" palette with more colors, which stylizes the game in a certain way (and also reduces some of the colors the traditional game artwork depends on, making it look a little more nintendo-ish).

Ive got a good palette worked up, but I want to know how can I implement that without getting graphic glitches from direct palette mapping (verses the game's built in remapper).

I know one possibility is to convert all the graphics to PNG format (slade does it) but... there are alot of legacy graphics from the IWADs and I dont think Slade can make an IWAD.

I think BTSX just went the route of copying all the graphics and textures out, thats one way to do it I guess but its still on the lower end of efficiency.

Others can use the palette if they like, the only colors that didnt change places are index 247 (transparent color) and the green translation strip.
pal optimized.png
Dunno if it will do what you want, but maybe use the new TRNSLATE lump for pallete translation? http://forum.zdoom.org/viewtopic.php?f=18&t=53585
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 »

A very, very long time ago, I said on the "ZDoom Ideas You Have..." thread that it'd be nice to have an invasion mode for GZDoom. Someone sent me a demo map with some ACS that would yield a basic Invasion gameplay. Don't know who that was, but thank you. :D

ANYWAY, now that I have the resources to make my own invasion-style maps, is there a way to link rooms together, and have them block access to each other, and have each room unlock the gate to the next room after you've cleared a set of waves in the room you're in?

In other words... instead of having to destroy a set amount of monsters already in a room to unlock a certain door, is there a way to make the player have to kill entire waves of monsters, so that when they are all destroyed, the door to the next room will unlock, and the player will have to kill another set of waves of monsters to progress to the room after that?
Wow, such run-on... XD
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

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

Post by Cutmanmike »

Yo.

I've quite behind on the new feature list being a mod developer mainly for Zandronum so I'll ask here. Is it possible to have a widescreen intermission image (INTERPIC) yet, and if yes, how? The last post I could find about it was in 2012.
User avatar
Mav3r1ck
Posts: 262
Joined: Thu Jul 16, 2015 11:09 pm

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

Post by Mav3r1ck »

Trying to get this script to work correctly.

Code: Select all

script FirstWave ENTER
{
	While(ThingCount(112, 22) > 0)
	Delay(2);
	Floor_RaiseByValue(19, 8, 8);
	ChangeFloor(19, "FLAT5_1");
	Floor_RaiseByValue(20, 8, 16);
	ChangeFloor(20, "FLAT5_1");
	Floor_RaiseByValue(21, 8, 24);
	ChangeFloor(21, "FLAT5_1");
	Delay(24);
	Thing_FadeIn(23, 19, 25);
	Thing_FadeIn(24, 113, 25);
	Delay(2);
	While(ThingCount(19, 25) > 0)
	Delay(2);
	While(ThingCount(113, 25) > 0)
	Delay(2);
	Floor_LowerByValue(26, 8, 144);
}
Having trouble trying to get it to execute like I want to. It all works correctly until the last part.

Code: Select all

Floor_LowerByValue(26, 8, 144);
This is activated BEFORE I kill the Cacodemons and Hell Knights with the TID. It's suppose to activate after I kill the enemies with the TID of 25 and I can't think of a way to solve it.
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 »

What ACS function do I use to draw a sprite on the player's HUD for a few seconds before going away?

EDIT: Just in the middle of the screen, if that matters any (Like I think it does with StrLeft, StrMid, and StrRight)
LogicalFallacy
Posts: 89
Joined: Tue May 24, 2016 8:59 am

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

Post by LogicalFallacy »

LanHikariDS wrote:What ACS function do I use to draw a sprite on the player's HUD for a few seconds before going away?

EDIT: Just in the middle of the screen, if that matters any (Like I think it does with StrLeft, StrMid, and StrRight)
You can do so with HudMessage. I've not done it myself, so I'm not entirely sure how it's done, but it seems like it shouldn't be too hard.
Wiki page here.
User avatar
arookas
Posts: 265
Joined: Mon Jan 24, 2011 6:04 pm
Contact:

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

Post by arookas »

For drawing a sprite with ACS, you use [wiki]HudMessage[/wiki], like LogicalFallacy said, combined with [wiki]SetFont[/wiki] to set the sprite you want to draw. When drawing sprites, the letter "A" is used as the text. The position for the center is by default (0.5, 0.5), so for example, so draw a centered doomimp to the screen for one second:

Code: Select all

SetFont("TROOA1");
HudMessage(s:"A"; HUDMSG_PLAIN, 0, CR_UNTRANSLATED, 0.5, 0.5, 1.0);
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 »

Are textures/patches/flats allowed to be separated into sub-folders within a PK3? I'd like a directory structure similar to this:

Code: Select all

/textures/something.png
/textures/somethingelse.png
/textures/egyptian/bird.png
/textures/switches/button.png
... etc.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

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

Post by Gez »

Yes.
Locked

Return to “Editing (Archive)”