1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

[Solved] Making a ballista bolt-based projectile not destroy blocks, and fixing ballista

Discussion in 'Modding Help' started by Frikman, Jul 7, 2016.

  1. Frikman

    Frikman Bison Rider

    Messages:
    162
    Hi, I have two issues this time. The first one, I'm using a ballistabolt-based projectile (cannonball) on some vehicles and I want to disable map destruction on said projectile, as it's making it useless most of the time because you end up ruining your own base instead of zombies.

    The second issue, Ballista isn't working properly. No matter how much bolts I charge into it, it won't shoot. Any clue of what causes it? Here's a video of both issues, and the files are at the end of the post.

     

    Attached Files:

    PUNK123 likes this.
  2. blackjoker77777

    blackjoker77777 Haxor Tester
    1. Zen Laboratories

    Messages:
    441
    Hey Frikman, in case you still haven't found a solution for the above issues, this might help you fixing them.
    I think you're basically asking for a way to make them deal no damage to tiles (including maps ones).
    Thinking about this I've got two simple solutions, feel free to pick the one that suits you better.
    Sol.1:
    You can simply disable these two lines:
    Code:
    BallistaHitMap( this, map.getTileOffset(temp), temp, initVelocity, dmg, Hitters::bomb );
    this.server_HitMap( temp, initVelocity, dmg, Hitters::bomb );
    So it's supposed to look something like this:
    upload_2016-7-16_20-32-53.png
    If you do that, and try it out you'll realize something interesting, that CannonBall keeps killing blobs from other teams. The funny thing? when it faces a tile it goes through it, literally.
    That means you can shoot through walls, ground, ...
    Despite the fact that such a thing could be surprisingly hilarious if used correctly, keep in mind that using it this way means that these cannon balls' blobs would only get deleted after some long time, in other words causing some fps drops at times and provoking performance issues (without mentioning that it requires 0 skill to kill a zombie through a wall...).
    If you're seeing this from my own perspective then you'd probably prefer the second solution.
    Sol.2:
    Just do the same as the solution 1, but this time we'll force the cannon balls to get deleted in case they collide with a tile by adding this:
    Code:
    this.server_Die();
    So you're supposed to have something like this (surely not with my silly comments but still).
    upload_2016-7-16_20-42-10.png
    Let's just be clear, this solution as any other one isn't perfect, but I believe it would do the trick.
    So after applying that, whenever your cannon ball hits a tile it would be deleted, if it hits an enemy it would probably kill him.
    Why did I mention that this isn't a perfect one? well let's imagine an enemy standing somewhere, if you throw a cannon ball and it happens to fall 1 block away from your target it would be wasted, so you're basically supposed to have a sniper-like skills in order to use these weapons effectively.
    The bright side? you'll be facing tons of zombies so based on probability laws, you'd probably hit an enemy at least.
    Your "Ballista.as" script is working fine, whereas we can't say the same about the "VehicleCommon.as".
    Not sure what's damaged in it, I reviewed it twice and I still didn't manage to locate the exact issue.
    The simplest solution would be to use the vanilla "VehicleCommon.as" script and editing it, while constantly debugging it (if you're in need of making customizations to it ofc).
     
    Sytoplasma, Frikman and makmoud98 like this.
  3. Frikman

    Frikman Bison Rider

    Messages:
    162
    Using the vanilla file works fine for the ballista, the modified one is important only for flyers so I can just set them to use a different one. As for the projectiles, thanks!
    That explains quite a lot. While trying to solve this I deleted those lines and the projectiles were flying through almost everything, didn't know that's the place I had to set the projectile to die.
     
    blackjoker77777 likes this.