How do I make my forcefield instakill player?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
gunrock
Posts: 26
Joined: Sat May 16, 2020 4:19 am

How do I make my forcefield instakill player?

Post by gunrock »

Im using the forcefield decorate I took from Realm667 website. How can I make this forcefield kill the player instantlly when it is active? Then disable when its been turned off?
Here is the script code that I have so far.

Spoiler:
User avatar
Misery
Posts: 158
Joined: Sun Nov 04, 2018 4:57 pm

Re: How do I make my forcefield instakill player?

Post by Misery »

Well, I made an insta-kill forcefield this way. First, I set the linedef with tag of 1 and a Thing_Damage special (Action Special 73) that deals 10,000 damage. Then I made a switch that uses the following code.

Code: Select all

script 1 (void)

{
	SetLineSpecial (1, "", 0);
}
Will that work for your purposes?
User avatar
Enjay
 
 
Posts: 27146
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: How do I make my forcefield instakill player?

Post by Enjay »

Misery wrote:Thing_Damage special (Action Special 73) that deals 10,000 damage.
Minor clarification:

[wiki]DamageThing[/wiki] is action special 73. [wiki]Thing_Damage[/wiki] is action special 119.

In this case I think that DamageThing would be the best one to use because it doesn't take a thing tag as an argument and setting damage to 0 guarantees a kill.
User avatar
Misery
Posts: 158
Joined: Sun Nov 04, 2018 4:57 pm

Re: How do I make my forcefield instakill player?

Post by Misery »

[Deleted]
Last edited by Misery on Fri Aug 05, 2022 10:14 pm, edited 1 time in total.
gunrock
Posts: 26
Joined: Sat May 16, 2020 4:19 am

Re: How do I make my forcefield instakill player?

Post by gunrock »

Thanks as always!!
Post Reply

Return to “Scripting”