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.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Ghostbreed wrote:The new actor will collide with the original?
Not sure what you mean by "collide", here?
User avatar
Ghostbreed
Posts: 1114
Joined: Wed Mar 24, 2010 6:19 am

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

Post by Ghostbreed »

Blue Shadow wrote:
Ghostbreed wrote:The new actor will collide with the original?
Not sure what you mean by "collide", here?
Image
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

When replacing something like a monster, for instance, don't give it the same DoomEd number nor the same actor name, and instead use the replaces keyword. Here is an example:

Code: Select all

ACTOR MyLovlelyCacodemon : Cacodemon replaces Cacodemon
{
  BloodColor "Blue"
}
User avatar
Ghostbreed
Posts: 1114
Joined: Wed Mar 24, 2010 6:19 am

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

Post by Ghostbreed »

Thanks!
User avatar
MONKET
Posts: 70
Joined: Mon Oct 20, 2008 2:16 pm

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

Post by MONKET »

How do I have different melee puff sounds between bleeding and non-bleeding actors? I looked at the wiki article for bulletpuffs and searched the issue, but I could never seem to get it right. I can have the normal sounds play when hitting a wall or a bleeding actor, but while I want to make the puff make the same effect as hitting a wall when it hits a non-bleeding actor, it makes the same noise as hitting a bleeding one. Here's my code so far if anyone can help me out:

Code: Select all

ACTOR RockPuff
{
  +NOBLOCKMAP
  +EXTREMEDEATH
  +NOGRAVITY
  +ALLOWPARTICLES
  +RANDOMIZE
  VSpeed 1
  Mass 1
  attacksound "rockhit"
  SeeSound "hit"
  +PUFFONACTORS
  States
  {
    Crash:
	Death:
     TNT1 A 0
     TNT1 A 1
     stop
  Spawn:
  Melee:
    TNT1 A 0
    TNT1 A 1
    stop
  }
}
EDIT: Nevermind, fixed it. Didn't realize XDeath covered bleeding actors.
User avatar
Orangestar
Posts: 23
Joined: Sat Mar 17, 2012 12:51 pm
Contact:

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

Post by Orangestar »

So I've got a script running when an actor enters a sector (Thing 9998), and another script when an actor leaves the sector (Thing 9997). Can I make a script run when an actor dies inside of the sector?
Dave_B
Posts: 54
Joined: Tue Jun 08, 2010 8:20 am

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

Post by Dave_B »

I'm trying to make a map with multiple map spot points and setting up a script to spawn a monster at each point randomly every time the map loads. I have a basic script working, however the monster count for the total number of monsters spawned seems to vary slightly, rather than according to the number strictly specified in my script. How do I get my script to randomly spawn the exact same number of monsters across the map spots every time, and to spawn at each map spot only once, as I think that may also be part of my problem. Thanks.
User avatar
cocka
Posts: 1520
Joined: Sat Jul 02, 2011 7:21 am
Location: Hungary

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

Post by cocka »

Can I make a script run when an actor dies inside of the sector?
Of course. Use a DEATH script with a map variable checking whether you are in the sector or not.

actor enters a sector (Thing 9998) -> set your variable to 1.
actor leaves the sector (Thing 9997) -> set your variable to 0.

Then you should write in the DEATH script something like this:

Code: Select all

if(var == 1)
{
// your code
}
User avatar
Orangestar
Posts: 23
Joined: Sat Mar 17, 2012 12:51 pm
Contact:

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

Post by Orangestar »

cocka wrote:
Can I make a script run when an actor dies inside of the sector?
Of course. Use a DEATH script with a map variable checking whether you are in the sector or not.
Well, the script is primarily multiplayer...

So I have four sectors that players enter and exit freely, and on enter I have it change their TID to 100X, where X is the sector they have entered. (Sector 1 would be 1001, Sector 2 would be 1002...)
On leaving the sector, their TID is reset to 1000.
Additionally, when entering the sector, a separate variable is increased, labeled "pointXpeople", to list how many people are on each point.

The problem I seem to be having now is that I'm unable to change TIDs on a whim like that. It just stays at 1000 since that's what players spawn with. Does a TID have to be 0 before I can change it?

EDIT: Scratch that! I had an extra Thing_ChangeTID line in my ENTER script. My mistake!
The_Funktasm
Posts: 612
Joined: Tue Mar 17, 2009 5:12 am
Location: done making ZDF free sprites

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

Post by The_Funktasm »

I'm trying to make a deeply coded AI system for enemies and allies. How would anyone here make a grenade throwing monster check for any friends in the range of the grenade they throw? On that same note, how would you have them throw it? What I've tried is rather buggy. I would appreciate knowing just what I'm doing wrong here, or how better to do it. I'm not sure if I'm just not keeping proper track of jumps, not using things right, or code illiterate.

Code: Select all


	FireCheck:
		CPOS A 2 A_FaceTarget
		CPOS A 6 A_CheckLOF (1, CLOFF_JUMPFRIEND|CLOFF_SKIPENEMY, 5500, 0, 0, 0, 0, 0, AAPTR_DEFAULT)
		Goto FireCheck+4
		loop
		CPOS A 0 A_JumpIfCloser(24,2)
		CPOS A 0 A_Jump(210,1)
		CPOS A 0 A_JumpIfInventory("GrenadeItem",1,"Grenade")
		CPOS A 0 A_JumpIfInventory("ARInClip",2,1)
		goto Reload
		CPOS A 0 A_Jump(250,"Fire1","Fire2","Fire3")
		CPOS A 1
		CPOS G 34 A_Playsound("weapons/click")
		CPOS A 0 A_TakeInventory("Morale",8)
		Goto Reload
         Grenade:
		CPOS B 0 A_Jump(35, "Retreat")
		CPOS E 0 A_FaceTarget
		CPOS A 5 A_CheckLOF ("Retreat",CLOFF_JUMP_ON_MISS|CLOFF_SKIPENEMY, 5500, 0, 0, 0, 38, 0, AAPTR_DEFAULT)
		CPOS B 5 A_FaceTarget (45)
		CPOS E 6 //A_PlaySound("enemies/gruntjump")
		SPOS E 0 A_CustomMissile("ThrownFragGrenadeAI",32,10,frandom(3.5,3.5),0,32)
		CPOS E 0 A_TakeInventory("GrenadeItem")
		CPOS BC 6 //A_UnSetReflectiveInvulnerable
		Goto Retreat

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 »

One possible alternative might be to throw an invisible grenade actor that then spawns a bunch of actors representing the blast radius, then whenever it hits a friendly it can tell its owner/target "no shot" (e.g., with A_GiveToTarget) and the owner can respond accordingly.

No idea how to do "whenever it hits a friendly" though, unless you had some contrived setting where only friendlies bleed blood or something.


My question: How do you check if an actor's target is dead, without calling A_*Refire? (EDIT for posterity, because I forgot at first too: I don't want to call A_*Refire because I don't want the actor to face the target, which is implied in that function.)

EDIT2: Thanks, Blue Shadow! Confirms what I'd been afraid of... though it turns out the specific thing I wanted a A_CPosRefire was perfectly fine to use.
Last edited by Matt on Sun Jun 30, 2013 6:11 pm, edited 2 times in total.
Blue Shadow
Posts: 5046
Joined: Sun Nov 14, 2010 12:59 am

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

Post by Blue Shadow »

Vaecrius wrote:How do you check if an actor's target is dead, without calling A_*Refire?
The only way I can think of is to run a script to check on the target's health to see if it's dead or not, like this:

Code: Select all

Script "blah blah" (void)
{
  SetActivatorToTarget(0); // The target becomes the activator of the script, because we want to check on its health

  If(GetActorProperty(0, APROP_Health) <= 0) SetResultValue(TRUE); // Target is dead
  Else SetResultValue(FALSE);
}
In DECORATE:

Code: Select all

A_JumpIf(CallACS("blah blah") == TRUE, "TargetIsDead") // Jumps to TargetIsDead state if the target is dead
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 »

Got another one.

So I want to specify spawnofs_z for [wiki]A_CustomRailgun[/wiki], but I just want particles not any spawnclass. What do I write down for spawnclass so I don't get this ugly yellow warning?

EDIT: Turns out "none" with or without quotes works just fine.
Last edited by Matt on Sun Jun 30, 2013 11:58 pm, edited 1 time in total.
User avatar
Andie
Posts: 53
Joined: Sun May 19, 2013 3:33 pm

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

Post by Andie »

What is one most popular way to make transparent walls/doors? I had a page bookmarked on telus.net, there were like 8 ways or so described, but it went down a few weeks ago.
User avatar
Kappes Buur
 
 
Posts: 4199
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

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

Post by Kappes Buur »

Andie wrote:..... I had a page bookmarked on telus.net, .......
Are you by any chance thinking of this webpage.
Locked

Return to “Editing (Archive)”