L2movableStaticMesh actor для начальных хроник

L2movableStaticMesh actor для начальных хроник base version

Нет прав для скачивания
что бы добавить нового актора в игру прибегнем к анреал скриптам
1) с помощью UTPT.exe достаём класс интересующего актора из хай хроник
Код:
class L2MovableStaticMeshActor extends StaticMeshActor
  Native;
var Vector OrgScale;
var Rotator OrgRotation;
var Vector OrgLocation;
var Vector ScaleMaxRatio;
var Vector RotationMaxRatio;
var Vector TranslationMaxRatio;
var Vector ScaleCurrent;
var Vector RotationCurrent;
var Vector TranslationCurrent;
var bool bInitialized;
var(L2Movement) bool bUseRotatedTranslation;
var(L2Movement) bool bRandomMax;
var(L2Movement) bool bRandomStart;
var(L2Movement) array<name> L2MovementTag;
var(L2Movement) Rotator RotationMax;
var(L2Movement) Rotator RotationRate;
var(L2Movement) Vector ScaleMax;
var(L2Movement) Vector ScaleRate;
var(L2Movement) Vector TranslationMax;
var(L2Movement) Vector TranslationRate;
var Vector DeltaLocation;
var Rotator DeltaRotation;
var Vector DeltaScale;
defaultproperties
{
    bRandomStart=True
    Physics=20
    bStatic=False
}

с помощью чата гпт оптимизируем систематизируем и упрощаем код для соло ю файла
тут можно вписать любые действия которые хотите - пешка будет их отрабатывать не зависимо от того как она была прописана у нц софта

Код:
class L2MovableStaticMeshActor extends StaticMeshActor;

var Vector OrgScale;
var Rotator OrgRotation;
var Vector OrgLocation;
var Vector ScaleCurrent;
var Rotator RotationCurrent;
var Vector TranslationCurrent;
var bool bInitialized;

var(L2Movement) bool bRandomMax;
var(L2Movement) bool bRandomStart;
var(L2Movement) array<name> L2MovementTag;

var(L2Movement) Rotator RotationMax;
var(L2Movement) Rotator RotationRate;
var(L2Movement) Vector ScaleMax;
var(L2Movement) Vector ScaleRate;
var(L2Movement) Vector TranslationMax;
var(L2Movement) Vector TranslationRate;

simulated function PostBeginPlay()
{
    super.PostBeginPlay();

    OrgLocation = Location;
    OrgRotation = Rotation;
    OrgScale = DrawScale3D;

    if (bRandomStart)
    {
        InitializeRandomValues();
    }

    bInitialized = true;
    SetTimer(0.03, true); // 30 FPS обновление
}

// Функция для инициализации случайных значений
simulated function InitializeRandomValues()
{
    TranslationCurrent.X = FRand() * TranslationMax.X;
    TranslationCurrent.Y = FRand() * TranslationMax.Y;
    TranslationCurrent.Z = FRand() * TranslationMax.Z;

    RotationCurrent.Pitch = FRand() * RotationMax.Pitch;
    RotationCurrent.Yaw = FRand() * RotationMax.Yaw;
    RotationCurrent.Roll = FRand() * RotationMax.Roll;

    ScaleCurrent.X = FRand() * ScaleMax.X;
    ScaleCurrent.Y = FRand() * ScaleMax.Y;
    ScaleCurrent.Z = FRand() * ScaleMax.Z;
}

simulated function UpdateTransformations(Vector TranslationIncrement, Rotator RotationIncrement, Vector ScaleIncrement)
{
    // Обновление трансляции
    TranslationCurrent += TranslationIncrement;
    SetLocation(OrgLocation + TranslationCurrent);

    // Обновление поворота
    RotationCurrent.Pitch += RotationIncrement.Pitch;
    RotationCurrent.Yaw += RotationIncrement.Yaw;
    RotationCurrent.Roll += RotationIncrement.Roll;
    SetRotation(OrgRotation + RotationCurrent);

    // Обновление масштаба — исправлено!
    ScaleCurrent += ScaleIncrement;
    SetDrawScale3D(OrgScale + ScaleCurrent);
}


simulated function Timer()
{
    if (!bInitialized)
        return;

    // Обновление трансформаций
    UpdateTransformations(TranslationRate * 0.03, RotationRate * 0.03, ScaleRate * 0.03);
}

defaultproperties
{
    bStatic=False
    bMovable=True
    bRandomStart=True
    RemoteRole=ROLE_SimulatedProxy
    Physics=PHYS_None
    RotationRate=(Pitch=0,Yaw=0,Roll=0)
    TranslationRate=(X=0,Y=0,Z=0)
    ScaleRate=(X=0,Y=0,Z=0)
}


коды даю тестовые примерные - вы можете сделать лучше.

далее собираем в файл ю

указываем название нашего скрипта в ини файле системы
Код:
[Engine.Engine]
EditorEngine=Editor.EditorEngine

[Core.System]
Paths=../System/*.u

[Editor.EditorEngine]
CacheSizeMegs=256
EditPackages=Core
EditPackages=Engine
EditPackages=L2MovableStaticMeshActor

в батнике прописываем
Ucc make
pause
и пошло поехало если даёт криты или ошибки - спрашиваем у гпт как лучше
результат
Назад
Сверху