Rachael wrote: ↑Tue Aug 09, 2022 11:17 pm
I'm trying to explain to you about null pointers and you're still going on about checking actor properties without even checking if they exist first.
Well - I did what I could to help you, I even provided you with some code. It's all in your hands, now.
Oh my bad for not clarifying, I did null check the pointers after you told me to. It runs now, but the script currently is doing nothing. Im assuming because it isn't being called correctly.
Bool SeeYou;
Override Void Doeffect()
{
if (target != null && owner != null)
{
Let TargetAngle = deltaangle(owner.angle, owner.AngleTo(target));
Let angle = (TargetAngle - owner.angle + 1.0) % 1.0;
if(owner.angle < 0.2 || owner.angle > 0.8)
{
int sx = 320 - (320 * Sin (angle) / Cos (angle));
Seeyou = true;
}
else
{
Seeyou = false;
}
}
super.DoEffect();
}
I think using DoEffect() to check if the Bool is true, and if it's true check for it in the modify damage function?
Override Void ModifyDamage (int damage, Name damageType, out int newdamage,
bool passive, Actor inflictor, Actor source, int flags)
if (passive && damage > 0)
{
if(seeyou == true)
{
DoStuff();
A_PrintBold("Works!");
}
}
I understand if you can't help me further, I still appreciate what you were able to provide so that I could progress forward.