The "How do I..." Thread
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.
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.
Re: The "How do I..." Thread
How do I increase the damage and blast radius of the barrels?
Re: The "How do I..." Thread
Modify [wiki]A_Explode[/wiki] parameters.LostSkull wrote:How do I increase the damage and blast radius of the barrels?
Re: The "How do I..." Thread
You, running modified version of Mega Man, are my hero.
Oh, I got another question. Can I add a SIGHT funtion with sound to Lost Souls?
Oh, I got another question. Can I add a SIGHT funtion with sound to Lost Souls?
- WARCHILD_89
- Posts: 452
- Joined: Sun Nov 17, 2013 12:27 pm
- Graphics Processor: nVidia with Vulkan support
- Location: MIA between doomed dimensions
Re: The "How do I..." Thread
ok, maybe I was just too tired to get it or I am too silly for this...
I still don´t get it, how to create a CUSTOM DAMAGE TYPE and enter different death states then. What I tried is to make a demon that enters a different death state depending on either how you kill it (as seen in BrutalDoom.pk3 for example (I can´t find the damage type declarations there to learn from them...
)) or enter one of its death states randomly ...
from my wad for testing and trying around....
Actor Xdemon : Demon Replaces Demon
{
painchance "demondeath1", 255
damagefactor "demondeath1", 1.8 // got this line from Zdoom Wiki....
States
{
Death:
SAAR A 8
SAAR B 0 A_FaceTarget
SAAR B 0 A_SpawnItemEx("DemonArm", 10, 0, 32, 0, 8, 0, 0, 128)
SAAR B 8 A_Scream
SAAR C 4
SAAR D 4 A_NoBlocking
SAAR E 4
SAAR F -1
Stop
Death.demondeath1
the new death state the demon should enter but how to do this?...
SARG O 5
SARG P 5 A_XScream
SARG Q 5 A_NoBlocking
SARG RSTUV 5
SARG W -1
Stop
}
}
DamageType demondeath1 // just got it from Zdoom wiki
{
Factor 1 I think something is missing in this body to make it all work and enter the "Death.demondeath1" state......
ReplaceFactor
}
I still don´t get it, how to create a CUSTOM DAMAGE TYPE and enter different death states then. What I tried is to make a demon that enters a different death state depending on either how you kill it (as seen in BrutalDoom.pk3 for example (I can´t find the damage type declarations there to learn from them...
from my wad for testing and trying around....
Actor Xdemon : Demon Replaces Demon
{
painchance "demondeath1", 255
damagefactor "demondeath1", 1.8 // got this line from Zdoom Wiki....
States
{
Death:
SAAR A 8
SAAR B 0 A_FaceTarget
SAAR B 0 A_SpawnItemEx("DemonArm", 10, 0, 32, 0, 8, 0, 0, 128)
SAAR B 8 A_Scream
SAAR C 4
SAAR D 4 A_NoBlocking
SAAR E 4
SAAR F -1
Stop
Death.demondeath1
SARG O 5
SARG P 5 A_XScream
SARG Q 5 A_NoBlocking
SARG RSTUV 5
SARG W -1
Stop
}
}
DamageType demondeath1 // just got it from Zdoom wiki
{
Factor 1 I think something is missing in this body to make it all work and enter the "Death.demondeath1" state......
ReplaceFactor
}
Re: The "How do I..." Thread
How do I change actor properties through actor states? It was something that comes after the action function and its variables in the brackets. I saw it in a Decorate long ago but I forgot about it. I need the exact syntax.
For example, something like:
TNT1 A 0 A_Explode(128,140) Somethingaboutspeedhere ...
... and it changed the actors property in that line. Don't know if permanently overwrites or only for the duration of the line or whatever.
To be specific I want to change the actors speed. I'm doing a multi-stage rocket projectile. Alternatives are welcome.
For example, something like:
TNT1 A 0 A_Explode(128,140) Somethingaboutspeedhere ...
... and it changed the actors property in that line. Don't know if permanently overwrites or only for the duration of the line or whatever.
To be specific I want to change the actors speed. I'm doing a multi-stage rocket projectile. Alternatives are welcome.
- Mánibranðr System
- Posts: 179
- Joined: Sun Aug 26, 2012 5:28 pm
- Preferred Pronouns: They/Them
- Location: Hong Kong
Re: The "How do I..." Thread
You can define it in the puffs for hitscan and melee attacks, and in the projectiles for projectile attacks.
Re: The "How do I..." Thread
I need multiple speed values for the different actor state groups inside a single actor. So I want to change the property inside the states for the groups. I believe to remember that it can be done somehow but I don't know how. I don't know any different ways to get my desired result.
- Mánibranðr System
- Posts: 179
- Joined: Sun Aug 26, 2012 5:28 pm
- Preferred Pronouns: They/Them
- Location: Hong Kong
Re: The "How do I..." Thread
Have an ACS script that changes the property using a passed parameter for the speed. Then call the ACS script from the Decorate code with the desired parameters.
- zrrion the insect
- Posts: 2432
- Joined: Thu Jun 25, 2009 1:58 pm
- Location: Time Station 1: Moon of Glendale
Re: The "How do I..." Thread
Wouldn't it be easier to use [wiki]A_ChangeVelocity[/wiki]?
- Mánibranðr System
- Posts: 179
- Joined: Sun Aug 26, 2012 5:28 pm
- Preferred Pronouns: They/Them
- Location: Hong Kong
Re: The "How do I..." Thread
I was assuming that he was talking about for the playerpuppet class.
Re: The "How do I..." Thread
Thanks for the answers so far.
For clarification, I simply wanted to launch a missile that speeds up in mid-flight. Sorry for sounding so confusing.
Tried A_changevelocity and A_scalevelocity, they work for the effect however not at the place where I want them to work. I'm making a homing missile and this screws up the change of the velocity whenever this happens before the homing-in part. That is my desired effect.
If there are no targets, the missile accelerates as intended, but not when homing in on targets.
Actor Rocket4 : Rocket3
{
+SEEKERMISSILE
Speed 20 //40
States
{
Spawn:
ROKT A 10 bright
Goto Homing2
Homing2:
//TNT1 A 0 A_ChangeVelocity(2.0)
//TNT1 A 0 A_ScaleVelocity(40,40,40,CVF_REPLACE)
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
Goto Target
Target:
ROKT A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
loop
Death:
TNT1 A 0 A_PlaySound("Rocketlauncher")
TNT1 A 0 A_Explode(48,16)
TNT1 A 1 A_SpawnItemEx("MissileExplodeSmall",0,0,0,0,0,0,0,128,0)
stop
}
}
@ArcheKruz
That sounds so confusing and deep that I'm getting intimidated just reading it. I haven't got a clue how to even get started.
Care to give me some links on necessary knowledge and how to get started on it?
For clarification, I simply wanted to launch a missile that speeds up in mid-flight. Sorry for sounding so confusing.
Tried A_changevelocity and A_scalevelocity, they work for the effect however not at the place where I want them to work. I'm making a homing missile and this screws up the change of the velocity whenever this happens before the homing-in part. That is my desired effect.
If there are no targets, the missile accelerates as intended, but not when homing in on targets.
Actor Rocket4 : Rocket3
{
+SEEKERMISSILE
Speed 20 //40
States
{
Spawn:
ROKT A 10 bright
Goto Homing2
Homing2:
//TNT1 A 0 A_ChangeVelocity(2.0)
//TNT1 A 0 A_ScaleVelocity(40,40,40,CVF_REPLACE)
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
TNT1 A 0 A_SeekerMissile (10,30,SMF_LOOK,256)
TNT1 A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
Goto Target
Target:
ROKT A 0 bright A_SpawnItem("RocketFlareRed",-6,0)
ROKT A 1 bright A_SpawnItem("RocketRedTrail")
loop
Death:
TNT1 A 0 A_PlaySound("Rocketlauncher")
TNT1 A 0 A_Explode(48,16)
TNT1 A 1 A_SpawnItemEx("MissileExplodeSmall",0,0,0,0,0,0,0,128,0)
stop
}
}
@ArcheKruz
That sounds so confusing and deep that I'm getting intimidated just reading it. I haven't got a clue how to even get started.
Care to give me some links on necessary knowledge and how to get started on it?
Re: The "How do I..." Thread
This is entirely experimental mind you, I haven't tested this or even know if this works buuuuut...Servastal wrote:Thanks for the answers so far.
For clarification, I simply wanted to launch a missile that speeds up in mid-flight. Sorry for sounding so confusing.
Tried A_changevelocity and A_scalevelocity, they work for the effect however not at the place where I want them to work. I'm making a homing missile and this screws up the change of the velocity whenever this happens before the homing-in part. That is my desired effect.
If there are no targets, the missile accelerates as intended, but not when homing in on targets.
Spawn:
ROKT A 10 bright
TNT1 A 0 A_JumpIfTracerCloser(10000,"Homing2")
Goto Accelerate
Make an accelerating rocket state for it to jump to.
If there's no tracer, this function shouldn't work. Hopefully. If there is, the distance should theoretically be large enough that it automatically moves to the acceleration state. No idea if this will work.
Re: The "How do I..." Thread
Okay found my errors, it works as intended now. I screwed up massively with A_ChangeVelocity.
@ Yholl
Oh man, sorry dude. What I wrote sounded completely different from what I meant again. Talk about sounding confusing
That wasn't the desired effect. That was what was happening instead of it.
I wanted the missile to always accelerate, and always simultaneously home in on a target if there is one. The missile 'activates' mid flight, turbo + homing.
Thanks for the answers and efforts though.
@ Yholl
Oh man, sorry dude. What I wrote sounded completely different from what I meant again. Talk about sounding confusing
That wasn't the desired effect. That was what was happening instead of it.
I wanted the missile to always accelerate, and always simultaneously home in on a target if there is one. The missile 'activates' mid flight, turbo + homing.
Thanks for the answers and efforts though.
- 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
[wiki]A_FaceTracer[/wiki] plus NeuralStunner's full 3D recoil (but with force inverted so the thing goes forward)?
EDIT: A quick mockup:Uncomment out the A_ScaleVelocity to have the thing actually have a chance in hell of hitting you after the first time you get out of its way, but at the cost of not being able to accelerate past a certain speed. Now it slows down to aim for you when you're not within a certain hit threshold, but rushes in for the kill when you're deemed close enough.
EDIT: A quick mockup:
Code: Select all
actor RevoBall : RevenantTracer replaces RevenantTracer
{
+seekermissile
speed 4
states
{
spawn:
FATB AB 2 bright
TNT1 A 0 A_JumpIfTargetInLOS(2,12,JLOSF_PROJECTILE)
TNT1 A 0 A_ScaleVelocity(0.8)
TNT1 A 0 A_SpawnItemEx("BulletPuff")
TNT1 A 0 A_RearrangePointers(AAPTR_TRACER,AAPTR_DEFAULT,AAPTR_TARGET)
TNT1 A 0 A_FaceTarget(12,12)
TNT1 A 0 A_ChangeVelocity (Cos(Pitch) * 1, 0, Sin(Pitch) * 1, 1)
TNT1 A 0 A_RearrangePointers(AAPTR_TRACER,AAPTR_DEFAULT,AAPTR_TARGET)
TNT1 A 0 A_JumpIf(z-floorz<8,1)
loop
TNT1 A 0 A_ChangeVelocity(0,0,2)
loop
}
}Re: The "How do I..." Thread
Alright, I've got a scrollable inventory working. Thing is, I want it to skip to the next non-zero value in [x][1] rather than printing an empty box/a great big X. This would require a function that automatically trials every slot past the current TopLeftItem until it's found 8 suitable ones to print. Anyone have any pointers as how to code that?
Code: Select all
//(ITEM ID) (HOW MANY DO I HAVE?) (*ASSOCIATED STRING*)
INT pickuplist [255] [3] = {
{"1", "1", "My Journal"},
{"2", "0", ""},
{"3", "1", ""},
{"4", "0", ""},
{"5", "0", ""},
{"6", "0", ""},
{"7", "0", ""},
{"8", "1", ""},
{"9", "1", ""},
{"10", "0", ""},
{"11", "1", ""},
{"12", "0", ""},
{"13", "1", ""},
{"14", "1", ""},
{"15", "0", ""},
{"16", "1", ""},
};
//SLOT 1
if (pickuplist [TopLeftItem+0][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+0][0]; HUDMSG_plain, 69, cr_black, 0.60, 0.9, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 69, cr_black, 0.60, 0.9, 0, 0, 0, 0.3);
}
//SLOT 2
if (pickuplist [TopLeftItem+1][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+1][0]; HUDMSG_plain, 68, cr_black, 0.65, 0.9, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 68, cr_black, 0.65, 0.9, 0, 0, 0, 0.3);
}
//SLOT 3
if (pickuplist [TopLeftItem+2][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+2][0]; HUDMSG_plain, 67, cr_black, 0.70, 0.9, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 67, cr_black, 0.70, 0.9, 0, 0, 0, 0.3);
}
//SLOT 4
if (pickuplist [TopLeftItem+3][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+3][0]; HUDMSG_plain, 66, cr_black, 0.75, 0.9, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 66, cr_black, 0.75, 0.9, 0, 0, 0, 0.3);
}
//SLOT 5
if (pickuplist [TopLeftItem+4][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+4][0]; HUDMSG_plain, 65, cr_black, 0.60, 0.95, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 65, cr_black, 0.60, 0.95, 0, 0, 0, 0.3);
}
//SLOT 6
if (pickuplist [TopLeftItem+5][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+5][0]; HUDMSG_plain, 64, cr_black, 0.65, 0.95, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 64, cr_black, 0.65, 0.95, 0, 0, 0, 0.3);
}
//SLOT 7
if (pickuplist [TopLeftItem+6][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+6][0]; HUDMSG_plain, 63, cr_black, 0.70, 0.95, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 63, cr_black, 0.70, 0.95, 0, 0, 0, 0.3);
}
//SLOT 8
if (pickuplist [TopLeftItem+7][1] == "1"){
Setfont ("MONACO32") ;
hudmessage (s:pickuplist[TopLeftItem+7][0]; HUDMSG_plain, 62, cr_black, 0.75, 0.95, 0, 0, 0, 0.3);}
else {hudmessage (s:"X"; HUDMSG_plain, 62, cr_black, 0.75, 0.95, 0, 0, 0, 0.3);
}
delay(2);
} }
Script 5 (void)
{ topleftitem += 4 ; }
Script 6 (void)
{ if(topleftitem==0) { }
else {topleftitem -= 4 ; } }