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!
I have a question about the rat swarm. What component lets it move through a grating/porticulus ? Is it the rat swarm brain.
I have a wall with a hole in it on the bottem that is the size of a green slime. I want to green slime to move through it. the wall has a gate node, so it functions as a grating. ... what should I add to the slime so that it can move towards the player and not get stuck ?
Or is there another way to make this work ?
If I make it a normal base wall.. it wont stop the player from walking through the wall
Just make a simple function connected to a floor trigger.
So for example when you enter the room and have vision of the hole in the wall, the slime moves out the wall to attack you.
green_slime_1.brain:enable()
As for the wall. Simply use any object with an obstacle component on the square behind the wall where the slime is.
And keep it as a base wall.
Disable the model in case you can look through the hole.
A monster can move out of an obstacle, but not back in.
Blood Moon will completely eliminate default spells "cast by hand/wand" is disabled and the mage class will simply have naked physical hands just like a fighter. The mod will only feature 3 classes: fighter, mage, rogue. The only difference between these classes will be their health/energy pool and 1 unique passive. + strength / + willpower / + critical respectively.
It will also eliminate "resting" Pressing R to fully regenerate your party makes little sense in this mod.
The mod features magic wands with dual functionality.
For example a staff of fire will have fireburst as primary action (leftclick) and shoot custom fireballs as secondary action (rightclick) of the character.
Therefor these wands cannot be used to cast the default spells and the runepanel is therefor unavailable.
I'm transforming Blood Moon into a Dark Souls experience. Disable any form of health and energy regeneration.
(utility magic wands will be available with a healing spell at the cost of energy/charges) or expensive potions.
Rest at a bonfire to resurrect dead heroes and regenerate health and energy at the cost of reviving every single enemy.
This also adds the possibility to "kindle" a bonfire upgrading a bonfire so that all monsters around you become stronger making them drop better loot.
Melee weapons will consume energy like in log1
As for wands, I was looking into charges.
Now the issue I have is that I need to come up with a way that touching this bonfire (big invisible button) will also recharge all items in inventories + equipped wands.
The best I can come up with is installing a recharging station that simply destroys the wand and instantly gives an identical wand with full charges back. Manually recharging every single wand by dropping it on the recharging station surface is tedious and kinda ruins the gameplay flow with a long script where I need to add every single item with charges manually.
The other possibility is simply forget about charges and rely entirely on energy, balancing the magic wands so that they use little energy so a mage character doesn't run out of energy after defeating 2 monsters.
You can recharge an item without destroying it by using CastSpellComponent:recharge(). Take a look at the Crystal Shard of Recharging item in the standard assets.
This recharges all items in the party's inventory:
function rechargeAllItems()
local function rechargeItem(item)
for _,c in item.go:componentIterator() do
if c:getClass() == "CastSpellComponent" and c:getCharges() then -- don't recharge items with nil (unlimited) charges
c:recharge()
end
end
end
local function searchContainer(c)
for index=1,c:getCapacity() do
local item = c:getItem(index)
if item then
for _,c in item.go:componentIterator() do
if c:getClass() == "ContainerItemComponent" then
searchContainer(c)
end
end
rechargeItem(item)
end
end
end
for i=1,4 do
local champion = party.party:getChampion(i)
for slt,item in champion:carriedItems() do
for _,c in item.go:componentIterator() do
if c:getClass() == "ContainerItemComponent" then
searchContainer(c)
end
end
rechargeItem(item)
end
end
if getMouseItem() then rechargeItem(getMouseItem()) end
end