Page 1 of 1
Tome of (Insertname)
Posted: Wed Mar 11, 2015 5:44 pm
by Emera Nova
So basically I'm wanting to blend different tomes together and see if they are able to have applied properitys that can also go into the negative.
Example being A health tome that gives say 50 hp instead of 25 but removes 25 energy.
Is this possible? if so how? And is it possible to do the same thing with protections and skill points?
Re: Tome of (Insertname)
Posted: Wed Mar 11, 2015 7:03 pm
by minmay
Yes, by passing a negative number instead of a positive number, yes it works for protection/evasion/stats. You can take away skill points, but of course you also need to add code to take away a skill level, it makes no sense for the player to end up with negative skill points. And then you need to handle what happens when a level 1 farmer with no skills or points reads the tome. It also doesn't sound interesting in the first place.
Re: Tome of (Insertname)
Posted: Wed Mar 11, 2015 9:55 pm
by Emera Nova
So this is the code I have atm for a tome that gives more hp but lowers the overall energy.
Code: Select all
defineObject{
name = "Tome_health",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/tome.fbx",
},
{
class = "Item",
uiName = "Tome of Healths",
description = "A thick tome that thoroughly describes the diet and excercises of the hermits of Basabua.",
gfxIndex = 30,
weight = 1.0,
gameEffect = "Health +100","Energy -25",
traits = { "tome" },
},
{
class = "UsableItem",
sound = "level_up",
onUseItem = function(self, champion)
hudPrint(champion:getName().." gained Health +100.")
champion:modifyBaseStat("max_health", 100,"max_energy", -25)
champion:modifyBaseStat("health", 100, "energy", -25)
return true
end,
},
},
}
When I go to place an item into the game tho it ends up crashing the game xD so I'm guessing something there isn't set correctly.
Re: Tome of (Insertname)
Posted: Wed Mar 11, 2015 10:03 pm
by minmay
modifyBaseStat only takes two arguments, not four. You can't modify two different stats in the same call.
Re: Tome of (Insertname)
Posted: Wed Mar 11, 2015 10:46 pm
by Emera Nova
Code: Select all
defineObject{
name = "Tome_health",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/tome.fbx",
},
{
class = "Item",
uiName = "Tome of Healths",
description = "A thick tome that thoroughly describes the diet and excercises of the hermits of Basabua.",
gfxIndex = 30,
weight = 1.0,
gameEffect = "Health +100","Energy -25",
traits = { "tome" },
},
{
class = "UsableItem",
sound = "level_up",
onUseItem = function(self, champion)
hudPrint(champion:getName().." gained Health +100.")
champion:modifyBaseStat("max_health", 100,"max_energy", -25)
champion:modifyBaseStat("health", 100, "energy", -25)
return true
end,
},
},
}
So should I change it to:
Code: Select all
champion:modifyBaseStat("max_health", 100)
champion:modifyBaseStat("max_energy", -25)
champion:modifyBaseStat("health", 100)
champion:modifyBaseStat("energy",-25)
Also when I put in the negative sign in the modifyBaseStat it shows up as black vs the blue which is the number.
Re: Tome of (Insertname)
Posted: Wed Mar 11, 2015 11:10 pm
by Mutman
You can also use my book skins I made to give them proper feel
Here:
http://www.nexusmods.com/legendofgrimrock2/mods/13/?
Re: Tome of (Insertname)
Posted: Fri Mar 13, 2015 2:23 am
by Emera Nova
Soo my last idea of how to fix that didn't work... Any ideas?
Re: Tome of (Insertname)
Posted: Mon Mar 16, 2015 8:46 pm
by Emera Nova
How to I make it so it has a negative value? And is it possible to make it take energy awhile while increasing the health? From anything i've tried it won't run properly.