Party modding ??: add skills and traits to party creation

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Falkenwrath
Posts: 15
Joined: Tue Aug 04, 2015 6:32 am

Re: Party modding ??: add skills and traits to party creatio

Post by Falkenwrath »

ok script working, but I still want the traits I add at creation to show up in the character sheet after the game starts. benefits there but its not listed.... not huge deal but it would be nice to have it on screen that you have the ability.
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Party modding ??: add skills and traits to party creatio

Post by Zo Kath Ra »

Isaac wrote:
akroma222 wrote:Isaac, is that a custom Naga race inventory background I see??? ;)
A quick one for the test, yes. ;)
(Both now flipped, so that bracelet/cuffs can be seen as tail accessories; and that the glove slot doesn't look crowded.)
SpoilerShow
Image
Their racial food is burrow rat shanks?
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Party modding ??: add skills and traits to party creatio

Post by Isaac »

Zo Kath Ra wrote:Their racial food is burrow rat shanks?
I dunno... but it could make sense; snakes do eat rats.
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: Party modding ??: add skills and traits to party creatio

Post by FeMaiden »

Isaac wrote:
Zo Kath Ra wrote:Their racial food is burrow rat shanks?
I dunno... but it could make sense; snakes do eat rats.
how do you add a favorite food to a custom race?
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Party modding ??: add skills and traits to party creatio

Post by minmay »

you can't
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: Party modding ??: add skills and traits to party creatio

Post by FeMaiden »

minmay wrote:you can't
oh, I guess I misunderstood...it looked like isaac was saying he gave his "Lamia" race burrow rat shanks as a favorite food
User avatar
Zo Kath Ra
Posts: 937
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Party modding ??: add skills and traits to party creatio

Post by Zo Kath Ra »

FeMaiden wrote:
Isaac wrote:
Zo Kath Ra wrote:Their racial food is burrow rat shanks?
I dunno... but it could make sense; snakes do eat rats.
how do you add a favorite food to a custom race?
Create a new food item that checks the consumer's race:

Code: Select all

defineObject{
    name = "racist_rat_shank",
    baseObject = "base_item",
    components = {
        {
            class = "Model",
            model = "assets/models/items/rat_shank.fbx",
        },
        {
            class = "Item",
            uiName = "Burrow Rat Shank",
            gfxIndex = 16,
            weight = 0.8,
            traits = { "consumable" },
        },
        {
            class = "UsableItem",
            nutritionValue = 200,
            onUseItem = function(self, champion)
                if (champion:getRace() == "human") then
                    champion:modifyBaseStat("strength", 1)
                    hudPrint(champion:getName() .. " gained Strength +1.")
                end
            end,
        },
    },
    tags = { "food" },
}
It should +1 a random stat, but I'm too lazy to program that right now :)
And, for each champion, you'll need to keep track of how many racist_rat_shanks he/she/it has eaten. Then you can add code that implements this:
http://steamcommunity.com/app/251730/di ... 3896360145
SpoilerShow
I Peeked at game data and can confirm all favorite treats:
Humans - None
Insectoids - Horned Fruit
Lizardman - Turtle Egg
Minotaur - None
Ratling - Cheese

Stat progression works as follows:
First 3 Favorite Treats Eaten = +1 Random Stat
Next 4 Favorite Treats Eaten = +1 Random Stat
Next 5 Favorite Treats Eaten = +1 Random Stat
Next 6 Favorite Treats Eaten = +1 Random Stat
Next 7 Favorite Treats Eaten = +1 Random Stat
Next 8 Favorite Treats Eaten = +1 Random Stat
Next 9 Favorite Treats Eaten = +1 Random Stat
Next 10 Favorite Treats Eaten = +1 Random Stat
Next 11 Favorite Treats Eaten = +1 Random Stat
Next 12 Favorite Treats Eaten = +1 Random Stat

For a maximum of +10 Random Stats at 75 Favorite Treats consumed. And of course, there isn't anywhere near enough favorite treats in the game to max out this bonus
Last edited by Zo Kath Ra on Fri Nov 06, 2015 9:07 pm, edited 1 time in total.
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Party modding ??: add skills and traits to party creatio

Post by minmay »

no, that isn't enough to emulate racial food
1. racial food eaten is attached to the party member even across dungeons, if you import a party to another dungeon their racial food stats don't start over
2. racial food stat gains are determined at game start so that you can't savescum them

you can of course do 2. yourself easily, but not 1. the only way to accomplish 1. would be to temporarily change the race of the character to ratling/lizardman/insectoid and force-feed them that race's racial food, then change the race back to the custom one. unfortunately, that will play the "ratling_happy" sound effect (or equivalent one for another race) when a stat is increased, so you'd need to overwrite that sound with silence, and then in both ratling AND your custom race you'd need to check the characters' stats before and after eating the food so see if they changed, in which case you play ratling_happy for the ratling and whatever sound for the custom race. THEN you would have a good emulation of the effects of racial food that I know of.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
FeMaiden
Posts: 290
Joined: Wed Jan 16, 2013 8:16 am

Re: Party modding ??: add skills and traits to party creatio

Post by FeMaiden »

minmay wrote:no, that isn't enough to emulate racial food
1. racial food eaten is attached to the party member even across dungeons, if you import a party to another dungeon their racial food stats don't start over
2. racial food stat gains are determined at game start so that you can't savescum them

you can of course do 2. yourself easily, but not 1. the only way to accomplish 1. would be to temporarily change the race of the character to ratling/lizardman/insectoid and force-feed them that race's racial food, then change the race back to the custom one. unfortunately, that will play the "ratling_happy" sound effect (or equivalent one for another race) when a stat is increased, so you'd need to overwrite that sound with silence, and then in both ratling AND your custom race you'd need to check the characters' stats before and after eating the food so see if they changed, in which case you play ratling_happy for the ratling and whatever sound for the custom race. THEN you would have a good emulation of the effects of racial food that I know of.

Too much work. although it could have been fun....my mod has characters I made in it that the player has to use, and each one has a personality and they talk (emulated by using john wordsworths messageBoxes), I could have made like, one of the boys is a stoner that likes to get high on "herbs" and just totally loves mushrooms and I could make borra be his favorite food while one of the girls in the back row is a picky eater that only likes natural organic foods and complains all the time about having to eat the weird stuff around but absolutely loves pie and make the blueberry pie her "racial food"
(all these favorite foods would be hinted at through the dialogue).
but I don't think this is gonna happen lol
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Party modding ??: add skills and traits to party creatio

Post by petri »

FeMaiden wrote:but I don't think this is gonna happen lol
No need to give up :) Although emulating the exact behavior of racial favorite diet is hard as pointed out by minmay, you can get a similar effect by following Zo Kath Ra's example above. Small details like this can spice up your mod.
Post Reply