gurrenm3 / BTD-Mod-Helper

A powerful and easy to use API for modding BTD6, BATTD, and other Ninja Kiwi games.
https://gurrenm3.github.io/BTD-Mod-Helper/
GNU General Public License v3.0
178 stars 120 forks source link

Projectiles freeze #105

Closed b-0-x-3-d closed 1 year ago

b-0-x-3-d commented 1 year ago

I recently modified my mod to work on the latest version of BTD6, but my towers that fired projectiles have a strange effect, the projectiles they fire don't move at all. Any reasons as to why?

I provided the code for one such tower this is affecting.

public class Peashooter : ModTower
{
public override string Name => "Peashooter-Funni";
public override string DisplayName => "Peashooter";
public override string Description => "Sun isn't worth as much as it used to, so bananas must have to do!";
public override string BaseTower => "DartMonkey";
public override int Cost => 200;
public override int TopPathUpgrades => 0;
public override int MiddlePathUpgrades => 0;
public override int BottomPathUpgrades => 0;
public override TowerSet TowerSet => TowerSet.Primary;
public override string Get2DTexture(int[] tiers)
{
return "Peashooter";
}
public override bool Use2DModel => true;
public override void ModifyBaseTowerModel(TowerModel towerModel)
{
towerModel.range += 20;
var attackModel = towerModel.GetAttackModel();
attackModel.range += 20;

        var projectile = attackModel.weapons[0].projectile;
        projectile.ApplyDisplay<PeaDisplay>();
        projectile.pierce = 1;
    }
}
doombubbles commented 1 year ago

Well nothing looks like it'd affect the projectile at all apart from the PeaDisplay. If there are issues with that then it's possibly that could cause errors preventing the normal projectile functioning?