#One more cup of SW coffee

1 messages · Page 1 of 1 (latest)

stable portal
#

C++er, attempting a DnD/SW (e.g. KotOR). A how it looks for you/plural, see the vid below

and a how it works for me

UENUM()
enum class EDieType : uint8
{
    Invalid = 0x0,
    d2 = 0x2,
    d3 = 0x3,
    d4 = 0x4,
    d6 = 0x6,
    d8 = 0x8,
    d10 = 0xA,
    d12 = 0xC,
    d20 = 0x14,
    d100 = 0x64,
};

and roll it

static FORCEINLINE int32 RollDice(EDieType DieType, int32 Roll = 1)
{
    check(DieType!=EDieType::Invalid);

    int32 dice = 0;

    for (int i = 1; i <= Roll; ++i)
    {
        dice += rand() % static_cast<int>(DieType) + 1;
    }

    return dice;
}

edit, to clarify: visually, as it's some kinda omelet, the project uses already existing ingredients. I, as a developer, write C++ code and use the visuals as an aid when making a point, so how it looks for you, and how it works for me. The code I write is inspired mainly by Bioware old/er games, primarily Knights of The Old Republic and Dragon Age...

stable portal
#

a how it works for me, no CMC, just interp on tick 😄

SetActorLocation(FMath::VInterpConstantTo(GetActorLocation(), EndLocation, DeltaTime, MovementSpeed * SpeedModifier));
stable portal
#

how it looks for you/plural, a Character Creation example

#

how it works for me

UENUM()
enum class ECharacterRace : uint8
{
    Invalid,
    Chiss,
    Cyborg,
    Human,
    Miraluka,
    Mirialan,
    Rattataki,
    SithPureblood,
    Twilek,
    Zabrak,
    Cathar,
    Togruta,
    Nautolan
};

and

UENUM()
enum class ECharacterClass : uint8
{
    Invalid,
    Soldier,
    Scout,
    Scoundrel,
    JediGuardian,
    JediConsular,
    JediSentinel,
    CombatDroid,
    ExpertDroid,
    Minion,
    TechSpecialist,
    BountyHunter,
    JediWeaponmaster,
    JediMaster,
    JediWatchman,
    SithMarauder,
    SithLord,
    SithAssassin
};

and

Chargen_ApplyRaceAttributeModifiers(Character, static_cast<ECharacterRace>(Character->GetCharacterVars()["Race"]));
    Chargen_ApplyClassAttributeModifiers(Character, static_cast<ECharacterClass>(Character->GetCharacterVars()["Class"]));
    Chargen_ApplyClassStatModifiers(Character, static_cast<ECharacterClass>(Character->GetCharacterVars()["Class"]));
    Chargen_ApplyClassAbilities(Character, static_cast<ECharacterClass>(Character->GetCharacterVars()["Class"]));
stable portal
#

a how it works for me, the most beautiful thing in the world, weak lambda

        FTimerDelegate delayedCallback;
        delayedCallback.BindWeakLambda(GetWorld(), [this]
        {
            HandleCombatRound(bIsDone);
        });
        FTimerHandle unusedHandle;
        GetWorld()->GetTimerManager().SetTimer(unusedHandle, delayedCallback, fDelay, false);
waxen dove
#

Hello would u require some 3d modelling here

plush moth
#

Definitely a bold move making a game based on a Disney IP

#

Be careful

waxen dove
plush moth
#

The graphics are looking amazing though

stable portal
#

how it looks character sheet

#

how it works, fetching values from a plaintext file, e.g. CSV instead of a traditional Unreal DataTable (I like either, but plain text is just easier to read than binary)

{
    //this returns a FString to be converted to other types, e.g. float, int32, etc.
    FString sString = "NA";

    std::string line;
    const FString sData = FPaths::ProjectDir() + GetPathForData(sTableName);

    std::ifstream inData;
    inData.open(TCHAR_TO_UTF8(*sData));

    if (inData.fail())
    {
        UE_LOG(LogTemp, Error, TEXT("%s"), *FString::Printf(TEXT("ERROR: Couldn't find '%s'"), *sTableName.ToString()));
        inData.close();
    }

    FString sHeader = "";
    TArray<FString> RowArray;
    TArray<FString> HeaderArray;
    int32 nColumnIndex = INT_MAX;

    while (getline(inData, line))
    {
        const FString sLine = line.c_str();

        check(sLine.Contains(","));

        if (sHeader.IsEmpty())
        {
            sHeader = sLine;
            const TCHAR* delim = L",";

            sHeader.ParseIntoArray(HeaderArray, delim);
            for (int32 i = 0; i < HeaderArray.Num(); ++i)
            {
                if (HeaderArray[i] == sColumn.ToString())
                {
                    nColumnIndex = i;
                    break;
                }
            }

            check(nColumnIndex!=INT_MAX);
        }

        FString sKey;
        FString sValue;

        sLine.Split(TEXT(","), &sKey, &sValue);

        if (sKey == sRow.ToString())
        {
            const TCHAR* delim = L",";

            sLine.ParseIntoArray(RowArray, delim);
            sString = RowArray[nColumnIndex];
            break;
        }
    }```
stable portal
#

how it looks: Combat layout Darkest Dungeon like (actually Circus Electrique, it's an Unreal game :D)