For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

[solved] String to GetNextIntDesc

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
LannFyre
OldUnreal Member
Posts: 157
Joined: Fri Mar 13, 2015 7:01 am

[solved] String to GetNextIntDesc

Post by LannFyre »

Code: Select all

Object=(Name=Sprite_Lann.Stand0_,Class=Class,MetaClass=RPG_Game_dev.RPG_SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
I am attempting to read an .int file, but I am getting this error:
Failed to find object 'Class Any, RPG_Game_dev.Sprite_RPG_LionPlatformer'

I am calling it via:

Code: Select all

targStr = RPG_Game_dev.RPG_LionPlatformer0
-> RPG_LionPlatformer0
-> RPG_LionPlatformer
intStr = "RPG_Game_dev.Sprite_"$targStr;
GetNextIntDesc(intStr,0,testStr,testDesc);
The int file is:
Sprite_RPG_LionPlatformer.int

Why would I generally be receiving this error?  I'm working on a text parser that grabs an actor and uses their actor name (RPG_LionPlatformer) and applies it to a generalized string (RPG_Game_dev.Sprite_).
Last edited by LannFyre on Wed Jun 28, 2017 9:23 pm, edited 1 time in total.
i tryin'a be a gud boi
User avatar
.:..:
OldUnreal Member
Posts: 1637
Joined: Tue Aug 16, 2005 4:35 am

Re: String to GetNextIntDesc

Post by .:..: »

MetaClass must always be a valid class name.

Also if you plan to use object desc, then you should use 227 function:

Code: Select all

native(313) final iterator function IntDescIterator( string ClassName, optional out string EntryName, optional out string Desc, optional bool bSingleNames );
to search for them as it's much faster then epic's shitty GetNextIntDesc (as it always builds up a dynamic array and grab a single entry from it).

I'm not sure how you are planning to setup this, but it sounds like you should rather use Localize for a task like this (if you have multiple objects to localize texture names for):

Code: Select all

native static function string Localize( string SectionName, string KeyName, string PackageName );

Texture = Texture(DynamicLoadObject(Localize("TexList","Frame0","MyPackage"),class'Texture'));
But still I would recommend you go with inserting all texture information directly in object defaultproperties, as using int files won't work online unless every player who plans to play that game mode installs the mod manually outside of the game.
1823223D2A33224B0 wrote:...and now im stuck trying to fix everything you broke for the next 227 release xD :P
(ಠ_ಠ)
User avatar
han
Global Moderator
Posts: 686
Joined: Wed Dec 10, 2014 12:38 am

Re: String to GetNextIntDesc

Post by han »

You could also just store all relevant information in some additional class like:

Code: Select all

class SpriteProps extends Object
  abstract;

var int AddFrame;
var float Time;
var name Notify;
And have the specific information in subclasses. You won't need (and should) ever have to instantiate these SpriteProps classes, but you can always refer to them with some var Class MyProps; and MyProps.default.Time, etc.
Last edited by han on Sun Jun 18, 2017 9:51 am, edited 1 time in total.
HX on Mod DB. Revision on Steam. Löffels on Patreon.
User avatar
LannFyre
OldUnreal Member
Posts: 157
Joined: Fri Mar 13, 2015 7:01 am

[solved] String to GetNextIntDesc

Post by LannFyre »

Okay, I had to make some changes.  When you call IntDescIterator, you are calling a meta class in your .int file which means that since I am calling this from SpriteParser:

Code: Select all

class SpriteParser extends Actor
[...]
function blah()
{
      local string testStr, testDesc;

      ForEach IntDescIterator( "RPG_Game_dev.SpriteParser", testStr, testDesc ) {
            [...]
      }
}
-- the metaclass of the Object entry for my desired .int file has to have a metaclass set to RPG_Game_dev.SpriteParser, like so:

RPG_Game_dev.int (make sure .int name is the same name as your package!)

Code: Select all

Object=(Name=RPG_Game_dev.RPG_LionPlatformer,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="DIR=8")
The name is output as a string (testStr) and the description is output as a string (testDesc).  Took some toying around, remember to log your scripts!  I am curious to how that localization works in a more proper fashion though.  Could you describe it in these terms?

Code: Select all

[RPG_LionPlatformer]
Object=(Name=RPG_Game_dev.RPG_LionPlatformer,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="DIR=8")
Object=(Name=Sprite_Lann.Stand0_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Object=(Name=Sprite_Lann.Stand1_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Object=(Name=Sprite_Lann.Stand2_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Object=(Name=Sprite_Lann.Stand3_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Object=(Name=Sprite_Lann.Stand4_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Object=(Name=Sprite_Lann.Stand5_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Object=(Name=Sprite_Lann.Stand6_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Object=(Name=Sprite_Lann.Stand7_,Class=Class,MetaClass=RPG_Game_dev.SpriteParser,Description="ADDFRAME=1;TIME=;NOTIFY=NONE")
Last edited by LannFyre on Wed Jun 28, 2017 9:23 pm, edited 1 time in total.
i tryin'a be a gud boi

Return to “UScript Board”