| Home Page | Recent Changes

ArrayIndexer

About

ArrayIndexer is a WOTgreal macro that updates indexes of selected defaultproperties array items. It's handy when you reorder array items and dont want to upddate the index numbers manually.

Before

defaultproperties
{
    DeathSounds(0)=Sound'NewDeath.fn_death01'
    DeathSounds(3)=Sound'NewDeath.fn_death04'
    DeathSounds(4)=Sound'NewDeath.fn_death05'
    DeathSounds(1)=Sound'NewDeath.fn_death02'
    DeathSounds(2)=Sound'NewDeath.fn_death03'
}

After

defaultproperties
{
    DeathSounds(0)=Sound'NewDeath.fn_death01'
    DeathSounds(1)=Sound'NewDeath.fn_death04'
    DeathSounds(2)=Sound'NewDeath.fn_death05'
    DeathSounds(3)=Sound'NewDeath.fn_death02'
    DeathSounds(4)=Sound'NewDeath.fn_death03'
}
	

Code

program ArrayIndexer
begin
    // ========================================================================
    //  UnrealScript ArrayIndexer
    //
    //  Copyright 2005 Roman Switch` Dzieciol, neai o2.pl
    //  http://wiki.beyondunreal.com/wiki/Switch
    // ========================================================================

    cpos := 0;

    // ========================================================================


    BlockBeginX, BlockBeginY := BlockBegin();
    BlockEndX, BlockEndY := BlockEnd();

    for line:=BlockBeginY to BlockEndY step 1 do
    begin
        SetCursorXY(0,line);
        sline := CurrentLine();

        lpos := Pos('(',sline);
        if (lpos <> 0) then
        begin
            sleft := Copy(sline,0,lpos);
            rpos := Pos(')',sline);
            if (rpos <> 0) then
            begin
                sright := Copy(sline,rpos,Length(sline)-rpos+1);
                sline := sleft + IntToStr(cpos) + sright;
                cpos := cpos + 1;
                SetCurrentLine(sline);
            end;
        end;
    end;
end;

Category WOTgreal Macro

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

FAQs

Help Desk

Mapping Topics

Mapping Lessons

UnrealEd Interface

UnrealScript Topics

UnrealScript Lessons

Making Mods

Class Tree

Modeling Topics

Chongqing Page

Log In