• 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!

C++ TFS 0.3.6 ~[SOURCE-EDIT] How to use two weapons and two shields simultaneously?

on my server i just did a SHIELD with a SWORD sprite
and a SWORD with a SHIELD sprite

a script than checks on attack/ on use weapon

C++:
                    const Item* rightItem = inventory[SLOT_RIGHT];
                    WeaponType_t type = item->getWeaponType(), rightType = rightItem->getWeaponType();
                    if(rightItem->getSlotPosition() & SLOTP_TWO_HAND)
                        ret = RET_DROPTWOHANDEDITEM;
                    else if(item == rightItem && count == item->getItemCount())
                        ret = RET_NOERROR;
                    else if(rightType == WEAPON_SHIELD && type == WEAPON_SHIELD)
                        ret = RET_CANONLYUSEONESHIELD;
                    else if(!rightItem->isWeapon() || !item->isWeapon() ||
                        rightType == WEAPON_SHIELD || rightType == WEAPON_AMMO
                        || type == WEAPON_SHIELD || type == WEAPON_AMMO)
                        ret = RET_NOERROR;
                    else
                        ret = RET_CANONLYUSEONEWEAPON;

C++:
                    const Item* leftItem = inventory[SLOT_LEFT];
                    WeaponType_t type = item->getWeaponType(), leftType = leftItem->getWeaponType();
                    if(leftItem->getSlotPosition() & SLOTP_TWO_HAND)
                        ret = RET_DROPTWOHANDEDITEM;
                    else if(item == leftItem && count == item->getItemCount())
                        ret = RET_NOERROR;
                    else if(leftType == WEAPON_SHIELD && type == WEAPON_SHIELD)
                        ret = RET_CANONLYUSEONESHIELD;
                    else if(!leftItem->isWeapon() || !item->isWeapon() ||
                        leftType == WEAPON_SHIELD || leftType == WEAPON_AMMO
                        || type == WEAPON_SHIELD || type == WEAPON_AMMO)
                        ret = RET_NOERROR;
                    else
                        ret = RET_CANONLYUSEONEWEAPON;
 
Last edited:
I used 2 weapons and 2 shields in my left and right hand, two weapons and equipped two shield slots in my left and right hand, but only the left attacks the right, not with both weapons.

HAND RIGHT SWORD AND HAND LEFT AXE EXAMPLE.
 
Bro. Stop fucking yelling at me. I can read. You have clearly stated that it doesn't work for attacking or defending... I'm not fucking stupid.

YOU ALSO CLAIM TO ALREADY BE ABLE TO PUT TWO ITEMS IN ONE SLOT, WHICH I CALL BULLSHIT ON!

IF you can do that, then show me, and quit fucking repeating yourself, or I'm dipping and you can stay trying to figure it out yourself.
 
Screenshot_2.webpScreenshot_1.webp

LUA:
    const Item* rightItem = inventory[SLOT_RIGHT];
                    WeaponType_t type = item->getWeaponType(), rightType = rightItem->getWeaponType();
                    if(rightItem->getSlotPosition() & SLOTP_TWO_HAND)
                        ret = RET_DROPTWOHANDEDITEM;
                    else if(item == rightItem && count == item->getItemCount())
                        ret = RET_NOERROR;
                    else if(rightType == WEAPON_SHIELD && type == WEAPON_SHIELD)
                        ret = RET_NOERROR;
                    else if(!rightItem->isWeapon() || !item->isWeapon() ||
                        rightType == WEAPON_AMMO || rightType == WEAPON_AMMO
                        || type == WEAPON_AMMO || type == WEAPON_AMMO)
                        ret = RET_NOERROR;


C++:
            const Item* leftItem = inventory[SLOT_LEFT];
                    WeaponType_t type = item->getWeaponType(), leftType = leftItem->getWeaponType();
                    if(leftItem->getSlotPosition() & SLOTP_TWO_HAND)
                        ret = RET_DROPTWOHANDEDITEM;
                    else if(item == leftItem && count == item->getItemCount())
                        ret = RET_NOERROR;
                    else if(leftType == WEAPON_SHIELD && type == WEAPON_SHIELD)
                        ret = RET_NOERROR;
                    else if(!leftItem->isWeapon() || !item->isWeapon() ||
                        leftType == WEAPON_AMMO || leftType == WEAPON_AMMO
                        || type == WEAPON_AMMO || type == WEAPON_AMMO)
                        ret = RET_NOERROR;

test weapon 1 atk 1000000000 atk only
calculate the atk of 1
00000000
 
Last edited:
I told you it was impossible because you can't have two items in one hand.... and you said you could already do that... that is not what those images show... you are simply showing two hands both with same kind of item....

Like I said, impossible to put two items in one slot.
 
I told you it was impossible because you can't have two items in one hand.... and you said you could already do that... that is not what those images show... you are simply showing two hands both with same kind of item....

Like I said, impossible to put two items in one slot.

He simply wants to use 2 weapons or 2 shields at the same time.
 
He simply wants to use 2 weapons or 2 shields at the same time.
How to use two weapons and two shields simultaneously

He never said or, he said AND (as well as simultaneously)... and when I explained you need four hands for that, it should have been apparent to him the miscommunication if that is not what he was seeking.... and then again, later on, I tell him to show me that he can have two items in one hand clearly stating I believed that to be impossible as the client would not allow it... even the first person to respond said they just made sprites with a shield and sword merged together to achieve that...

So I ask, if that's not what he was seeking, then why the hell did he just ignore the fact that every message in this thread has been talking about having them both in the same hand????

Furthermore, instead of explaining it was a misunderstanding, he just starts repeating himself spamming all caps like he is angry and yelling...

@topic if you are correct about what he desires, then he needs to remove those checks, AND change the part of the code which adds up the defense, or attack so that it includes both items from both hands.

At this point, someone else can help this leech, as clearly he is one of the types that are only here to ask for handouts and not listen nor learn.
 
Last edited:
player.cpp
Code:
void Player::doAttacking(uint32_t)

here you start your journey, without perma demands and yelling

hint:
Code:
Item* tool = getWeapon();
this is supposed to be one time leftHand, secondtime rightHand to achieve dual wielding.
 
Back
Top