Page 1 of 1
What is the Name of the Reshape Weapon/Armour Talent? REALLY
Posted: Sat Jul 25, 2015 3:12 am
by xnd
newTalent{
name = "Reshape Weapon/Armour", image = "talents/reshape_weapon.png",
type = {"psionic/finer-energy-manipulations", 2},
what is the name of that talent?
because trying to find out its name... NONE OF THESE WORK:
THEY ALL GIVE A TABLE NIL VALUE OR FAIL TO PERFORM ARITHMETIC (the slash divide causes that one):
[ActorTalents.T_RESHAPE_WEAPON/ARMOUR] = 1,
[ActorTalents.T_RESHAPE_WEAPON_ARMOUR] = 1,
[ActorTalents.T_RESHAPE_WEAPON] = 1,
[ActorTalents.T_RESHAPE_WEAPON_/_ARMOUR] = 1,
[ActorTalents.T_RESHAPE_WEAPONARMOUR] = 1,
so even trying to add it into a simple birth class fails.
it took me a while to realize i left out the U but it still doesnt work.
trying to copy the talent exactly as it is into a talent file and just rename it also fails with same errors (which happens to most talents I try to do anything with, these table nil errors).
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Sat Jul 25, 2015 5:30 am
by HousePet
Its "Reshape Weapon/Armour", but that isn't actually what you want to know.
The id is "T_RESHAPE_WEAPON/ARMOUR", to enter it in a way the code understands, you can't use the self.T_... notation, you have to use self["T_RESHAPE_WEAPON/ARMOUR"].
Although "T_RESHAPE_WEAPON/ARMOUR" might also work.
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Sun Jul 26, 2015 4:19 am
by xnd
hmm, keeps wanting to make the slash a math if i follow the same format as other talents in birth class
these all work:
[ActorTalents.T_WEAPON_FOLDING] = 1,
[ActorTalents.T_SPIN_FATE] = 1,
[ActorTalents.T_MATTER_WEAVING] = 1,
[ActorTalents.T_STONE_SKIN] = 1,
but the slash makes that name fail.
[ActorTalents."T_RESHAPE_WEAPON/ARMOUR"] = 1,
?
that didnt work.
other codes like
game.player:learnTalent(game.player.T_RESHAPE_WEAPON/ARMOUR, true, 1)
that work certain places for other talents also did not work for this precause of the slash
well i managed to stick the relevant code in a different talent now so solved but thx / curious.
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Sun Jul 26, 2015 10:50 pm
by grayswandir
Due to various reasons, you can just use the string in place of the talent id like that.
Behind the scenes, ActorTalents.T_WEAPON_FOLDING resolves to "T_WEAPON_FOLDING".
So you can just do T_WEAPON_FOLDING = 1, etc.
xnd wrote:[ActorTalents."T_RESHAPE_WEAPON/ARMOUR"] = 1,
You can't do ." like that. Instead you want [ActorTalents["T_RESHAPE_WEAPON/ARMOUR"]] = 1,
In lua, A.B is just shorthand for A["B"]. But for something like A.B/C, you can't use the shorthand, because it thinks you're trying to divide A.B with C. But the quotes in the longhand fix that: A["B/C"].
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Sun Jul 26, 2015 11:49 pm
by xnd
thanks for info.
that does add it (i had typed that but thought it didnt work since it greyed out the code in the quotes just as the other quotes try did : P).
well its better where i stuck the shaping code, if it functions, since in class file it brings with it telekinetic grasp stuff.
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Mon Jul 27, 2015 1:45 am
by HousePet
That's what I said.
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Mon Jul 27, 2015 3:44 am
by xnd
i looked in combat.lua like you said for superpower and also noticed the reshape there!:
--- Gets the 'power' portion of the damage
function _M:combatDamagePower(weapon_combat, add)
if not weapon_combat then return 1 end
local power = math.max((weapon_combat.dam or 1) + (add or 0), 1)
if self:knowTalent(self["T_RESHAPE_WEAPON/ARMOUR"]) then power = power + self:callTalent(self["T_RESHAPE_WEAPON/ARMOUR"], "getDamBoost", weapon_combat) end
return (math.sqrt(power / 10) - 1) * 0.5 + 1
end
So, then i'd assume the code for the talent that I copied and put in another talent isnt enough to make it work because I would also have to alter the combat lua (which im not gonna try to attempt) with the name of that new talent?
this is troublesome if whenever I copied any talent code to make a new talent, there is other code elsewhere keyed to the name of the original talent and so i may have talents that part work or dont work. would it work to then just grab this code also and stick it in the talent itself?! probably not?
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Mon Jul 27, 2015 10:48 am
by fateriddle
Dumb question, where do I find and read the code?
Re: What is the Name of the Reshape Weapon/Armour Talent? RE
Posted: Mon Jul 27, 2015 5:21 pm
by xnd
...so looks like I have to actually make a combat.lua in superload/mod/class/interface ?? and add my talents in that so it adds the code to the combat.lua?
i thought the game would error me if stuff wasnt working. i have various things, like code from carbon spikes, which are also noted in the combat.lua, so i guess talents ive made are not actually functioning? i wonder where else things might be mentioned.
---
"Dumb question, where do I find and read the code?"
assuming thats not said because of me basically asking the same thing,
its like here
C:\Users\Admin\Downloads\t-engine4-windows-1.3.1\t-engine4-windows-1.3.1\game
wherever you have the game.
a file like te4-1.3.1.teae is you rename it with .zip and then unzip the code and open it in like notepad++ free program you can get.
and then you make this face
