ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sun Nov 17, 2019 5:43 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Making Addons Halp
PostPosted: Thu Apr 02, 2015 8:30 pm 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
Is there a 'addons for dummies' thread anywhere? Has anyone written a guide to doing things? Is there an IRC where I could beg people to hold my hand as I fail to look competent?
I think I might be able to muddle through a really simple addon just by reading one that I have and mimicking it, but I'm still nervous.

...like, the wiki says to make a directory. Does it just mean a folder? None of the other addons are folders they're TEAAs...

Edit: iiiif it's not clear I have zero coding knowledge at all.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Thu Apr 02, 2015 8:32 pm 
Offline
Sher'Tul

Joined: Sun Jun 15, 2014 12:19 am
Posts: 1151
Location: Yeehaw, pardner
Open up a TEAA with 7zip or whatever.

_________________
A little bit of a starters guide written by yours truly here.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Thu Apr 02, 2015 8:32 pm 
Offline
Uruivellas

Joined: Wed Apr 30, 2008 5:55 pm
Posts: 708
A .teaa is just a zip file holding the addon folder (the one the wiki tells you to make). A good starting point is to unzip a few of the simpler addons and poke them a bit. :)

_________________
Addons: Arcane Blade Tweaks, Fallen Race, Monk Class, Weapons Pack
Currently working on Elementals. It's a big project, so any help would be appreciated. :)


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Thu Apr 02, 2015 8:33 pm 
Offline
Sher'Tul

Joined: Sun Jun 15, 2014 12:19 am
Posts: 1151
Location: Yeehaw, pardner
grayswandir wrote:
A .teaa is just a zip file holding the addon folder (the one the wiki tells you to make). A good starting point is to unzip a few of the simpler addons and poke them a bit. :)


That awkward moment when you both post at the same time.

_________________
A little bit of a starters guide written by yours truly here.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Thu Apr 02, 2015 8:51 pm 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
grayswandir wrote:
A .teaa is just a zip file holding the addon folder (the one the wiki tells you to make). A good starting point is to unzip a few of the simpler addons and poke them a bit. :)

(Looks down at WinRAR)
"newBirthDescriptor {
type = 'subrace',
name = 'Fallen',"

...hee.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 2:38 am 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
New question, miraculously may be the last for now...

How do you set what icon a talent uses? New effects have it as part of their description, but talents don't seem to. Do you have to include the icon you want to use as new data named after the talent?


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 2:46 am 
Offline
Uruivellas

Joined: Wed Apr 30, 2008 5:55 pm
Posts: 708
Talents have their icon filename default to their shortname. You can override this with the image field, just like effects do.
Effects also have a default filename, but a lot of the time they reuse the talent icon instead.

Relevant code from data/talents.lua:
Code:
if not t.image then
   t.image = "talents/"..(t.short_name or t.name):lower():gsub("[^a-z0-9_]", "_")..".png"
end


So, generally you just put the image file in the proper place in the overload directory.

_________________
Addons: Arcane Blade Tweaks, Fallen Race, Monk Class, Weapons Pack
Currently working on Elementals. It's a big project, so any help would be appreciated. :)


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 2:49 am 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
You're a lifesaver! If all goes well, I'll be testing this in a few minutes.

edit: ...didn't work! I'll have to read through all the code again. wwhelp.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 10:32 am 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
Okay, I managed to find the FIRST bug (missed a comma), but I don't know what's messing things up this time...

Lua Error: /engine/utils.lua:1782: /data-rhalorenrace/talents.lua:64: '}' expected (to close '{' at line 57) near 'getSave'
At [C]:-1
At [C]:-1 error
At /engine/utils.lua:1782 loadfilemods
At /engine/interface/ActorTalents.lua:31 loadDefinition
At /hooks/rhalorenrace/load.lua:9
At [string "return function(l, self, data) local ok=false..."]:1
At /mod/load.lua:271
At [C]:-1 require
At /engine/Module.lua:160 load
At /engine/Module.lua:955 instanciate
At /engine/utils.lua:2197 showMainMenu
At /engine/init.lua:162
At [C]:-1 dofile
At /loader/init.lua:204

newTalent{
short_name = 'INFERNO_SHIELD_OF_TAINT',
name = "Shield of Taint",
type = {"race/rhaloren", 2},
mode = "passive",
require = racial_req2,
points = 5
getSave = function(self, t) return self:combatTalentScale(t, 5, 25, 0.75) end,
power = function(self, t) return self:combatTalentScale(t, 7, 25) end,
passives = function(self, t, p)
self:talentTemporaryValue(p, "combat_spellresist", t.getSave(self, t))
self:talentTemporaryValue(p, "resists",{[DamageType.NATURE]=t.power(self, t)})
end,
info = function(self, t)
local netpower = t.power(self, t)
return ([[Unnatural power flows through the Rhalorens veins, helping them resist magic and causing natural energies to recoil from them.
Increase spell save by +%d and nature resistance by %d%%.]]):
format(t.getSave(self, t), netpower)
end,
}

The error is saying that there should be a } on the line with getSave, but the talents its based on don't have one. Can anyone point out the obvious for me?
(I'm saddened that this reveals what I was working on. I wanted it to be a surprise.)


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 10:42 am 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 5952
Comma missing after points = 5? Or is that the one you already found?

_________________
My feedback meter decays into coding. Give me feedback and I make mods.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 11:38 am 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
Ah! No, that'll be it. Commas are my bane, thank you. X_x

(A few minutes later after realising she left this on the post screen)

I ACTUALLY GOT IN GAME THIS TIME. A Momentous occasion. I mean, I don't seem to have a doll working, and apparently I messed up my third talent real bad somehow, but I got in!

Lua Error: /engine/interface/ActorTalents.lua:80: bad argument #3 to 'info' (number expected, got nil)
At [C]:-1
At [C]:-1 info
At /engine/interface/ActorTalents.lua:80 info
At /mod/class/Actor.lua:5468 getTalentFullDescription
At /mod/dialogs/LevelupDialog.lua:921 getTalentDesc
At /mod/dialogs/LevelupDialog.lua:682 tooltip
At /mod/dialogs/elements/TalentTrees.lua:184 updateTooltip
At /mod/dialogs/elements/TalentTrees.lua:110 fct
At /engine/Mouse.lua:76 receiveMouseMotion
At /engine/Mouse.lua:96 delegate
At /engine/ui/Dialog.lua:602 mouseEvent
At /engine/ui/Dialog.lua:343 fct
At /engine/Mouse.lua:76

Relevant talent:

newTalent{
short_name = 'INFERNO_BLOOD_TITHE',
name = "Blood Tithe",
type = {"race/rhaloren", 3},
require = racial_req3,
points = 5,
no_energy = true,
cooldown = 30,
is_spell = true,
tactical = { BUFF = 2 },
getLifeDrain = function(self, t) return self:getTalentLevel(t) * 3 end,
getDuration = function(self, t) return self:getTalentLevelRaw(t) + 5 end,
action = function(self, t)
self:setEffect(self.EFF_BLOOD_TITHE, self:getTalentLevelRaw(t) , {power= self:getTalentLevelRaw(t)})
return true
end,
info = function(self, t)
local lifedrain = t.getLifeDrain(self, t)
local Duration = t.getDuration(self, t)
return ([[Your hunger for knowledge and powers is embodied in the way you fight, and you draw vitality from the destruction you cause.
For the next %d turns, damage you deal will cause you to heal for %d%% of the damage done.]]):
format(Duration,LifeDrain,Penetration,Damage)
end,
}

...while I'm on this spell, I'm concerned about balancing the lifedrain. My original plan was a sustain that drained an amount of your resources each turn, but when I considered coding that I cried. Currently its 3-18% for 6-10 turns, but it feels like 3% would be useless. Maybe if I make it 2/level plus a base of five or something?


Last edited by astralInferno on Fri Apr 03, 2015 11:59 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 11:58 am 
Offline
Perspiring Physicist

Joined: Sun Sep 09, 2012 7:43 am
Posts: 5952
You haven't defined Penetration.

_________________
My feedback meter decays into coding. Give me feedback and I make mods.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 12:00 pm 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
...oh man that IS obvious. I knew it would be obvious.
Thank you so much. DXD


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 12:20 pm 
Offline
Uruivellas

Joined: Mon Jan 27, 2014 10:40 am
Posts: 703
...I removed the penetration and the damage from the end, and it still gives exactly the same error. I am now really confused.


Top
 Profile  
 
 Post subject: Re: Making Addons Halp
PostPosted: Fri Apr 03, 2015 1:59 pm 
Offline
Uruivellas

Joined: Wed Apr 30, 2008 5:55 pm
Posts: 708
astralInferno wrote:
Lua Error: /engine/interface/ActorTalents.lua:80: bad argument #3 to 'info' (number expected, got nil)
Code:
local lifedrain = t.getLifeDrain(self, t)
local Duration = t.getDuration(self, t)
return ([[Your hunger for knowledge and powers is embodied in the way you fight, and you draw vitality from the destruction you cause.
For the next %d turns, damage you deal will cause you to heal for %d%% of the damage done.]]):
   format(Duration,LifeDrain,Penetration,Damage)
That's the error message for an improper call to format. Argument #1 is the actual string itself ("Your hunger ..."), and arguments 2+ are the rest of the parameters (Duration, LifeDrain, etc.). So according to the error #3, LifeDrain, is nil, when it's supposed to be a number.

If you look, you define "local lifedrain", not "local LifeDrain".

_________________
Addons: Arcane Blade Tweaks, Fallen Race, Monk Class, Weapons Pack
Currently working on Elementals. It's a big project, so any help would be appreciated. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group