I created it based on zimberzimber wisp monster, which has only a particle body.
This one has additional model and particle ratached to the capsule
I added storesourcedata = true to the custom model, but it doesn't change anything to the issue
If you spawn it from the console, all is normal, but if you save, without killing the monster, then reload, the monster is still there but invisible
Code: Select all
defineObject{
name = "quantum_guardian",
baseObject = "base_monster",
components = {
{
class = "Model",
model = "assets/models/monsters/medusa.fbx",
storeSourceData = true,
enabled = false,
},
{
class = "Animation",
animations = {
idle = "assets/animations/monsters/medusa/medusa_idle.fbx",
moveForward = "assets/animations/monsters/medusa/medusa_walk.fbx",
strafeLeft = "assets/animations/monsters/medusa/medusa_strafe_left.fbx",
strafeRight = "assets/animations/monsters/medusa/medusa_strafe_right.fbx",
turnLeft = "assets/animations/monsters/medusa/medusa_turn_left.fbx",
turnRight = "assets/animations/monsters/medusa/medusa_turn_right.fbx",
attack = "assets/animations/monsters/medusa/medusa_attack.fbx",
gazeAttack = "assets/animations/monsters/medusa/medusa_gaze_attack.fbx",
getHitFrontLeft = "assets/animations/monsters/medusa/medusa_get_hit_front_left.fbx",
getHitFrontRight = "assets/animations/monsters/medusa/medusa_get_hit_front_right.fbx",
getHitBack = "assets/animations/monsters/medusa/medusa_get_hit_back.fbx",
getHitLeft = "assets/animations/monsters/medusa/medusa_get_hit_left.fbx",
getHitRight = "assets/animations/monsters/medusa/medusa_get_hit_right.fbx",
fall = "assets/animations/monsters/medusa/medusa_get_hit_front_left.fbx",
},
currentLevelOnly = true,
},
{
class = "Monster",
meshName = "medusa_mesh",
hitSound = "warden_hit",
dieSound = "warden_die",
hitEffect = "hit_dust",
deathEffect = "wisp_death",
capsuleHeight = 0.2,
capsuleRadius = 0.7,
health = 500,
evasion = 0,
protection = 5,
exp = 500,
flying = true,
immunities = { "sleep", "blinded" },
resistances = { shock = "immune", cold = "weak", poison = "immune", fire = "weak" },
traits = { "elemental" },
},
{
class = "UggardianBrain",
name = "brain",
sight = 7,
allAroundSight = true,
morale = 100,
},
{
class = "MonsterMove",
name = "move",
sound = "quantum_guardian_move",
cooldown = 1.25,
dashChance = 50,
},
{
class = "MonsterTurn",
name = "turn",
sound = "no_sound",
animationSpeed = 10,
},
{
class = "Timer",
name = "disrupted",
timerInterval = 8,
enabled = true,
disableSelf = false,
onActivate = function(self)
if self.go.brain.seesParty then
local champion
for i = 1, math.random(1,4) do
-- for i = 1, 4 do
champion = party.party:getChampionByOrdinal(i)
if champion and champion:isAlive() then
champion:setConditionValue("disrupted", 5)
end
end
end
end,
},
{
class = "MonsterAttack",
name = "rangedAttack",
attackType = "projectile",
attackPower = 10,
cooldown = 2,
repeatChance = 0,
animation = "attack",
sound = "no_sound",
shootProjectile = "lightning_bolt",
onAttack = function(self)
local dx,dy = getForward(self.go.facing)
local x = self.go.x + dx*1
local y = self.go.y + dy*1
local spell = spawn("quantum_meteor", self.go.level, x, y, self.go.facing, self.go.elevation)
end,
-- projectileHeight = 1.3,
-- animationSpeed = 3,
},
{
class = "MonsterChangeAltitude",
name = "changeAltitude",
sound = "quantum_guardian_move",
},
{
class = "Light",
parentNode = "capsule",
color = vec(2.5, 5, 5),
brightness = 2,
range = 3,
fillLight = true,
},
{
class = "Particle",
name = "corpse",
parentNode = "capsule",
emitterMesh = "mod_assets/models/strange_device.fbx",
particleSystem = "force_field_small",
offset = vec(0,-0.4,0),
},
{
class = "Model",
name = "forcefield",
model = "mod_assets/models/strange_device.fbx",
parentNode = "capsule",
offset = vec(0,-1,0),
rotation = vec(0,0,0),
storeSourceData = true,
},
{
class = "Particle",
parentNode = "capsule",
particleSystem = "force_field_small",
offset = vec(0,-0.75,0),
},
},
}