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

Superclass of Primitive Types?

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
Pravin

Superclass of Primitive Types?

Post by Pravin »

I'm basically finished with an actually *useful* mod I've been working on (dynamic arrays for UE1.0), but have one slight annoyance... The dynamic array can only store OBJECTs, of which in java and uscript alike do NOT encompass primitive types.

Is it possible to make a variable that can take ints, strings, etc... with UScript? If it had generics then this would be easy, but as of yet I've found no viable alternative, other than a) making a separate dynarray class for each primitive type (lame) or b) wrapping such variables in objects to have their data retrieved later (slightly less lame but requires the user to be more informed)

Casey and I have already tried using obscure types in the class tree such as "field" and "property", but when trying to assign to these variables the editor complains of type mismatches (wtf an int is not an intproperty? etc.)

Insights, anyone?
Last edited by Pravin on Fri May 23, 2008 4:47 pm, edited 1 time in total.
User avatar
Raven
OldUnreal Member
Posts: 311
Joined: Fri Jun 10, 2005 5:10 am

Re: Superclass of Primitive Types?

Post by Raven »

try search here: wiki.beyondunreal.com/Legacy:Dynamic_Array/UnrealEngine_1 can't do any research atm.
Last edited by Raven on Fri May 23, 2008 6:29 pm, edited 1 time in total.
Image
Pravin

Re: Superclass of Primitive Types?

Post by Pravin »

Thks for the info Raven. Yeah.. I personally think that my method of a dynamic array is much better than this.. This example can only store integers AND it's not truly dynamic (note the array of 1024 length in one of the functions).. What I have is built off of a linked list so it can truly store an infinite amount of data, but only of type object. If there's no way to generically store any data type in the class (primitive types "aren't" objects...) then I guess I'll have to resort to a separate dynamic array class for each primitive type. I can post the code here upon request if anyone's curious. 8-)
User avatar
Bane
OldUnreal Member
Posts: 493
Joined: Sun Mar 03, 2002 6:32 pm

Re: Superclass of Primitive Types?

Post by Bane »

Can't you simply make a node object that stores a primitive and store that? Something like;

Code: Select all

class StringObject extends Object;

string value;
You'd have to use some functions to actually get the value, but unless you found some other trick you couldn't access the values in your dynamic array as a regular array anyways.
Author of Hide and Seek mod, and the NALIBALL mod

Hide and Seek can be downloaded from:
http://HideNSeek.5u.com

Return to “UScript Board”