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
worldendDominator
Posts: 288
Joined: Sun May 17, 2015 9:39 am

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

Post by worldendDominator »

LanHikariDS wrote:So now the fire does only spawn once, but it still remains in place once spawned.
Try adding WARPF_NOCHECKPOSITION to A_Warp. And/or +Noclip / +NoInteraction to Fire itself.
Also, are you using GZDoom? SXF_SETMASTER wouldn't work in Zandronum in this case due to some limitations.
User avatar
NachtIntellect
Posts: 305
Joined: Wed Feb 29, 2012 2:10 pm
Location: Bienenstock, Germany

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

Post by NachtIntellect »

Aylah_Stimson wrote:How do I get player classes to play their own separate sounds? Like different pain and grunt sounds.
Define it in SndInfo and use this for example: $playersound BerserkerClass Male *Grunt soundfilename and then for pain you replace grunt with *pain100 $PlayerSoundUp for *pain75/*pain50/*pain25 if I remember correctly but yeah, you can define each classes sound with this
User avatar
Aylah_Stimson
Posts: 14
Joined: Thu Mar 31, 2016 7:35 pm
Location: Somewhere fighting the horrors of Hell.

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

Post by Aylah_Stimson »

Whiteace wrote:Define it in SndInfo and use this for example: $playersound BerserkerClass Male *Grunt soundfilename and then for pain you replace grunt with *pain100 $PlayerSoundUp for *pain75/*pain50/*pain25 if I remember correctly but yeah, you can define each classes sound with this
Thank you. :ugeek:
User avatar
NachtIntellect
Posts: 305
Joined: Wed Feb 29, 2012 2:10 pm
Location: Bienenstock, Germany

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

Post by NachtIntellect »

Aylah_Stimson wrote:
Whiteace wrote:Define it in SndInfo and use this for example: $playersound BerserkerClass Male *Grunt soundfilename and then for pain you replace grunt with *pain100 $PlayerSoundUp for *pain75/*pain50/*pain25 if I remember correctly but yeah, you can define each classes sound with this
Thank you. :ugeek:
No problem, you can also randomise the sounds using $Random on a different line which comes in pretty handy when you are sick of hearing the same one sound over and over.

Could someone give me a better idea of how to use MenuDef with Cvars defined in ACS, an example wad/pk3 might do the trick I tend to learn more just by picking apart stuff.
Last edited by NachtIntellect on Tue Mar 14, 2017 10:42 am, edited 1 time in total.
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 »

worldendDominator wrote:
LanHikariDS wrote:So now the fire does only spawn once, but it still remains in place once spawned.
Try adding WARPF_NOCHECKPOSITION to A_Warp. And/or +Noclip / +NoInteraction to Fire itself.
Also, are you using GZDoom? SXF_SETMASTER wouldn't work in Zandronum in this case due to some limitations.
I'm using ZDoom and Zandronum (Whatever is selected at the time), though I'm intending this be used for Zandronum
EDIT: Welp, it did follow the player, though the sprite flickered when moving (Actually like it, since it's fire), but stopped once I ran it in Zandronum, just as you said.
EDIT2: Don't like the flickering in first person. I'm scared it's going to trigger a seizure in someone...
Last edited by LanHikariDS on Tue Mar 14, 2017 9:58 am, edited 1 time in total.
User avatar
worldendDominator
Posts: 288
Joined: Sun May 17, 2015 9:39 am

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

Post by worldendDominator »

LanHikariDS wrote:I'm using ZDoom and Zandronum (Whatever is selected at the time), though I'm intending this be used for Zandronum
EDIT: Welp, it did follow the player, though the sprite flickered when moving (Actually like it, since it's fire), but stopped once I ran it in Zandronum, just as you said.
In Zandronum, SXF_SETMASTER only works for monsters; you can get around this by giving Fire IsMonster flag. This has some side effects, but they are insignificant.
Last edited by worldendDominator on Tue Mar 14, 2017 10:16 am, edited 2 times in total.
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 »

Code: Select all

ACTOR Fire
{
  Radius 18
  Height 80
  +Bright
  +IsMonster
  RenderStyle Add
  States
  {
  Spawn:
    FIRE A 0 A_PlaySound (Crackle, 0, 92, 1)
    FIRE ABCDEFGHIJKLMN 2 A_Warp (AAPTR_MASTER, 0, 0, 0, 0, WARPF_NOCHECKPOSITION)
    Loop
   }
}
ACTOR InfectedPlayer : PlayerPawn
{
  Speed 1
  Health 100
  Radius 16
  Height 38
  Mass 100
  PainChance 255
  Player.DisplayName "Infected"
  Player.Face VIR
  -Pickup
  States
  {
  Spawn:
    TNT1 A 0 A_Jump(256, "See")
	PLAY A -1 A_SpawnItemEx ("Fire", 0, 0, 0, 0, 0, 0, 0, SXF_SetMaster)
Still not following the player
EDIT: Zandronum 3.0-alpha-r161030-2038, by the way.
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

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

Post by ZZYZX »

worldendDominator wrote:This has some side effects, but they are insignificant.
Being blocked by "block monsters" lines is insignificant? :P
To prevent this however, you probably can A_ChangeFlag it in the fire spawn state.
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 »

ZZYZX wrote:
worldendDominator wrote:This has some side effects, but they are insignificant.
Being blocked by "block monsters" lines is insignificant? :P
To prevent this however, you probably can A_ChangeFlag it in the fire spawn state.
In this case, it is, since the fire teleports directly to the player every step.
Also, while A_ChangeFlag does work with IsMonster, it may prevent it from warping in Zan. Not sure, because it isn't warping in Zan as is...
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 »

It's best to remove the +ismonster as soon as it's no longer needed anyway, since side effects include affecting monster targeting and sprite clipping differences and lots and lots of "minor" things that together add up to a major if slow-burning headache...
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 »

Also, I fixed the flickering by changing "ABCDEFGHIJKLMN 2" to AABBCCDDEEFFGGHHIIJJKKLLMMNN 1"
Elias79
Posts: 50
Joined: Mon Jan 30, 2017 6:09 am

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

Post by Elias79 »

Why does these 2 Actor scripts not behave in the same way, the loop gets canceled in the second script without a logical reason, i mean why should something earlier in the code change if the end frame is set or not?

Only thing different in the second script is i added TNT1 A 0
Death:
TNT1 A 0
stop
VS
Death:
stop

Code: Select all

Actor UserSpawner1 1001 // summon UserSpawner1 
{	
  +NOGRAVITY
  +NOBLOCKMAP
  +THRUACTORS
  -FORCEXYBILLBOARD
  var int user_test;
  var int user_angle;
  var int user_pitch;
  var int user_times;
    States
	{
	Spawn:
		TNT1 A 1 A_SetUserVar("user_test", 1)
		TNT1 A 0 A_SetUserVar("user_angle", 0)
		TNT1 A 0 A_SetUserVar("user_pitch", 0)
		TNT1 A 0 A_SetUserVar("user_times", 0)
		TNT1 A 1 A_CustomMissile("Thing1", 0 , 0, user_angle, 2, user_pitch)
		TNT1 A 1 A_JumpIf(user_test != 1, "Death")	
		loop
	Death:
		stop
	}
}

Code: Select all

Actor UserSpawner2 1002 // summon UserSpawner2 
{	
  +NOGRAVITY
  +NOBLOCKMAP
  +THRUACTORS
  -FORCEXYBILLBOARD
  var int user_test;
  var int user_angle;
  var int user_pitch;
  var int user_times;
    States
	{
	Spawn:
		TNT1 A 1 A_SetUserVar("user_test", 1)
		TNT1 A 0 A_SetUserVar("user_angle", 0)
		TNT1 A 0 A_SetUserVar("user_pitch", 0)
		TNT1 A 0 A_SetUserVar("user_times", 0)
		TNT1 A 1 A_CustomMissile("Thing1", 0 , 0, user_angle, 2, user_pitch)
		TNT1 A 1 A_JumpIf(user_test != 1, "Death")	
		loop
	Death:
		TNT1 A 0
		stop
	}
}
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

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

Post by DoomKrakken »

When you use Stop immediately in a state (like what you did in your first example), then that actually does something special in DECORATE... it removes the state entirely from the actor. This technique is useful for removing states that might carry over from "parent" actors via inheritance.

In this context, this means that your first actor here no longer has a viable Death state.

If you want your actor to have a proper Death state, and have your actor to disappear entirely upon death, you will need your actor to have a Death state exactly like the second example you posted.
Elias79
Posts: 50
Joined: Mon Jan 30, 2017 6:09 am

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

Post by Elias79 »

DoomKrakken wrote:When you use Stop immediately in a state (like what you did in your first example), then that actually does something special in DECORATE... it removes the state entirely from the actor. This technique is useful for removing states that might carry over from "parent" actors via inheritance.

In this context, this means that your first actor here no longer has a viable Death state.

If you want your actor to have a proper Death state, and have your actor to disappear entirely upon death, you will need your actor to have a Death state exactly like the second example you posted.
To me that does not explain why the loop is never initiated it is like the loop was not even there, is this a feature or a bug or what am i missing?
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Elias79 wrote:To me that does not explain why the loop is never initiated it is like the loop was not even there, is this a feature or a bug or what am i missing?
The first time this line is reached, user_test is 0, not 1*:

Code: Select all

TNT1 A 1 A_JumpIf(user_test != 1, "Death")
If user_test is not 1, it'll jump to the Death state. What happens in the Death state? The actor is removed from the game.

In actor #1, the Death state doesn't exist. So even if user_test is not 1, the state jump fails, and the state sequence is continued.


* This is because when the actor first spawns, the function on the first state is not called, unless you have the [wiki=Actor_states#NoDelay]NoDelay[/wiki] keyword on the state:

Code: Select all

TNT1 A 1 NoDelay A_SetUserVar("user_test", 1)
Locked

Return to “Editing (Archive)”