Non-lethal Energy Pellets in Portal 1
Quote from Mevious on July 23, 2014, 7:18 pmOne common complaint I see about energy pellets in Portal 1 is that they are instant death if you touch them. I'm trying to come up with a way to make pellets simply pass through the player instead of killing them.
My first attempt was to use a point_viewcontrol with "Make Player non-solid" checked and enable it for a second whenever an energy pellet gets close. This sort of works but is pretty buggy. Level transitions are sometimes broken, and the camera is at the same position as the player, but the angles are reset to 0. I'm looking for a better and less hacky solution. Can anyone think of a way to either make the pellets pass through the player or make the player not solid without messing with the view?
One common complaint I see about energy pellets in Portal 1 is that they are instant death if you touch them. I'm trying to come up with a way to make pellets simply pass through the player instead of killing them.
My first attempt was to use a point_viewcontrol with "Make Player non-solid" checked and enable it for a second whenever an energy pellet gets close. This sort of works but is pretty buggy. Level transitions are sometimes broken, and the camera is at the same position as the player, but the angles are reset to 0. I'm looking for a better and less hacky solution. Can anyone think of a way to either make the pellets pass through the player or make the player not solid without messing with the view?
Portal 1: Portal Pro, Resurrection, Dyad, Rexaura
Portal 2: [Coop] Electrophobia, [PTI] EotM Collection, [SP] Aperture Halloween
Quote from Skotty on July 23, 2014, 8:33 pmUse filter_damage on player and exclude prop_combine_ball there. Probably use logic_collision to make them pass through the player.
Use filter_damage on player and exclude prop_combine_ball there. Probably use logic_collision to make them pass through the player.
Quote from FelixGriffin on July 23, 2014, 11:11 pmThere's also a spawnflag on the point_combine_ball_launcher (but not the parentable point_energy_ball_launcher) which makes the balls bounce off the player instead of causing damage.
If you want the balls to explode when they hit the player (to prevent the player from reflecting them into catchers) you could put a trigger with a filter around the player which causes its !activator to Explode. To me this makes more in-universe sense than the balls going through the player's body, but it could still be exploited in certain puzzles (to cause a respawn exactly when you want it, or to kill a ball that's in the wrong place).
There's also a spawnflag on the point_combine_ball_launcher (but not the parentable point_energy_ball_launcher) which makes the balls bounce off the player instead of causing damage.
If you want the balls to explode when they hit the player (to prevent the player from reflecting them into catchers) you could put a trigger with a filter around the player which causes its !activator to Explode. To me this makes more in-universe sense than the balls going through the player's body, but it could still be exploited in certain puzzles (to cause a respawn exactly when you want it, or to kill a ball that's in the wrong place).
Quote from Mevious on July 24, 2014, 1:31 amSkotty wrote:Use filter_damage on player and exclude prop_combine_ball there. Probably use logic_collision to make them pass through the player.I see an entity called filter_damage_type. Is that what you mean? I don't see an entity that allows you to filter damage from a specific class.
I set up a trigger with the output:
OnTrigger !activator SetDamageFilter damage_filterThe filter_damage_type Filter mode was "Allow entities that match criteria" and I tried a few different damage types. This allowed me to make the player immune to acid damage for example, but the energy pellets kept killing me. I also tried "Disallow entities that match criteria", but predictably that only prevented the specific damage type.
I also tried a logic_collision_pair with Attachment 1 = !player; Attachment 2 = [name of the pellet (not the launcher)]; Start with collisions disabled = Yes. Even with god mode enabled, the pellet still hits me and explodes.
FelixGriffin wrote:There's also a spawnflag on the point_combine_ball_launcher (but not the parentable point_energy_ball_launcher) which makes the balls bounce off the player instead of causing damage.I'm using point_energy_ball_launcher rather than point_combine_ball_launcher. Combine_ball_launcher doesn't have "Ball lifetime" and "Min life after portal transition" properties that are used in Portal.
FelixGriffin wrote:If you want the balls to explode when they hit the player (to prevent the player from reflecting them into catchers) you could put a trigger with a filter around the player which causes its !activator to Explode. To me this makes more in-universe sense than the balls going through the player's body, but it could still be exploited in certain puzzles (to cause a respawn exactly when you want it, or to kill a ball that's in the wrong place).This could be a useful workaround, thanks for the suggestion. I'll try it out, but I would still prefer the no collision route.
Edit: I also just found out about logic_playerproxy and used that to set the damage filter to something that disallows "Launched by point_combine_ball_launcher", but still no luck.
Edit 2: Found a bit of a workaround, but it's still a little messy. I have a trigger parented to the player. Whenever an energy pellet hits it, it stops all player movement and enables noclip. When the pellet leaves the trigger, it disables noclip and allows player movement again. This is a little awkward because it stops all movement for half a second and requires sv_cheats 1 but it's still better than instant death.
I see an entity called filter_damage_type. Is that what you mean? I don't see an entity that allows you to filter damage from a specific class.
I set up a trigger with the output:
OnTrigger !activator SetDamageFilter damage_filter
The filter_damage_type Filter mode was "Allow entities that match criteria" and I tried a few different damage types. This allowed me to make the player immune to acid damage for example, but the energy pellets kept killing me. I also tried "Disallow entities that match criteria", but predictably that only prevented the specific damage type.
I also tried a logic_collision_pair with Attachment 1 = !player; Attachment 2 = [name of the pellet (not the launcher)]; Start with collisions disabled = Yes. Even with god mode enabled, the pellet still hits me and explodes.
I'm using point_energy_ball_launcher rather than point_combine_ball_launcher. Combine_ball_launcher doesn't have "Ball lifetime" and "Min life after portal transition" properties that are used in Portal.
This could be a useful workaround, thanks for the suggestion. I'll try it out, but I would still prefer the no collision route.
Edit: I also just found out about logic_playerproxy and used that to set the damage filter to something that disallows "Launched by point_combine_ball_launcher", but still no luck.
Edit 2: Found a bit of a workaround, but it's still a little messy. I have a trigger parented to the player. Whenever an energy pellet hits it, it stops all player movement and enables noclip. When the pellet leaves the trigger, it disables noclip and allows player movement again. This is a little awkward because it stops all movement for half a second and requires sv_cheats 1 but it's still better than instant death.
Portal 1: Portal Pro, Resurrection, Dyad, Rexaura
Portal 2: [Coop] Electrophobia, [PTI] EotM Collection, [SP] Aperture Halloween