Page 1 of 1

HidDest Addon script issue: Pointer conversion issue

Posted: Sun Aug 23, 2020 4:12 pm
by Silentdarkness12
Having a bit of a conundrum here. So i'm working on an addon for Hideous Destructor to add in a way to repair armor. Been working on trying to get the basic functionality working first, such as drawing the text for it on the screen, but i'm running into something that I can't quite figure out.

https://pastebin.com/ZKkUHHqF

The specific problem seems to be this function here

Code: Select all

override void DrawHUDStuff(HDStatusBar sb,HDWeapon hdw,HDPlayerPawn hpl){
        if(!thisarmour||thisarmour.mags.size()<1)return;
        sb.beginhud(forcescaled:true);
        thisarmour.DrawHUDStuff(sb,self,hpl);
        sb.beginhud(forcescaled:false);
        }

Code: Select all

thisarmour.DrawHUDStuff(sb,self,hpl);
It crashes on load with this:

Code: Select all

Script error, "HidDest_ArmorPatchKit.pk3:zscript" line 99: Cannot convert Pointer<Class<HDArmorFixerer>> to Pointer<Class<MagManager>>
I've been spending a good while trying to wind my way backwards through the code to figure out what's going on. The problem is that the specific line up above thinks that i'm trying to tap HD's MagManager into my armor fixerer as a self, and the pointers can't convert. The thing is, I cannot work out for the life of me what exactly in the code is causing this to happen. It's not inheiriting from MagManager anywhere I can see. I'm hoping someone can help me see what i'm missing here.

Re: HidDest Addon script issue: Pointer conversion issue

Posted: Mon Aug 24, 2020 9:52 am
by Matt

Code: Select all

thisarmour.DrawHUDStuff(sb,self,hpl);
I have no idea what the intended effect of this line even is. Which properties of what actor is this intended to display?

EDIT: ThisArmour is casted as HDArmour which is a descendant of HDMagAmmo. HDMagAmmo's DrawHUDStuff function expect a descendant of MagManager where "self" is.

Re: HidDest Addon script issue: Pointer conversion issue

Posted: Mon Aug 24, 2020 10:32 am
by Silentdarkness12
Matt wrote:

Code: Select all

thisarmour.DrawHUDStuff(sb,self,hpl);
I have no idea what the intended effect of this line even is. Which properties of what actor is this intended to display?

EDIT: ThisArmour is casted as HDArmour which is a descendant of HDMagAmmo. HDMagAmmo's DrawHUDStuff function expect a descendant of MagManager where "self" is.
Thanks, that got it.