ratman wrote: ↑Sun Aug 02, 2020 5:30 pm
How do you plan to add PCs later?
I haven't planned it all out yet, but it will probably be a mercenary or something in a tavern
Sorry I don't know much about scripting at all-
In this case, I meant technically (in Lua script) how you intend to add them.
edit- I am also trying to make something like the ratling_warg_pair, except with a zarchton and a spider. In the game it walks around fine, but after one attack they both stop moving and don't attack, but the animation for both still plays. Is there an easy way to make this work?
The Zarchton has a leap-attack and backward evasion, the spider doesn't. This causes a few problems; the first with the dynamicObstacle component, the second is because the two monsters can end up on separate tiles if (when) the Zarchton dodges the player—but the two would still behave like they are on the same tile.
Here is a drop-in replacement for the paired group.
Code: Select all
defineObject{
name = "paired_spider",
baseObject = "spider",
components = {
{
class = "Monster",
meshName = "spider_mesh",
hitSound = "spider_hit",
dieSound = "spider_die",
hitEffect = "hit_goo",
capsuleHeight = 0.2,
capsuleRadius = 0.8,
health = 450,
exp = 225,
traits = { "animal" },
onInit --This replaces the Zarchton's custom brain with a generic one. This prevents the leap attacks and evasion.
= function(self) for obj in self.go.map:entitiesAt(self.go.x, self.go.y) do
if obj.brain and not obj.id == self.go.id then
obj:removeComponent('brain')
obj:createComponent('MeleeBrain', 'brain')
end
end
end,
onDie -- This restores the Zarchton's custom brain once the spider dies, and there is no longer a group.
= function(self) for obj in self.go.map:entitiesAt(self.go.x, self.go.y) do
if obj and obj.name == 'zarchton' then
obj:removeComponent('brain')
obj:createComponent('ZarchtonBrain', 'brain')
end
end
end,
},
},
}
defineObject{
name = "zarchton_spider_pair",
baseObject = "base_monster_group",
components = {
{
class = "MonsterGroup",
monsterType = {"paired_spider","zarchton"},
count = 2,
},
},
}
*This can be improved with custom, alternate animations for each; used while in the group. This could prevent their movements clipping each other as they attack, and walk around.