to freeze monster groups
-
- Posts: 21
- Joined: Wed Aug 30, 2017 9:21 pm
to freeze monster groups
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.
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.
Re: to freeze monster groups
I think it may have something to do with restoring a multi-textured monster's original materials after the thaw. Certain monsters cannot be frozen for that reason; or it may just be to avoid the need to account for one frozen monster in a group.
-
- Posts: 21
- Joined: Wed Aug 30, 2017 9:21 pm
Re: to freeze monster groups
I have not found a solution to freeze monster groups.
I think i will not put monster groups in my custom dungeon, or i will give all monster races included in monster groups immunity to freezing (if they don't already have it ). In this way, i could make my custom dungeon's logic more coherent.
Thank you.
I think i will not put monster groups in my custom dungeon, or i will give all monster races included in monster groups immunity to freezing (if they don't already have it ). In this way, i could make my custom dungeon's logic more coherent.
Thank you.
Re: to freeze monster groups
Just an idea....
One possible way to hack around this could be to use the ice_cube model
(this model is used in AndakRainor's spell pack for an.... Ice Cube related spell)
If monsters are in a group and would be frozen > cancel the freeze component
spawn the ice_cube model over them and disable their brains
Sorry if this is vague...
I haven't explored the ice_cube model, nor Andak's spell he uses it in
It may be worth downloading his spell pack and taking a look
Akroma
One possible way to hack around this could be to use the ice_cube model
(this model is used in AndakRainor's spell pack for an.... Ice Cube related spell)
If monsters are in a group and would be frozen > cancel the freeze component
spawn the ice_cube model over them and disable their brains
Sorry if this is vague...
I haven't explored the ice_cube model, nor Andak's spell he uses it in
It may be worth downloading his spell pack and taking a look
Akroma
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: to freeze monster groups
Monsters, which have disabled brains are not frozen, they still move in their idle-animation.
Disableing their animation-component could have weired results...
Disableing their animation-component could have weired results...
Re: to freeze monster groups
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...
Cheers THOM!
Labyrinth of Lies (viewtopic.php?f=14&t=4400)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Legacy of Lies (viewtopic.php?f=22&t=12983&hilit=+legacy)
Re: to freeze monster groups
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.
you are looking for: monster:setCondition("frozen", 4)
just go through monsters on the cells ang give them this one
Overload frostbolt spell with your own definition loaded in init.lua (open frostbolt from assetpack), here is pseudo code, you have to write real code:
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,
},
},
}
spawn timer
go through cell, for each monster do
monster.brain:disable()
monster.animation:setMaxUpdateDistance(0)
monster.model:setMaterial(material)
when timer is done, for each monster on cell do
monster.brain:enable()
monster.animation:setMaxUpdateDistance(32)
monster.model:setMaterial(originalmaterial)
destroy timer
[/color]
I'm the Gate I'm the Key.
Dawn of Lore
Dawn of Lore
-
- Posts: 21
- Joined: Wed Aug 30, 2017 9:21 pm
Re: to freeze monster groups
Thank you.
Unfortunately, i have only a basic knowledge of modding. So, i don't know exactly how to carry out the following actions:
-- get monster position
-- for each entity at cell loop
-- go through cell, for each monster do
Could someone explain me how to write these commands ?
Thank you for your help.
Unfortunately, i have only a basic knowledge of modding. So, i don't know exactly how to carry out the following actions:
-- get monster position
-- for each entity at cell loop
-- go through cell, for each monster do
Could someone explain me how to write these commands ?
Thank you for your help.
Re: to freeze monster groups
- Get monster position:
The findEntity function will give access to the monster by id, if it exists.Code: Select all
findEntity( "my_monster_id" )
SpoilerShowFrom there it depends on what information you are interested in.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
- For each entity at cell loop:
You need a map component for this function.SpoilerShowCode: 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("---")
- Go through cell, for each monster do:
This normally only applies to monster groups, and they will show up as a single (grouped) object. If you just want to count them, then the monster's monstergroup component offers that.Code: Select all
zarchton_pair_1:monstergroup:getCount()
SpoilerShowCode: 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