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?
Tome of (Insertname)
Re: Tome of (Insertname)
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.
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
-
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Tome of (Insertname)
So this is the code I have atm for a tome that gives more hp but lowers the overall energy.
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.
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)
modifyBaseStat only takes two arguments, not four. You can't modify two different stats in the same call.
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
-
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Tome of (Insertname)
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,
},
},
}
Code: Select all
champion:modifyBaseStat("max_health", 100)
champion:modifyBaseStat("max_energy", -25)
champion:modifyBaseStat("health", 100)
champion:modifyBaseStat("energy",-25)
Re: Tome of (Insertname)
You can also use my book skins I made to give them proper feel 
Here: http://www.nexusmods.com/legendofgrimrock2/mods/13/?

Here: http://www.nexusmods.com/legendofgrimrock2/mods/13/?
Runebooks: http://www.nexusmods.com/legendofgrimrock2/mods/13/? for Legend of Grimrock 2
Runebooks and books: http://grimrock.nexusmods.com/mods/217/ for Legend of Grimrock 1
Runebooks and books: http://grimrock.nexusmods.com/mods/217/ for Legend of Grimrock 1
-
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Tome of (Insertname)
Soo my last idea of how to fix that didn't work... Any ideas?
-
- Posts: 146
- Joined: Wed Jun 11, 2014 1:31 am
Re: Tome of (Insertname)
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.