Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Moderator: Moderator
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Fayd, I'd be happy to build some framework for you. Class talents like this wouldn't be very hard for me. It might be easier for you to tweak existing code than to build it from scratch. If so, let me know.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
I sent you a PM to this effect, but I think I'd like to take you up on your offer.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Nate and I are working on the code, but we hit a bit of a wall for getting the player's stats, specifically the Luck stat. Also how to make the game update character stats based upon the current level of a particular resource.
-
- Spiderkin
- Posts: 543
- Joined: Sat Feb 11, 2012 1:12 am
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Get stats with getStr(), getLck(), etc methods. You'll use self:getLck() and such in most talents. There's documentation on the arguments you can pass to the getStat function.Fayd wrote:Nate and I are working on the code, but we hit a bit of a wall for getting the player's stats, specifically the Luck stat.
Here's an example:Fayd wrote:Also how to make the game update character stats based upon the current level of a particular resource.
You'll want to update the stats every game turn and whenever they use a talent, so in hooks/load.lua:
Code: Select all
local class = require"engine.class"
local ActorTalents = require "engine.interface.ActorTalents"
--runs every 10 game ticks
class:bindHook("Actor:actBase:Effects", function(self, data)
if self:knowTalent(ActorTalents.T_YOURTALENT) then
local t = self:getTalentFromId(ActorTalents.T_YOURTALENT)
t.updatestats(self, t) end
end)
--runs whenever an actor uses a talent
class:bindHook("Actor:actBase:Effects", function(self, data)
if self:knowTalent(ActorTalents.T_YOURTALENT) then
local t = self:getTalentFromId(ActorTalents.T_YOURTALENT)
t.updatestats(self, t) end
end)
Code: Select all
updatestats = function(self, t)
self:removeTemporaryValue("inc_stats", self.statboost)
local boost = math.ceil(self.yourresource / self.max_yourresource * 10)
self.statboosts = self:addTemporaryValue("inc_stats",
{
[Stats.STAT_STR] = boost,
[Stats.STAT_DEX] = boost,
[Stats.STAT_MAG] = boost,
[Stats.STAT_WIL] = boost,
[Stats.STAT_CUN] = boost,
[Stats.STAT_CON] = boost,
[Stats.STAT_LCK] = boost,
})
return true
end,
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
I'm pounding my way through 
Not a fan of how all of this code is set up though. A hundred different ways to do things, and none of them obvious, and none of the functions penetrable. What's your luck? Why, it's the seventh field of stats. Not stats.luck, but stats[7]. Or getStat(7). Or getLck, but where is that function defined? I can't find it. How do I change luck? Not with setLck, not even with setStat(7). With addTemporaryValue("inc_stats", { [(require "engine.interface.ActorStats").STAT_LCK] = -5 }) of course. Big fan of that argument? I'm not. And if I wanted to parse addTemporaryValue to figure it out, then I'm totally out of luck, because that function was written by R2D2. Or maybe with attr, which is at least parseable, even I can't figure out a reason for its existence-- it's really not hard to write self[prop] = (self[prop] or 0) + v, not any harder than it is to write self:attr(prop, v), and at least the former is comprehensible without tearing through the Remembrance of Things Past that is ToME source.
Pardon my rant, trying to parse this shit is really irritating. I'm sure there are reasons for all of this to be the way it is, but those reasons are not readily apparent to me, and I imagine most of you that have tried to do the same can sympathize with my frustration, even should it be misplaced.

Not a fan of how all of this code is set up though. A hundred different ways to do things, and none of them obvious, and none of the functions penetrable. What's your luck? Why, it's the seventh field of stats. Not stats.luck, but stats[7]. Or getStat(7). Or getLck, but where is that function defined? I can't find it. How do I change luck? Not with setLck, not even with setStat(7). With addTemporaryValue("inc_stats", { [(require "engine.interface.ActorStats").STAT_LCK] = -5 }) of course. Big fan of that argument? I'm not. And if I wanted to parse addTemporaryValue to figure it out, then I'm totally out of luck, because that function was written by R2D2. Or maybe with attr, which is at least parseable, even I can't figure out a reason for its existence-- it's really not hard to write self[prop] = (self[prop] or 0) + v, not any harder than it is to write self:attr(prop, v), and at least the former is comprehensible without tearing through the Remembrance of Things Past that is ToME source.
Pardon my rant, trying to parse this shit is really irritating. I'm sure there are reasons for all of this to be the way it is, but those reasons are not readily apparent to me, and I imagine most of you that have tried to do the same can sympathize with my frustration, even should it be misplaced.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
If you can't find some functions, they are either in the engine or the engine writes the functions itself.
Its a little bit confusing, but some of the code writes itself....
Its a little bit confusing, but some of the code writes itself....
My feedback meter decays into coding. Give me feedback and I make mods.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Which is the case, the engine creates get getXXX function for stats on the fly as you define stats.
You never need to know the numerical id of a stat; actor.STAT_LCK always works
You can increase stats with
actor:incStat(actor.STAT_LCK, X)
or
actor:incIncStat(actor.STAT_LCK, X)
The first increases the base stat (cant go beyond the limit), the second increases the bonus (like an item would)
You never need to know the numerical id of a stat; actor.STAT_LCK always works
You can increase stats with
actor:incStat(actor.STAT_LCK, X)
or
actor:incIncStat(actor.STAT_LCK, X)
The first increases the base stat (cant go beyond the limit), the second increases the bonus (like an item would)
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
It's okay, got what is hopefully the hard first part done, sent off to Fayd for refinement, although I do appreciate the comments about various ways to do things-- both because my occasional local luck = 7; getStat(luck) is bad form, and because I'd prefer intercepting functions (think onStatChange()) to checking variables at timed intervals, which is a bit of a kludge.
I figured there was generated code; I just don't think generated functions are appropriate in this situation.
I figured there was generated code; I just don't think generated functions are appropriate in this situation.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Progress update: Nate is fantastic; he's gotten almost all of the trees for Wyrdthieves completed. At the moment, they won't have any Card based skills to make life easier for nate and myself. I'm working on getting some rudimentary talent images in place, and will begin testing and tweaking things soon in preparation for a larger release.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
I'm going to say that especially because you're making this now, please fix the resource issue. It's really awkward. Imagine a buff says that it grants you +luck. Does that mean it gives you a luck resource, increases your luck, increases your luck and then decreases it at the end, what? Personally I would make it a separate resource from -100 to 100 called something else (I've seen fate and karma as suggestions, the latter i really prefer). It isn't affected by your luck stat but instead modifies your luck as a multiplier of it (not too much). Skills scale off of luck along with an additional stat. Certain skills could scale off of unluck (i.e. 50 - luck)
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
It is already fixed, no worries. When I took a look at the code it was dramatically easier to make a new resource than to tr to co-opt something that already existed. The resource is called "Fortune." It still scales with luck and given investment can be mechanically equal to Luck, but they are separate and distinct.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Yay sounds fun !
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
One... Question. I'm looking to test the code, but... I don't actually know how to make the zip a .teaa. I've tried renaming it but that doesn't seem to work, and there is no clear process outlined on the wiki or somewhere else I could find easily.
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
lol fayd, check PM
Re: Fate Meta-Class: Subclasses: Wyrdthief, Oracle, Champion
Thanks nate!
So, by way of news: The last two main talent trees have been sent to nate for construction.
So, by way of news: The last two main talent trees have been sent to nate for construction.