I have a lot of moving and rotating stuff in the mod, including the one with MinimalSaveState.
For these primitives I have the function, which is called from onInit() hook of this object:
Code: Select all
defineObject{
name = "script_starter",
components = {
{
class = "Null",
onInit = function(self)
init_functions.script:movePrimitives()
end,
},
},
placement = "floor",
editorIcon = 256,
minimalSaveState = true,
}
Code: Select all
-- like this:
forest_ruins_wall_02_269.door:disable()
Code: Select all
function spin(entity, x, z, y)
local en = findEntity(entity)
if en then
en:setWorldRotationAngles(x, y, z)
else
print('no such entity: '..entity)
end
end
I assume that this is namespace related stuff, but I have no idea how to make it work Calling out for help!
Added: oh, and another question: I have not found the legal way to change accuracy or critical chance in condition definition, so I've used this hack, that surprisingly works (not only for wizards):
Code: Select all
defineTrait{
name = "wizard",
uiName = "Wizard",
icon = 33,
description = "As a wizard, you have a huge reserve of magical energy and deep knowledge of the Arcane sorcery arts.",
gameEffect = [[
- Health 40 (+2 per level), Energy 60 (+8 per level)
- You can learn and cast Arcane spells.
- Willpower +1 per level.
- You can cast spells with bare hands.]],
onRecomputeStats = function(champion, level)
if level > 0 then
level = champion:getLevel()
champion:addStatModifier("willpower", level)
champion:addStatModifier("max_health", 40 + (level-1) * 2)
champion:addStatModifier("max_energy", 60 + (level-1) * 8)
end
end,
onComputeAccuracy = function (champion, weapon, attack, attackType, skillLevel)
if champion:hasCondition("heroism") then
return 20
end
end,
onComputeCritChance = function (champion, weapon, attack, attackType, skillLevel)
if champion:hasCondition("heroism") then
return 4
end
end,
}