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

Compiling New weapon/ammo amount does't decrease

mareczek123

New Member
Joined
Jul 20, 2010
Messages
11
Reaction score
0
Hi there

I have the newset TSF from githube.

I finaly managed to add new weapon with new ammo and new shoot type, as you can see on video :


and I have two problems
- as you can see when I shoot with my new weapon I still have 3 bullets, but when I shoot with crossbow all works fine and ammunition decrease. In my config.lua :
removeAmmoWhenUsingDistanceWeapon = "yes"
and I noticed that in newest TSF version in items.xml there is no attribute key="ammoAction" so I can not set it to removecount, and I don't know where is a problem, why my bullets amount doesn't decrease while others does.

- second thing in items.xml I can no use attribute key="attackspeed" to incrase attack speed of my gun. I want to add machin gun and it should be much faster, then 2000ms. Where can I set up attack speed of my weapons ?

thanks for help
 
Hi there

I have the newset TSF from githube.

I finaly managed to add new weapon with new ammo and new shoot type, as you can see on video :


and I have two problems
- as you can see when I shoot with my new weapon I still have 3 bullets, but when I shoot with crossbow all works fine and ammunition decrease. In my config.lua :
removeAmmoWhenUsingDistanceWeapon = "yes"
and I noticed that in newest TSF version in items.xml there is no attribute key="ammoAction" so I can not set it to removecount, and I don't know where is a problem, why my bullets amount doesn't decrease while others does.

- second thing in items.xml I can no use attribute key="attackspeed" to incrase attack speed of my gun. I want to add machin gun and it should be much faster, then 2000ms. Where can I set up attack speed of my weapons ?

thanks for help
First - removeammo you can find now in weapons.xml file.
Second - probably requires source edit.
 
thx it was so easy... now is working, amount decrease..

about shoot speed, is there already any function in source that controls shoot speed or not? Will it be hard to implement such finction ? I'm not programmer, just know simple things....
 
hi there

still waiting for help how to change the speed value of attack depending on weapon you use :) It will be perfect if weapons have its own attribute that determine attack speed.


==============


and have another problem.

I wanted to change default magiceffect when creature is hit (CONST_ME_DRAWBLOOD) and when block a hit (CONST_ME_POFF), but I can not find where to do it. I tried in this two functions :

condition.ccp
ConditionDamage::doDamage(Creature* creature, int32_t healthChange)

game.ccp
Game::combatBlockHit(CombatDamage& damage, Creature* attacker, Creature* target, bool checkDefense, bool checkArmor, bool field)

but still when I hit a monster or he block I see the same old magiceffect... so where I shoul change it?

thx
 
hi there

still waiting for help how to change the speed value of attack depending on weapon you use :) It will be perfect if weapons have its own attribute that determine attack speed.


==============


and have another problem.

I wanted to change default magiceffect when creature is hit (CONST_ME_DRAWBLOOD) and when block a hit (CONST_ME_POFF), but I can not find where to do it. I tried in this two functions :

condition.ccp
ConditionDamage::doDamage(Creature* creature, int32_t healthChange)

game.ccp
Game::combatBlockHit(CombatDamage& damage, Creature* attacker, Creature* target, bool checkDefense, bool checkArmor, bool field)

but still when I hit a monster or he block I see the same old magiceffect... so where I shoul change it?

thx


Not in the source. Use combat object in a script for that weapon.

Limos has tons of examples of making custom weapons on otland, just look around...
 
about shoot speed, is there already any function in source that controls shoot speed or not? Will it be hard to implement such finction ? I'm not programmer, just know simple things....
There is currently no function / method that exist to set the attack speed of the player / creature, if you want to change the attack speed of the player you need to refer to the vocations.xml file & change it there.
I wanted to change default magiceffect when creature is hit (CONST_ME_DRAWBLOOD) and when block a hit (CONST_ME_POFF), but I can not find where to do it. I tried in this two functions :
that requires a source edit

You need to learn C++ if you want to edit or "change" the sources
 
Yes I wanted to edit the source, but I can not find the part that is responsible for PUFF and BLOOD during combat.
In source I foud :

Code:
.
.
static const auto sendBlockEffect = [this](BlockType_t blockType, CombatType_t combatType, const Position& targetPos) {
        if (blockType == BLOCK_DEFENSE) {
            addMagicEffect(targetPos, CONST_ME_POFF);
        } else if (blockType == BLOCK_ARMOR) {
            addMagicEffect(targetPos, CONST_ME_BLOCKHIT);
        }
.
.

so I understand that this part is responsible for effect when creature make block then is send CONST_ME_POFF, and when armor block hit it is send CONST_ME_BLOCKHIT. So I just changed names of this effect to another for example - CONST_ME_BLACKSMOKE, but when I compiled and run serwer nothing changed... Maybe this function is not use during combat...

And I can not find the part that is responsible for CONST_ME_DRAWBLOOD, I tried to change it in some random places, but still the same effect...
 
Back
Top