Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
DoomeDx

Activate on impact, but only when the bottom side is hit. Possible?

Recommended Posts

Is this possible? I am aware that IDTech1 has limitations when it comes to detecting height and that you are (technically) playing in 2d space in terms of how walls work. But with the massive improvements that GZDoom provides, is it possible to only detect projectiles impacts when it's on the bottom side of a linedef?

 

https://imgur.com/a/L08pw
I created destructible crates and everything works well, except for one thing: They also break when shooting above it.

 

Any ideas on a fix?

Script:


str items[100] = {"GibbedMarine ", "stimpack", "shellBox", "clip", "cell", "medikit", "RocketBox", 
				"ClipBox", "HandGrenade", "ThrownGrenade1Trap", "GreenArmor",
				"Stimpack", "HealthBonus", "DeadMarine", "shell", "Stimpack", "backpack", 
				"ExplosiveBarrel"};
str crateHits[3] = {"dest/hcrate1", "dest/hcrate2", "dest/hcrate3"};
str crateBreaks[3] = {"dest/crate1","dest/crate2","dest/crate3"};
script 3 (int wallID, int particleID, int health)
{
	if (health <= 0) {
		str item = items[random(0,26)];
		SetLineSpecial(wallID, 0,0,0,0,0);
		SpawnSpot("CrateSmoke", particleID);
		playSound(particleID, crateBreaks[random(0,2)],0,1.0);
		Sector_SetTranslucent(wallID, 0, 0, 0);
		
		///	ANIMATION ////
		setlinetexture (wallID, SIDE_FRONT, TEXTURE_BOTTOM, "t1crate");
		setlinetexture (wallID, SIDE_BACK, TEXTURE_BOTTOM, "t1crate");
		delay(3);
		setlinetexture (wallID, SIDE_FRONT, TEXTURE_BOTTOM, "t2crate");
		setlinetexture (wallID, SIDE_BACK, TEXTURE_BOTTOM, "t2crate");
		delay(3);
		setlinetexture (wallID, SIDE_FRONT, TEXTURE_BOTTOM, "t3crate");
		setlinetexture (wallID, SIDE_BACK, TEXTURE_BOTTOM, "t3crate");
		delay(3);
		setlinetexture (wallID, SIDE_FRONT, TEXTURE_BOTTOM, "t4crate");
		setlinetexture (wallID, SIDE_BACK, TEXTURE_BOTTOM, "t4crate");
		delay(3);
		///	ANIMATION END ////
		
		Floor_LowerByValue(wallID, 100000000, 37);
		Setlineblocking(wallID,OFF);
		setlinetexture (wallID, SIDE_FRONT, TEXTURE_MIDDLE, "-");
		setlinetexture (wallID, SIDE_BACK, TEXTURE_MIDDLE, "-");
		setlinetexture (wallID, SIDE_FRONT, TEXTURE_TOP, "-");
		setlinetexture (wallID, SIDE_BACK, TEXTURE_TOP, "-");
		ChangeFloor(wallID, "WOOD8");
		setlinetexture (wallID, SIDE_FRONT, TEXTURE_BOTTOM, "WOOD8");
		setlinetexture (wallID, SIDE_BACK, TEXTURE_BOTTOm, "WOOD8");	
		SpawnSpot(item, particleID);
		if (item == "ThrownGrenade1Trap") {
			SetFont("BIGFONT");
			HudMessage(s: "LIVE GRENADE !!"; HUDMSG_PLAIN, 0, CR_green, 0.5, 0.32, 3.7);
		}
	} else {
		playSound(ParticleID, crateHits[random(0,2)],0,1.0);
		SetLineSpecial(wallID, 80,3,0,WallID,ParticleID,Health-1);
	}
}

 

Share this post


Link to post
3 hours ago, DoomeDx said:

(technically) playing in 2d space in terms of how walls work

What

 

You seem to have a rather weird and grossly misinformed idea on how Doom works. You are playing in a 3D space (Doom just doesn't rely on 3D vectors for collision math, which results in oddities and inconsistencies), and it's perfectly possible for it to identify if an upper or lower wall is struck, it need it to be able to do the collision in the first place. The question is how it's exposed to whatever you have on hand. In this case as you can't create upper or lower triggers, you need a script that triggers on wall collision and then to check the height of the thing that collided from the script.

As of the last time I ever cared to check, you can do this exclusively with projectiles by using MissilesActivateImpactLines from mapinfo, and than checking the height of the thing that collided (and also that it is actually a projectile).

Edited by Edward850

Share this post


Link to post
50 minutes ago, Edward850 said:

What

 

You seem to have a rather weird and grossly misinformed idea on how Doom works. You are playing in a 3D space (Doom just doesn't rely on 3D vectors for collision math, which results in oddities and inconsistencies), and it's perfectly possible for it to identify if an upper or lower wall is struck, it need it to be able to do the collision in the first place. The question is how it's exposed to whatever you have on hand. In this case as you can't create upper or lower triggers, you need a script that triggers on wall collision and then to check the height of the thing that collided from the script.

As of the last time I ever cared to check, you can do this exclusively with projectiles by using MissilesActivateImpactLines from mapinfo, and than checking the height of the thing that collided (and also that it is actually a projectile).

I based my knowledge on this video: 

 

Share this post


Link to post

Just because you saw it in a video, that doesn't automatically make it correct. ;)

Especially videos from a guy trying to describe how Doom works without probably ever having touched the easily available source code (and failing some rather blatant observations about how projectiles and autoaim works).

Edited by Edward850

Share this post


Link to post
58 minutes ago, DoomeDx said:

I based my knowledge on this video: 

 

Well there's your problem, that video is full of shit. I haven't watched it in a while, but I clearly remember him saying entities don't have 3d collision detection RIGHT AS an imp fireball goes over the players head in the video. Also he says enemies and the player are supposedly locked to a 2d plane but completely ignores player and enemy heights, falling, and in the case of newer ports like zdoom, jumping, which would have been very easy to do in vanilla

Share this post


Link to post

I have hit this issue myself in making a trigger not be triggerable from above the physical switch or line. I couldn't find a way to fix it. The only thing that came to mind was a floating invisible 3D floor above the trigger line that can't be shot through or something.

Share this post


Link to post

I could've sworn this was the Doom Editing forum, not the Excessive Pedantry forum.

Share this post


Link to post
6 hours ago, Xaser said:

I could've sworn this was the Doom Editing forum, not the Excessive Pedantry forum.

 

This is actually the Doom Editing subforum :0)

Share this post


Link to post
8 hours ago, Grain of Salt said:

 

This is actually the Doom Editing subforum :0)

It's actually a Chinese cartoon discussion board.

Share this post


Link to post
8 minutes ago, GarrettChan said:

I thought there's something to do with plagiarism...

Nope, just good ol' shitposting.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×