Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - ElPresidente

Pages: 1 ... 9 10 [11]
151
Modding / Code question
« on: April 18, 2021, 04:05:53 AM »
I have a tiny mod that I put together for my own personal use, mostly by kitbashing and jurry-rigging. It worked in 0.91.

Now I'm getting the errors on a plugin for a weapon.
OnHitEffectPlugin.onHit, something about missing ApplyDamageResultAPI??? I looked up the StarSecor API and I see that onHit now takes one more parameter, so I added it. Still getting errors

Caused by: java.lang.ClassNotFoundException: File 'data/scripts/plugins/ElectrifyEffect.java', Line 17, Column 63: Cannot determine simple type name "ApplyDamageResultAPI


Like I said, I'm no programmer. I just want to get this working. What am I missing?

Code
package data.scripts.plugins;

import java.awt.Color;
import org.lwjgl.util.vector.Vector2f;

import com.fs.starfarer.api.combat.CombatEngineAPI;
import com.fs.starfarer.api.combat.CombatEntityAPI;
import com.fs.starfarer.api.combat.DamageType;
import com.fs.starfarer.api.combat.DamagingProjectileAPI;
import com.fs.starfarer.api.combat.OnHitEffectPlugin;
import com.fs.starfarer.api.combat.ShipAPI;

public class ElectrifyEffect implements OnHitEffectPlugin {


public void onHit(DamagingProjectileAPI projectile, CombatEntityAPI target,
  Vector2f point, boolean shieldHit, [b]ApplyDamageResultAPI damageResult[/b], CombatEngineAPI engine) {
if ((float) Math.random() > 0.75f && !shieldHit && target instanceof ShipAPI) {

float emp = projectile.getEmpAmount();
float damage = projectile.getDamageAmount();

engine.spawnEmpArc(projectile.getSource(), point, target, target,
   DamageType.ENERGY,
   damage,
   emp, // emp
   100000f, // max range
   "tachyon_lance_emp_impact",
   20f, // thickness
   new Color(280,230,130,120),
   new Color(200,152,1352,255)
   );
}
}
}

Pages: 1 ... 9 10 [11]