| Home Page | Recent Changes | Preferences

Dma/Developer Journal

During school assignments, I have been working on several projects.

  • dma/JetPack - This will someday be a jet pack that works flawlessly in network play.
  • dma/MutMultiJump - This lets the server admin set the number of multijumps to allow.
  • More to come if I get the time.

If you want to find the superclass of a class at runtime, you can try this:

static final function class FindSuperClass(class C) {
    local State obj;
    local Class X;
    local array< class > SuperClasses;
    local Class BestClass;
    local int i;

    foreach C.AllObjects(class'State', obj) {
        X = Class(obj);
        if ((X != None) && (X != C) && ClassIsChildOf(C, X)) {
            SuperClasses[SuperClasses.Length] = X;
        }
    }
    BestClass = class'Object';

    for (i=0; i<SuperClasses.Length; i++) {
        if (ClassIsChildOf(SuperClasses[i], BestClass)) {
            BestClass = SuperClasses[i];
        }
    }

    return BestClass;
}

Foxpaw: I'm curious, why does the first loop only look for things that are subclasses of "state?"


Category Journal

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In