Moshman Posted April 20, 2009 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: 0 Share this post Link to post
EarthQuake Posted April 20, 2009 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. 0 Share this post Link to post
Moshman Posted April 20, 2009 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? 0 Share this post Link to post
Moshman Posted April 21, 2009 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 } } 0 Share this post Link to post
40oz Posted April 21, 2009 What's wrong with the Hexen Wendingo attack? 0 Share this post Link to post
Moshman Posted April 22, 2009 Hexen Wendingo attack? Um... what's that? 0 Share this post Link to post
Lüt Posted April 22, 2009 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. 0 Share this post Link to post
40oz Posted April 22, 2009 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. 0 Share this post Link to post
Moshman Posted April 23, 2009 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. 0 Share this post Link to post