Very true - probably more trouble than its worth in that case.THOM wrote:Monsters, which have disabled brains are not frozen, they still move in their idle-animation.
Disableing their animation-component could have weired results...
AdrianKnight wrote:Hello.
I noticed that in Grimrock 2 it is not possible to freeze monster groups.
In your opinion, is it possible to allow freezing monster groups modifying some scripts in my custom dungeon ?
How could it be possible ?
Thank you.
Code: Select all
defineObject{
name = "frostbolt_blast",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "frostbolt_hit",
destroyObject = true,
},
{
class = "Light",
color = vec(0.25, 0.5, 1),
brightness = 40,
range = 10,
fadeOut = 0.5,
disableSelf = true,
},
{
class = "TileDamager",
attackPower = 10,
damageType = "cold",
sound = "frostbolt_hit",
onHitMonster = function(self, monster)
if math.random() < 0.25 then -- here set % chance for freeze
-- get monster position
-- for each entity at cell loop
-- if its monster then
monster:setCondition("frozen", 4)
-- close if
-- close loop
end
end,
},
},
}
Code: Select all
findEntity( "my_monster_id" )
Code: Select all
do
print( findEntity("air_elemental_1").name )
end
do
local monster = findEntity("air_elemental_1")
print( monster.name, monster.level, monster.x, monster.y, monster.facing, monster.elevation )
end
Code: Select all
for entity in party.map:entitiesAt(15,15) do
print( entity.name, entity:getPosition() )
end print("---")
for entity in torch_holder_1.map:entitiesAt(15,15) do
print( entity.name, entity:getPosition() )
end print("---")
for entity in Dungeon.getMap(1):entitiesAt(15,15) do
print( entity.name, entity:getPosition() )
end print("---")
Code: Select all
zarchton_pair_1:monstergroup:getCount()
Code: Select all
do
--choose your location
local map, x, y = 1, 15, 14
local cell = Dungeon.getMap(map):entitiesAt(x, y)
for monster in cell do
if monster.monstergroup then --checking for .monstergroup component
local entityType = monster.monstergroup:getMonsterType()
--print to console----------------------------------
if type(entityType)=='table' then
entityType = tostring(unpack(entityType))
end
print( monster.name..": comprised of "..monster.monstergroup:getCount().." "..entityType )
--print to hud--
entityType = entityType:match("%D+") --strips numbers
entityType = iff(entityType:find('y',-1),entityType:sub(1,-2)..'ies',entityType..'s')
hudPrint( monster.name..": comprised of "..monster.monstergroup:getCount().." "..entityType )
----------------------------------------------------
end
end
end