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!
KhrougH wrote: ↑Tue Oct 30, 2018 7:39 am
i can't use Grimrock Model Toolkit. i have a macbook. so i go straight to the mod_asset folder
Blender then. It's the same general task.
good , good... it's getting better... fixing troubles.
gate node changing works, normalmap modification works, also modify object in blender and than making a define object works.
bongobeat wrote: ↑Sun Oct 28, 2018 8:14 pm
Hi there,
Can someone explain how the magic resistances work please? I mean how is calculated the total magic resistances, with additionnal gears.
I want to remove temporally 60 % of all resistances.
AndakRainor offers a method by which to accurately get resistance values here^^
Now the issue, in fetching accurate values for some of our champ stats is - pending on what and where you are doing these calculations (eg - trait hook) ....... the accuracy of the fetched stat values can vary - this is because there is an "priority order" to which the vanilla game calculates statistic values.
Minmay has given us this order (I believe this to be up to date) :
-----------------------------stat recompute order:
--1. items in inventory from 1 to BackpackFirst-1 in order
--2. conditions in undefined order (pairs)
--3. skills in undefined order (pairs)
--4. traits in undefined order (pairs)
----------------------------applied after all onRecomputeStats are called:
--5 protection is rounded to the nearest integer
--6 leadership and nightstalker
--7 light and heavy armor penalties
--8 strength, dexterity, vitality, willpower bonuses to max load, evasion, health and health regen, energy and energy regen, resistances
--9 (after strength/dexterity/vitality/willpower are applied), resistances are clamped between 0 and 100, health is clamped at max_health, energy is clamped at max_energy
--10 when resting, evasion is decreased by 100
This shows that we encounter problems if trying to to fetch an actual value for a statistic whilst the game is in the middle of recalculating that statistic. This is actually something I need to revisit and check and double check myself. However, I will post my resistance modifying trait so you can get an idea of how to code that up:
{
name = "correct_resistance",
uiName = "Core Hidden Trait",
iconAtlas = "mod_assets/textures/gui/blank_borders/blank64x80.tga",
icon = 0,
charGen = false,
hidden = true,
group = "core",
description = "...no descript needed for hidden traits...",
--------------------------------------
onRecomputeStats = function(champion, level)
if level > 0 then
local statResTab = {strength = "fire", dexterity = "shock", vitality = "poison", willpower = "cold"}
for k,v in pairs(statResTab) do
local currStat = champion:getCurrentStat(k)
local diff = currStat - 10
if diff >= 1 then
champion:addStatModifier("resist_"..v, - (diff * 2))
end
end
end
end,
},
Now while this works for my purposes (the only stat bonus given to resists are done and capped at champ creation - no more resist bonuses from increasing stats after the game begins) .... Im unsure on how this cleanly stands up to the aforementioned problem w the stat calc process....
EDIT: In fact I remember someone specifically telling me NOT to get Stat values in the onRecomputeStat hook - as I have done in the above definition (local currStat = champion:getCurrentStat(k))
I remember less so a solution to that being.....(sorry this was a while back) .... Call up a custom get Stat Function that will refer to either a global statistic variable .........OR a Config Table .......OR something else that will hold the statistic value constant until your code manually updates it. Then you can get / fetch a stable value of your statistic.
Plz anyone, tell me if Ive got this wrong -
I think this issue is important ....and a clear reliable method to read stat values would is needed + would benefit all modders
I was playing with the idea of making structures rise out of the sea or ground.
For example, solving a puzzle where a pyramid rises out of the sea revealing a new dungeon to explore.
Don't mind the current wall clipping issues, this is just haphazardly 5 minutes of concept work. And wall clipping during movement can easily be discarded by adding dust particles and earthquake screen shaking. And structures that rise out of the sea can't have clipping issues
Not at home now, I'll release my dungeon editor file tonight or tomorrow, so you can take a look yourself.
Nothing fancy, just some timer hooked to a movement script with setPosition that stops when it reaches the desired height.
An invisible exit and then some ".model:disable()/enable()" trickery.
Tonight I'm going to try and make a boat float over a river. When that works I will release the next update of my dungeon file.
I will have to check for minimal savestate compatibility as well first.
I was looking into spawning particle effects to cover up wall clipping, when rising up structures from up the ground. Is there a list of particle effects I can call upon? For example the undead monster spawns dirt particle effects when crawling from under the ground.
I was also looking at Minmay's scripts in Artifacts of Might, especially where the particle effect "dm_wood_shatter" is called upon, but my lack of braincells and my lack of coding knowledge just made my brain hurt trying to comprehend those advanced scripts.
The best I can come up with is a bunch of invisible undead with everything disabled and then with delayed calls calling their "dirt" particle effect every second, then igniting the invisible undead with a firewall so it looks like the plants in front of the structure get destroyed by the fire and the way is cleared.
Pompidom wrote: ↑Fri Nov 02, 2018 10:52 pm
I was looking into spawning particle effects to cover up wall clipping, when rising up structures from up the ground. Is there a list of particle effects I can call upon?
There is a folder in the asset pack that has all of the particle definition scripts.
By examining the ones in the asset pack, and referencing the properties list below, one can define their own custom particle effects to use in the game.
function earthquake()
if forest_plant_cluster_01_109 then
forest_plant_cluster_01_109:spawn("particle_system")
.particle:setParticleSystem("earthquake_dust")
end
end