TheRPGAdventurer Posted January 14, 2018 Share Posted January 14, 2018 It's been long now since DM made their dragons breathe fire, how do other mods breathe fire, how do other mods make their flamethrower or hydra from Twilight Forest make their mob breathe fire? In entities it's clear that you should make an AI for it. Quote Link to comment Share on other sites More sharing options...
Alexiy Posted January 14, 2018 Share Posted January 14, 2018 One of the dumbest ways might be checking if there are entities in front of the attacker, and deal damage to these entities, while spawning fire particles. The tricky thing might be making the particles flow in the correct direction, because you will have to use trigonometry for that. 1 Quote Link to comment Share on other sites More sharing options...
Ugdhar Posted January 14, 2018 Share Posted January 14, 2018 4 hours ago, TheRPGAdventurer said: hydra from Twilight Forest make their mob breathe fire? Twilight Forest is open source: https://github.com/TeamTwilight/twilightforest Quote Link to comment Share on other sites More sharing options...
oldcheese Posted January 14, 2018 Share Posted January 14, 2018 (edited) 5 hours ago, Alexiy said: One of the dumbest ways might be checking if there are entities in front of the attacker, and deal damage to these entities, while spawning fire particles. The tricky thing might be making the particles flow in the correct direction, because you will have to use trigonometry for that. Basically this is the most efficient way for the computer. The only difficulty is that you'll hit people who aren't in line of sight, but even this could technically be fixed by doing raytracing between the entity and whoever is getting hit. . You can figure out where a mob's mouth is using maths. Then spawn a bunch of particles and hurt people in a cone in front of it. The second, much easier but much convoluted and CPU-intensive way is to make projectiles shoot from the mob's mouth in a spray. This would also make sure that the 'fire' is stopped by walls. Make a big, square invisible projectile and simply force it to spawn a ton of fire/different particles behind it. Then make it set on fire and deal fire damage on hit. You can look at the EntitySmallFireball for hints on how to spawn particles and whatnot. Edited January 14, 2018 by oldcheese Quote Link to comment Share on other sites More sharing options...
KittenKoder Posted January 14, 2018 Share Posted January 14, 2018 I would use the arrow logic, as if it was an arrow fired from a bow, but use tiny fires instead of arrows. So I would recommend looking into how the bow and arrows work. Quote Link to comment Share on other sites More sharing options...
oldcheese Posted January 14, 2018 Share Posted January 14, 2018 1 hour ago, KittenKoder said: I would use the arrow logic, as if it was an arrow fired from a bow, but use tiny fires instead of arrows. So I would recommend looking into how the bow and arrows work. It's more usefull to look into the ghast, in this case. Since the ghast launches a projectile as part of it's AI already. Either way. I'd strongly advise using raytracing and particles rather than firing a ton of tiny arrows. Or at the very least fire a few arrows instead of one for each particle. Unless it's only used sparsely. Otherwise having 10-20 of these fire monsters would shoot 100 entities every attack. Quote Link to comment Share on other sites More sharing options...
KittenKoder Posted January 14, 2018 Share Posted January 14, 2018 1 minute ago, oldcheese said: It's more usefull to look into the ghast, in this case. Since the ghast launches a projectile as part of it's AI already. Either way. I'd strongly advise using raytracing and particles rather than firing a ton of tiny arrows. Or at the very least fire a few arrows instead of one for each particle. Unless it's only used sparsely. Otherwise having 10-20 of these fire monsters would shoot 100 entities every attack. I was talking about using it for the physics logic as it makes sense that there would be a falloff point, unlike the ghast fireballs. It would also need to be dodgeable, would it not? You won't be able to avoid spawning in more entities with something like this, limiting the number of mobs which use it that spawn in at any given point would be a better choice anyway. Another place to check would be Mekanism's flame thrower for the best example of the mechanisms involved. Mekanism has issues, but the flamethrower worked well and used a "spawning in a bunch of entities" method. 1 Quote Link to comment Share on other sites More sharing options...
oldcheese Posted January 14, 2018 Share Posted January 14, 2018 (edited) 23 minutes ago, KittenKoder said: I was talking about using it for the physics logic as it makes sense that there would be a falloff point Yeah, that's the only thing you can't do with the raytrace method, dodging. I guess it depends on what the player wants. Either way, you raise some fair points. Also, does the bow actually do less damage when you hit from afar? I thought it based it on the charge time. It'd be a lot easier to just implement the ticksexisted time and then base damage on the reverse of that. I imagine you woudln't want gravity for a flamethrower, or even reverse the gravity, then setDead() if ticks existed goes too high. Edited January 14, 2018 by oldcheese 1 Quote Link to comment Share on other sites More sharing options...
KittenKoder Posted January 14, 2018 Share Posted January 14, 2018 6 minutes ago, oldcheese said: Also, does the bow actually do less damage when you hit from afar? I thought it based it on the charge time. I don't think it does, but it would be easy to add such a thing. Since the entity has to tick anyway, just add some modifier to the damage that ticks with it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.