unrecognized type SpriteWidget

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

mat69

FNG / Fresh Meat
Aug 1, 2006
826
0
0
OK I tried to do a simple (simple is not even simple enough ;) ) mutator for myself.
Yet I have problems in compiling it, the compiler finds an error in one of the classes.

"Unrecognized type 'SpriteWidget' within 'Hud'"

Code:
Class testainteraction extends Interaction;

var Hud.SpriteWidget       testasdf;

[...]

It doesn't recognise "SpriteWidget", but I have no clue - if that is totally newbish you might have an image what simple meant. Changing "Hud" to "HudBase" or "ROHud" does not work either.
 

worluk

FNG / Fresh Meat
Nov 21, 2005
2,226
85
0
hm, interactions arent really on the easy side imo ;)

also i think there are some misconceptions in your snippet :)
You cant declare variables of a type that is defined in another code file or package.

If i interprete what you try to do right you will have to extend the ROHud and overwrite the relevant function there. Not sure if you can replace the used HUD directly or if you have to create a new gametype to replace it.

If you would describe what you are trying to do, one could help you bette ;)
 

mat69

FNG / Fresh Meat
Aug 1, 2006
826
0
0
I want to add an a texutre on the HUD. I read that there are two ways to do that, one by creating a new HUD yourself and the other by spawning a widget (or how it is called, right now I have no connection to my pc). On the unreal wiki someone said that it should be easiest the way I do it.

Interesting is though that the same code can be compiled for UT2K4.
When I'm at home with some spare time I'll post some more code.
 

worluk

FNG / Fresh Meat
Nov 21, 2005
2,226
85
0
hm, if it compiles for UT i might be wrong about the declaration thing, though i thought i looked into that in the past.
Well, i think that creating your own hud is faster anyway.
 

mat69

FNG / Fresh Meat
Aug 1, 2006
826
0
0
Ok, back home:

Code:
Class testainteraction extends Interaction;
#exec OBJ LOAD FILE=..\Textures\testasdf.utx

var GameReplicationInfo GRI;
var HudBase.SpriteWidget       testasdf; //worked in UT2k4

event Initialized()
{
    //log("Interaction Initialized");
    foreach ViewportOwner.Actor.DynamicActors(class'GameReplicationInfo', GRI)
        If (GRI != None)
            Break;
}



function PostRender( canvas Canvas )
{

HudBase(ViewportOwner.Actor.myHUD).DrawSpriteWidget(Canvas, testasdf); //only HudBase worked in UT2k4

}
[...]

That's what I have, I'll look into creating an own hud (should I extend ROHud?), maybe that will work.
Thanks for your reply!
 

mat69

FNG / Fresh Meat
Aug 1, 2006
826
0
0
:eek:
:eek: ^100

Well everything is allright with the code, but somehow - maybe it was myself, or my messing around with WOTgreal - it happened that the EditPackages were messed up. Well and I did not thought about it. gna


PS.: You are missing the smack your head against the wall smile here.