CosmicGerbil: I have given some of my Gerband races resists. Here is an example:

new_player_descriptor 
{
        type = "subrace"
        define_as = "SUBRACE_DESERT"
        name = "Desert_Gerbil"
        desc = {
                "Gerbils are small furry rodents.",
                "Desert gerbils live in burrows under the barren deserts of Gerband.",
        }
levels =
        {
                [ 1] = { RESIST=getter.resists{POIS=50} }
                [ 1] = { RESIST=getter.resists{FEAR=50} }
        }
}

However these resists aren't showing up on the "C" screen. Does anybody know what I'm doing wrong? Thanks in advance.

DarkGod: Modules are responsible for their C screen, cehck data/display/charsheet.lua

CosmicGerbil: Oops, sorry, I didn't explain properly. It does show the resists for poison and fear on my character sheet (as well as all the other resists). However when I choose to play as a race with resists (such as my gerbil race above), it doesn't say that I have those reists on my character screen. And if I enter wizard mode and press K, it doesn't actually say my character has resist fear or poison. How do I actually make the resists work?

BucketMan: Try this:

levels =
{
        {
                [ 1] = { RESIST=getter.resists{ POIS=50 FEAR=50 }
        }
}

Also...I'm not sure, but fear might be a boolean resist. You might check on that.

DarkGod: Ah yes. Well first thing do as BucketMan says, it is the correct way. Now fear resists is boolean in alpha10, but will be valuedin alpha11. Obviously I'm speaking for ToME, not the T-Engine since the engine really does not care about resists ;)

CosmicGerbil: I tried what BucketMan said and it caused my mod to crash. I don't think that works in Windows.

ShrikeDeCil If FEAR is a boolean, '50' is an odd setting. Drop the _fear_ part and see if it works with, say, poison and fire.

CosmicGerbil: I changed the fear to fire and it still gives an error. It doens't seem to like the syntax of having two resists on one line.

Also in ToME, the elves' resists don't seem to be working either (they aren't showing up on the C screen or when you enter wizard mode and press K).

I don't know how to actually test any resists, because the potion of poison doesn't work yet and none of the monsters will attack me.

NeilStevens: Note that BucketMan's code snippet it missing a close brace.

CosmicGerbil: Oh yeah. OK that's stopped the crashing :)

NerdanelVampire: I've been having a similar mysterious no-resists, no-sustains, no-speeds problems with my character creation for a long while now. Reading this page, I've started to wonder if it's possible that my addition of horoscopes broke things. You see, you can have resists and sustains etc. both from your race and your horoscope, both starting at level 1 (or higher). I really don't want to remove this feature, so I need to get around this somehow. How can I have overlapping levels definitions in different files?

NeilStevens: You're probably missing either a) a resist combination function or b) something in data/player/calc.lua

BucketMan: Oops. Sorry. ;) (corrected in case anyone else reads through this) I haven't run into any problems assigning intrinsics, but then neither Dragonball T nor Bard's Tale use descriptors to assign them. I've generally just used calc for it. I'll take a look tonight and see if I can come up with something that works that people can copy and paste from.

NerdanelVampire: I've been looking into this, and I remain mystified.

The resistance combination function from module.lua:

-- How should 2 resists be added
resist_add = function(type, resist1, temporary1, resist2, temporary2)
        if temporary1 == temporary2 then
                return 100 - (((100 - resist1) * (100 - resist2)) / 1$
        else
                if resist1 > resist2 then
                        return resist1
                else
                        return resist2
                end
        end
end

My calc.lua is based on ToME's calc.lua, with a few differences that shouldn't matter here. (I did a diff.) I have player level scaling to 50 instead of 100, and hitpoints similarly in the old style. I have also removed encumbrance's effect on hunger rate, as that seemed to be the cause of the excessive food consumption I and players have noticed. Here's the snippet about sustains.

-- Sustain stats 
if flag_exists(flags, FLAG_SUST_STATS) then
        flag_add_increase(player.intrinsic_flags[FLAG_SUST_STATS],
                                          flags[FLAG_SUST_STATS])
end

a) Could it be that the engine can't handle my races + horoscopes combination?

b) Now that I think of it, could it be that I'm not allowed to do things like:

levels = 
{
        [ 1] = { RESIST=getter.resists{FIRE=40} }
        [10] = { RESIST=getter.resists{FIRE=50} }
        [20] = { RESIST=getter.resists{FIRE=60} }
        [30] = { RESIST=getter.resists{FIRE=70} }
        [40] = { RESIST=getter.resists{FIRE=50} }
        [50] = { RESIST=getter.resists{FIRE=90} }
}

How else would I handle increasing a resist or a speed value with level?

NerdanelVampire: I tried commenting out the resist that increased with level. No effect.

BucketMan: I took a look. I don't think you're doing anything wrong. It looks to me like the levels{} portion of descriptors simply hasn't been implemented yet. Nothing in there works for the ToME module, either. Dwarves don't resist blindness, ents have base speed, etc.

DarkGod: That's probable yes :)

Module Developers Discussion/How to code in resists (last edited 2006-11-14 08:39:17 by DarkGod)