attack power
attack power
Hello,
does anyone knows if it is possible that script a weapon which give +20 to attack power?
does anyone knows if it is possible that script a weapon which give +20 to attack power?
Re: attack power
Do you mean differently than this?
Code: Select all
defineObject{
name = "machete",
class = "Item",
uiName = "Machete of Might",
model = "assets/models/items/machete.fbx",
skill = "swords",
gfxIndex = 23,
attackPower = 29,
accuracy = 0,
coolDownTime = 3.2,
attackMethod = "meleeAttack",
attackSwipe = "horizontal",
attackSound = "swipe",
impactSound = "impact_blade",
weight = 2.2,
gameEffect = "Enchanted +20 Attack power"
}
Re: attack power
bongobeat, as Isaac shown you, you must add a "clone" the object on the "mod_assets\scripts\object.lua" file in your mod folder, not by the editor 
Re: attack power
No problem I know, thanksDoridion wrote:bongobeat, as Isaac shown you, you must add a "clone" the object on the "mod_assets\scripts\object.lua" file in your mod folder, not by the editor
Sorry my request is not clear !Isaac wrote:Do you mean differently than this?Code: Select all
defineObject{ name = "machete", class = "Item", uiName = "Machete of Might", model = "assets/models/items/machete.fbx", skill = "swords", gfxIndex = 23, attackPower = 29, accuracy = 0, coolDownTime = 3.2, attackMethod = "meleeAttack", attackSwipe = "horizontal", attackSound = "swipe", impactSound = "impact_blade", weight = 2.2, gameEffect = "Enchanted +20 Attack power" }
well I mean, a gameEffect like the loincloth gives, I don't know how to script it.
SpoilerShow
Code: Select all
gameEffect = "Attack Power +1",I ve started something based on your armor script, but for the attackPower… I really don't know
SpoilerShow
Code: Select all
defineObject{
name = "super_axe",
class = "Item",
uiName = "Axe of Might",
model = "assets/models/items/axe.fbx",
skill = "axe",
gfxIndex = 23,
attackPower = 29,
accuracy = 0,
coolDownTime = 3.2,
attackMethod = "meleeAttack",
attackSwipe = "horizontal",
attackSound = "swipe",
impactSound = "impact_blade",
weight = 2.2,
gameEffect = "Additional +30 to Attack Power for Figters proficient with Axe level 40.",
onEquipItem = function(champion, slot)
if champion:getClass() == "Fighter" and champion:getSkillLevel("axe") >39 then
if ( slot == 7 ) or ( slot == 8 ) then
...
}Re: attack power
Unfortunately, a bonus to the character's attackPower is not something that can be added to the game through normal means (attackPower is only used for the weapons themselves). You cannot even create an item that directly adds to a character's attackPower since this is a statistic that cannot be directly modified (it's not like energy or protection in that way). I believe items like the loincloth have been hardcoded to provide their attackPower bonus. There are several hardcoded features like this in LoG1 that will be rectified or addressed in LoG2 (hopefully making it easier to get around these problems).
The best solution is to grant the character the aggressive trait while using a particular weapon.
Also, if you want to create an item which modifies a stat you need to write ("protection", 2) or ("willpower", -2). This would grant the person a +2 bonus to protection or a -2 to willpower. Also note that some items need to be changed to grant certain bonuses. For example a shield that is also a weapon would have the added line weapon = true (plus other appropriate changes).
Of course, if I have missed something vital or am completely wrong I'm sure much better modders like Isaac or Komag will correct me.
The best solution is to grant the character the aggressive trait while using a particular weapon.
Also, if you want to create an item which modifies a stat you need to write ("protection", 2) or ("willpower", -2). This would grant the person a +2 bonus to protection or a -2 to willpower. Also note that some items need to be changed to grant certain bonuses. For example a shield that is also a weapon would have the added line weapon = true (plus other appropriate changes).
Of course, if I have missed something vital or am completely wrong I'm sure much better modders like Isaac or Komag will correct me.
Re: attack power
You're right (afaik), but it is possible to make a copy of a weapon with a different attackpower bonus; not one that you would ever place in the dungeon, but instead, you would equip it via script, and ensure that only those fighters with sufficient skill for the bonus ever get to use it.Grimfan wrote:Unfortunately, a bonus to the character's attackPower is not something that can be added to the game through normal means (attackPower is only used for the weapons themselves). You cannot even create an item that directly adds to a character's attackPower since this is a statistic that cannot be directly modified (it's not like energy or protection in that way).
I wondered that myself; I think it likely is hard coded. The check would be to rename a pair of pants "loincloth", but I haven't tried.I believe items like the loincloth have been hardcoded to provide their attackPower bonus. There are several hardcoded features like this in LoG1 that will be rectified or addressed in LoG2 (hopefully making it easier to get around these problems).
@ Bongobeat:
Try this: (updated to V1.01)
SpoilerShow
Party Hook: (in Objects.lua)
Item Definitions:
Script object on map: Name the script "superAxeSkill" (no quotes)
Code: Select all
defineObject{
name = "party",
class = "Party",
editorIcon = 32,
onDrawSkills = function(gui_context)
if gui_context.mouseDown(0) then
superAxeSkill.check()
end
end,
}Code: Select all
defineObject{
name = "super_axe",
class = "Item",
uiName = "Axe of Might",
model = "assets/models/items/ancient_axe.fbx",
description = "It's a super axe!",
skill = "axes",
gfxIndex = 158,
attackPower = 36,
accuracy = 0,
coolDownTime = 6.3,
attackMethod = "meleeAttack",
attackSwipe = "horizontal",
attackSound = "swipe_heavy",
impactSound = "impact_blade",
weight = 7.3,
gameEffect = "Additional +30 to Attack Power for Figters proficient with Axe level 40.",
onEquipItem = function(champion, slot)
superAxeSkill.bonus(champion, slot) end
}
cloneObject{
name = "super_axe_with_bonus",
baseObject = "super_axe",
uiName = "Axe of Might (+30!)",
attackPower = 66,
onEquipItem = function(champion, slot)end,
onUnequipItem = function(champion, slot)
setMouseItem()
setMouseItem(spawn("super_axe"))
end,
}
Code: Select all
-- This script applies the bonus as soon as the weapon skill is sufficient.
alreadyQualified = {false,false,false,false}
function check()
for x = 1,4 do
if not alreadyQualified[x] then
local champion = party:getChampion(x)
local weapon = champion:getItem(7)
local weapon2 = champion:getItem(8)
if weapon ~= nil and weapon.name == "super_axe" then
bonus(champion, 7)
elseif weapon2 ~= nil and weapon2.name == "super_axe" then
bonus(champion, 8)
end
end
end
end
function bonus(champion, slot)
if champion:getSkillLevel("axes") > 39 then
alreadyQualified[champion:getOrdinal()] = true
champion:removeItem(slot)
champion:insertItem(slot, spawn("super_axe_with_bonus"))
end
end
Project Files: https://www.dropbox.com/sh/cjhppiy9jnva ... S1LQi5gU2a
Last edited by Isaac on Sat Jun 28, 2014 7:18 pm, edited 9 times in total.
Re: attack power
And this is why I mentioned Isaac.
I thought Isaac might be able to come up with a nifty weapon script on the fly, however if you have the axe equipped when you level up it won't register the addition to attack power until you take the axe off and reequip it. Also be aware that this script doesn't affect the character's overall attackPower, so it won't add to the attack rating of the weapon in the character's other hand.
I thought Isaac might be able to come up with a nifty weapon script on the fly, however if you have the axe equipped when you level up it won't register the addition to attack power until you take the axe off and reequip it. Also be aware that this script doesn't affect the character's overall attackPower, so it won't add to the attack rating of the weapon in the character's other hand.
Re: attack power
There is a third file: a party hook for Object.lua, I forgot to include it first time around; I noticed when I was making the Dat.Grimfan wrote:And this is why I mentioned Isaac.![]()
I thought Isaac might be able to come up with a nifty weapon script on the fly, however if you have the axe equipped when you level up it won't register the addition to attack power until you take the axe off and reequip it. Also be aware that this script doesn't affect the character's overall attackPower, so it won't add to the attack rating of the weapon in the character's other hand.
*And a minor bug fix in superAxeSkill
Re: attack power
I just snuck onto the editor to check out your work and the script functions perfectly. Well done!
I know who to turn to if I get into a pickle with my mod (which is coming along slowly but surely).
I know who to turn to if I get into a pickle with my mod (which is coming along slowly but surely).
Re: attack power
Why not give the Item a strength bonus and at the same time reduce the load to the normal load amount of a character?
So the player didn´t see the more strength effect in inventory but have more attack power. Would that be possible?
So the player didn´t see the more strength effect in inventory but have more attack power. Would that be possible?