• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Outfits? TFS 1.2 - helppp

dropz

Member
Joined
May 4, 2022
Messages
46
Reaction score
24
here we go again...

maybe now i get a answer :D

well, i added some new outfits in my server and they are working properly, but now im facing a problem to "lock" this outfits.

currently all premium players has access to the new implemented outfits, and my idea is this new outfits only can be unlocked using a paid item like a "outfit doll/outfit scroll".

for this i need create new conditions on protocolgame.cpp and player.cpp?
or for this i just need create a lua script that unlock this new outfits removing them of the base premium outfits on the files above? (if yes, and you guys has a script.. can yous share it? the ones that i have returning a lot of errors about a class "addOutfit").

my engine is a TFS 1.2 - Nostalrius.

and unfortunately this engine didnt has a support to outfits.xml :(
 
Player.cpp

C++:
bool Player::canWear(uint32_t lookType) const
{
    if (group->access) {
        return true;
    }

    if (getSex() == PLAYERSEX_MALE) {
        if (lookType >= 132 && lookType <= 134 && isPremium()) {
            return true;
        } else if (lookType >= 128 && lookType <= 131) {
            return true;
        }
    } else if (getSex() == PLAYERSEX_FEMALE) {
        if (lookType >= 140 && lookType <= 142 && isPremium()) {
            return true;
        } else if (lookType >= 136 && lookType <= 139) {
            return true;
        }
    }

    return false;
}

1669156901793.png
 
Player.cpp

C++:
bool Player::canWear(uint32_t lookType) const
{
    if (group->access) {
        return true;
    }

    if (getSex() == PLAYERSEX_MALE) {
        if (lookType >= 132 && lookType <= 134 && isPremium()) {
            return true;
        } else if (lookType >= 128 && lookType <= 131) {
            return true;
        }
    } else if (getSex() == PLAYERSEX_FEMALE) {
        if (lookType >= 140 && lookType <= 142 && isPremium()) {
            return true;
        } else if (lookType >= 136 && lookType <= 139) {
            return true;
        }
    }

    return false;
}

View attachment 71894
for sure, i understood this relation of the looktypes and the arrays on the "player.cpp"...

the point is how to do the new outfits appears for the player just when they uses a specific item.. before that this outfits cant appears on outfit panel.

i did some changes on protocolgame.cpp and player.cpp removing the looktypes of the new outfits, after that the outfits dont appears anymore on "Set Outfit", but now i need to understand how im gonna add them using a item... i need keep their looktypes on protocolgame.cpp/player.cpp, need create a new condition there? or remove them of this files like i did and use a lua script to add them on "storage" of a regular player?
 
for sure, i understood this relation of the looktypes and the arrays on the "player.cpp"...

the point is how to do the new outfits appears for the player just when they uses a specific item.. before that this outfits cant appears on outfit panel.

i did some changes on protocolgame.cpp and player.cpp removing the looktypes of the new outfits, after that the outfits dont appears anymore on "Set Outfit", but now i need to understand how im gonna add them using a item... i need keep their looktypes on protocolgame.cpp/player.cpp, need create a new condition there? or remove them of this files like i did and use a lua script to add them on "storage" of a regular player?
oops, didnt read aswell
 
for sure, i understood this relation of the looktypes and the arrays on the "player.cpp"...

the point is how to do the new outfits appears for the player just when they uses a specific item.. before that this outfits cant appears on outfit panel.

i did some changes on protocolgame.cpp and player.cpp removing the looktypes of the new outfits, after that the outfits dont appears anymore on "Set Outfit", but now i need to understand how im gonna add them using a item... i need keep their looktypes on protocolgame.cpp/player.cpp, need create a new condition there? or remove them of this files like i did and use a lua script to add them on "storage" of a regular player?
i think u can use:

player:setOutfit({lookType = ID, lookHead = 78, lookBody = 106, lookLegs = 58, lookFeet = 95})

onUse item but the player will need to use always the item..



other way i think u can use getStorage on the bool(??)

if (lookType >= 132 && lookType <= 134 && isPremium()) && player:getStorage(STORAGEHERE) {

for example
 
To add custom outfits in nostalrius, you're going to need to edit sources to change the canWear function to check for specific storageValues set on the player.

So you'd need to make a new item and register a lua action script to say something like when you use the item, player:setStorageValue(OutfitStorageID, 1)

Then from sources when checking if the player can wear the outfit, add additional custom code to check if the outfit is the new outfit id, and then if they have this storage value set.

You also either need to make a new custom function to send an outfit window with the new outfit ID, or extended the list of outfits sent by the normal open Outfit window.

Takes a little bit of work, but I have this on Nostalther Retro (which is running from nostalrius engines)
 
To add custom outfits in nostalrius, you're going to need to edit sources to change the canWear function to check for specific storageValues set on the player.

So you'd need to make a new item and register a lua action script to say something like when you use the item, player:setStorageValue(OutfitStorageID, 1)

Then from sources when checking if the player can wear the outfit, add additional custom code to check if the outfit is the new outfit id, and then if they have this storage value set.

You also either need to make a new custom function to send an outfit window with the new outfit ID, or extended the list of outfits sent by the normal open Outfit window.

Takes a little bit of work, but I have this on Nostalther Retro (which is running from nostalrius engines)
thank you for reply master!

but i solved the problem about the implementation of the outfits... for sure, now i will need to handle with the storagevalues to add in outfit/addon dolls, but the outfit problem about what is locked or unlocked was solved with the implementation of outfits.xml in src code of nostalrius, also adding the addon feature there.

here's the post that i asking about some tip to addon feature and the answer too :D

 
Back
Top