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
Enjay
 
 
Posts: 27058
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

The decorate references sprites like SWPI but I don't see and sprites with that name in the file.
User avatar
DavidN
 
 
Posts: 266
Joined: Mon Dec 28, 2015 6:22 pm

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

Post by DavidN »

Is there a definition somewhere to change the main menu option colour? I see the various menufontcolor_ properties in gameinfo, but not one for the very first page (New Game, Options, etc)

https://zdoom.org/wiki/MAPINFO/GameInfo_definition
LogicalFallacy
Posts: 89
Joined: Tue May 24, 2016 8:59 am

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

Post by LogicalFallacy »

Enjay wrote:The decorate references sprites like SWPI but I don't see and sprites with that name in the file.
Hooray for missing the obvious! Thank you, that was the issue.
User avatar
sonic_HD87
Posts: 287
Joined: Sat Mar 23, 2013 4:32 pm
Location: Venezuela

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

Post by sonic_HD87 »

I have a script which structure is like this:

Code: Select all

script 29 (void)
{
 int X = 22.0;

 //First, it increase the actor Vel gradually
 while(GetActorVelX(0) < X)
 {
   SetActorVelocity(0,GetActorVelX(0)+1.0,0.0,0.0);
   delay(1);
 }

 //After that, it decreases his speed gradually until is 0
 while(GetActorVelX(0) != 0)
 {
   SetActorVelocity(0,GetActorVelX(0)-1.0,0.0,0.0);
   delay(1);
 }
}
The idea of this is that, if an actor executes the script, his speed will increase AND THEN will decrease. The thing is this: Only 1 script can be executed at a time until the loops ended. Even using ACS_ExecuteAlways, it doesn't help since it can't run another iteration of the script while there's one being executed.

There's a way to execute the same script multiple times regardless of the loops?

EDIT: Nvm, i was executing it in the wrong way. Silly me. :P
User avatar
worldendDominator
Posts: 291
Joined: Sun May 17, 2015 9:39 am

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

Post by worldendDominator »

You should probably check for >0 in the second loop, and then set it to 0 after it. Just in case of fractional velocity.
User avatar
Ral22
Posts: 531
Joined: Sun Sep 05, 2010 12:09 pm
Preferred Pronouns: He/Him
Location: The Fortress of Dr. Radiaki
Contact:

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

Post by Ral22 »

It's likely been assessed before, but I just want to know for sure: Is there a way for fonts to utilize PNG alpha? Perhaps some TEXTURES workaround or the like? I can adjust if there's no other choice, but I've got the font all nice and set with PNG alpha currently.
User avatar
Nash
 
 
Posts: 17498
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

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

Post by Nash »

Ral22: Nope, it's currently not possible. Hope this limitation will be lifted when/if GZDoom implements TrueType fonts (Graf was seen recently mentioning it briefly as a "what if"... can't remember where, maybe it was on the Mantis board).
User avatar
Ral22
Posts: 531
Joined: Sun Sep 05, 2010 12:09 pm
Preferred Pronouns: He/Him
Location: The Fortress of Dr. Radiaki
Contact:

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

Post by Ral22 »

Nash wrote:Ral22: Nope, it's currently not possible. Hope this limitation will be lifted when/if GZDoom implements TrueType fonts (Graf was seen recently mentioning it briefly as a "what if"... can't remember where, maybe it was on the Mantis board).
Wow, that'd be a dream. If I'm picturing it right, it would make for easy font implementation and smooth, clean fonts no matter the resolution. Oh, to dream.

Thanks for the quick reply, Nash! Always appreciate your help.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

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

Post by Nevander »

How do I give a FireCustomMissile sideways velocity? Trying to make shell casings that respect the pitch of the player's camera (since SpawnItemEx doesn't) but my casings just always end up falling straight to the floor from the middle of my player sprite. I tried using an example from here but no good, even with the exact numbers the casings don't spawn properly. Even though SpawnItemEx doesn't use pitch, it sure does work a lot better. Why can't it have flags to respect pitch like others do? :(
User avatar
Nash
 
 
Posts: 17498
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

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

Post by Nash »

Ral22 wrote:If I'm picturing it right, it would make for easy font implementation and smooth, clean fonts no matter the resolution. Oh, to dream.
Well Randi also briefly touched on it years ago so... I guess we can hope. =P
LogicalFallacy
Posts: 89
Joined: Tue May 24, 2016 8:59 am

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

Post by LogicalFallacy »

So I ran into another issue with the mod I'm working on, and I'm halfway hoping it's another case of me being stupid and only needs a really simple fix. The same weapon I was just getting started has a standard sword swing attack and an alt-fire that launches a projectile. I'm trying to get it put together so that killing monsters with the sword's standard attack gives ammo for the alt-fire, but it doesn't seem to be working right.

Here's what the sword looks like at the moment:
Spoiler:
And here's the death I've tried coding into my one monster so far:
Spoiler:
Any advice on getting this to work the way I intend it to would be much appreciated.
User avatar
sonic_HD87
Posts: 287
Joined: Sat Mar 23, 2013 4:32 pm
Location: Venezuela

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

Post by sonic_HD87 »

Nevander wrote:How do I give a FireCustomMissile sideways velocity? Trying to make shell casings that respect the pitch of the player's camera (since SpawnItemEx doesn't) but my casings just always end up falling straight to the floor from the middle of my player sprite. I tried using an example from here but no good, even with the exact numbers the casings don't spawn properly. Even though SpawnItemEx doesn't use pitch, it sure does work a lot better. Why can't it have flags to respect pitch like others do? :(
Haven't you tried x+Cos(Angle) and y+sin(angle)?
User avatar
Dr_Cosmobyte
Posts: 2852
Joined: Thu Jun 04, 2015 9:07 pm
Preferred Pronouns: He/Him
Location: Killing spiders.
Contact:

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

Post by Dr_Cosmobyte »

The other question wasn't as important as this.

My project has three classes and the player is kinda thrown without any informaion about it. I wanted to make the option to display a little description of the character class when you choose it, so the player can confirm before going to the episode or difficulty screen.

Is there a way to define it on MENUDEF?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

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

Post by Matt »

LogicalFallacy: A_GiveToTarget instead of A_DropItem should work most of the time.

An initially more complex but more comprehensive and maintainable solution would be to make the sword attack use a custom puff that has +PUFFGETSOWNER, +PUFFONACTORS and +HITTRACER* and have it call A_GiveToTarget when the tracer has no health.

(*I'm assuming this works for puffs, can't confirm right now. If not you can always just hit with an invisible projectile instead of using a punch attack...)
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

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

Post by Matt »

Nevander wrote:How do I give a FireCustomMissile sideways velocity? Trying to make shell casings that respect the pitch of the player's camera (since SpawnItemEx doesn't) but my casings just always end up falling straight to the floor from the middle of my player sprite. I tried using an example from here but no good, even with the exact numbers the casings don't spawn properly. Even though SpawnItemEx doesn't use pitch, it sure does work a lot better. Why can't it have flags to respect pitch like others do? :(
Here's the code for ejecting the bolt-action rifle casing in HD:

Code: Select all

A_SpawnItemEx(
	"HDSpent7mm",

	//all these are already relative positions so no angle adjustment
	cos(pitch)*8,
	1,
	height-7-sin(pitch)*8,

	//all these are relative velocities
	//as a simple mnemonic: velx is cos everything
	//the -80 is to get the casing coming out sideways
	//the starting speed is 6 DUs per tic, so all results are *6
	cos(pitch)*cos(angle-80) * 6 + velx,
	cos(pitch)*sin(angle-80) * 6 + vely,
	-sin(pitch)* 6 + velz, //the minus sign is important!

	0, //same as player
	SXF_ABSOLUTEMOMENTUM|SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH
)
Locked

Return to “Editing (Archive)”