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

Reflective shots?

Recommended Posts

Is it possible to create projectiles that reflect of walls?

Also is it possible to spawn projectiles from an exploding projectile but have it so the projectiles spawn consistently from the wall?

Here is an illustration:

Share this post


Link to post

I'm not sure the second scenario is possible, but it's definitely possible to get projectiles to bounce off walls and floors in ZDoom. Look at the ZDoom wiki for the corresponding DeHackEd thing flags or the DECORATE actor properties. You will find what you need there.

Eternity or MBF might have similar thing flags/behaviors, although don't hold me to my word.

Share this post


Link to post

Hmm...
Maybe what I could do is have the spawned projectiles have a temporal bounce off walls flag or something for 0.1 seconds. Because I don't want to spawn like 10 projectiles in a 360 degree spread and have half of them explode into the wall while the rest shoot out because, a: it just looks sloppy, and b: if the master projectile explodes on to an enemy, it will do ridiculous amounts of damage due to half the projectiles spawning into the enemy.
Is there a way I can change flags in a projectile after a given period of time?

Share this post


Link to post

Ok.. Here my solution:

actor TShard_1
{
radius 9
height 4
damage 5
speed 25
Scale -0.6
+RANDOMIZE
RenderStyle normal
seesound "weapons/pistolshard"
deathsound "weapons/sharddeath"
PROJECTILE
states
{
Spawn:
SHRD ABC 3 bright
loop
Death:
SHDT A 0 BRIGHT A_CustomMissile("TShard_2",0,0,315,2,0)
SHDT A 0 BRIGHT A_CustomMissile("TShard_2",0,0,45,2,0)
SHDT A 0 BRIGHT A_CustomMissile("TShard_2",0,0,135,2,0)
SHDT A 0 BRIGHT A_CustomMissile("TShard_2",0,0,255,2,0)

SHDT ABCDEFG 3 bright

stop
}
}

actor TShard_2
{
+HEXENBOUNCE
radius 2
height 3
damage 2
speed 12
Scale 0.5
wallbouncefactor 20
+RANDOMIZE
RenderStyle Normal
seesound ""
deathsound "weapons/sharddeath"
PROJECTILE
states
{
Spawn:
SHRP ABC 2 bright
TNT1 A 0 A_ChangeFlag(HEXENBOUNCE, 0) //Gives T_Shard2 6 tics until reflective properties are removed. Enough time to bounce off the facing wall in order to save having to spawn unnecessary projectile to make a proper spread. You won't waste projectiles spawning into the wall to just die.
loop

Death:
SPDT ABCDEFGHI 5
stop
}
}

Share this post


Link to post

What's wrong with the Hexen Wendingo attack?

Share this post


Link to post

The ice monster.

And Dark Forces had some special walls/floors that allowed lazer weapon shots to reflect around the room 5 or 6 times before they finally died out. So as long as they're projectiles, maybe you could take a bit of inspiration from that code.

Share this post


Link to post
Moshman said:

Hexen Wendingo attack? Um... what's that?


Or Heretic's Iron Lich also did a similar attack. It would shoot some ice ball or something, and whenever it made contact with something, it would shoot shrapnel in 8 different directions.

According to what it looks like on your demonstrations, you don't want any shrapnel hitting the wall. Personally I don't see why not.

Share this post


Link to post

The thing is is that I wanted to create a sharp crystal projectile that would break off into four pieces, shot out at 45 degree angles. The thing I didn't like was that when it exploded against a wall, two of the shrapnel would be spawned facing the wall and would explode immediately, making the two projectiles useless. Additionally, when it hit an enemy, it would do ridiculous amounts of damage because the two shrapnel would spawn facing the enemy. I looked at example of what other people did and a lot of people claimed to have solved the problem by just spawning more projectiles, that way I would be sure that I would get four shooting out from the wall. Well that would just make it that much more damaging and it would look sloppy. You'd have something shoot 16 projectiles and most of them would be useless due to spawning into the wall.

So my solution was to give the projectile enough time to spawn facing the wall, it to reflect off the wall and then the reflective properties to be removed so they can hit a wall or an enemy. This is just a work around as the projectiles are not meant to be reflective.

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
×