My one off spawns look like this;
[935]
; cse_abstract properties
section_name = controller_tubeman
name = esc_controller_01
position = -166.770004272461,-18.3899993896484,-128.830001831055
direction = 0,0,0
; cse_alife_object properties
game_vertex_id = 115
distance = 15
level_vertex_id = 420394
object_flags = 0xffffffbf
custom_data = <<END
[smart_terrains]
esc_small_home3 = false
END
; cse_visual properties
visual_name = monsters\kontroler\kontroler
; cse_alife_creature_abstract properties
g_team = 0
g_squad = 1
g_group = 22
health = 1
dynamic_out_restrictions =
dynamic_in_restrictions =
upd:health = 1
upd:timestamp = 0
upd:creature_flags = 0
upd:position = -166.770004272461,-18.3899993896484,-128.830001831055
upd:o_model = 0
upd:o_torso = 0,0,0
upd:g_team = 0
upd:g_squad = 1
upd:g_group = 22
; cse_alife_monster_abstract properties
upd:next_game_vertex_id = 65535
upd:prev_game_vertex_id = 65535
upd:distance_from_point = 0
upd:distance_to_point = 0
; cse_ph_skeleton properties
; cse_alife_monster_base properties
; se_monster properties
These types of spawns all work fine.
My respawns;
[940]
; cse_abstract properties
section_name = respawn
name = esc_cat_01
position = -166.399993896484,-2.61999988555908,-77.0599975585938
direction = 0,0,0
; cse_alife_object properties
game_vertex_id = 115
distance = 4.90000009536743
level_vertex_id = 420394
object_flags = 0xffffff3e
custom_data = <<END
[respawn]
respawn_section = cat_weak
;max_count = 8
;min_count = 3
max_spawn = 8
idle_spawn = often
conditions = 100
END
; cse_shape properties
shapes = shape0
shape0:type = sphere
shape0:offset = 0,0,0
shape0:radius = 1
; cse_alife_space_restrictor properties
restrictor_type = 0
; se_respawn properties
For some reason, these types of spawns don't work at all :'( Strange thing is, I use that exact code in the all.spawn for respawning NPCs and it works fine.
This is what my modded general_lair.ltx looks like;
[l01_escape]
chimera = weak
cat = weak
boar = weak, normal, strong
bloodsucker = weak, normal, strong
burer = weak
controller = weak, normal, strong
dog = weak, normal, strong
flesh = weak, normal, strong
giant = weak, normal, strong
poltergeist = weak, normal, strong
pseudodog = weak, normal, strong
pseudo_gigant = normal, strong
snork = weak, normal, strong
tushkano = normal
zombie = normal, strong
Repeat that list of mutants for all levels.
This is what my respawn.ltx looks like;
[respawn]
GroupControlSection =
$spawn = "ai\respawn"
class = RE_SPAWN
script_binding = bind_respawn.bind
AFAIK nothing stopping my mutant respawns here.
This is what my smart_terrain_presets.ltx looks like;
chimera = weak
cat = weak
boar = weak, normal, strong
bloodsucker = weak, normal, strong
burer = weak
controller = weak, normal, strong
dog = weak, normal, strong
flesh = weak, normal, strong
giant = weak, normal, strong
poltergeist = weak, normal, strong
pseudodog = weak, normal, strong
pseudo_gigant = normal, strong
snork = weak, normal, strong
tushkano = normal
zombie = normal, strong
Repeat that list for all levels.
This is what monsters.ltx looks like;
#include "M_flesh.ltx"
#include "M_chimera.ltx"
#include "M_bloodsucker.ltx"
#include "M_dog.ltx"
#include "M_boar.ltx"
#include "M_pseudodog.ltx"
#include "M_burer.ltx"
#include "M_giant.ltx"
#include "M_controller.ltx"
#include "m_poltergeist.ltx"
#include "m_zombie.ltx"
#include "m_fracture.ltx"
#include "m_snork.ltx"
#include "m_cat.ltx"
#include "M_Rat.ltx"
#include "m_crow.ltx"
#include "m_tushkano.ltx"
#include "m_phantom.ltx"
AFAIK nothing wrong here.
se_monster.script;
--[[
Èçìåíåíèÿ script_version:
4 - ñîõðàíåíèå ïîëÿ job_online
5 - ñîõðàíåíèå ïîëÿ was_in_smart_terrain
]]
class "se_monster" (cse_alife_monster_base)
--------------------
function se_monster:__init (section) super (section)
self.ini = nil
self.ini_initialized = false
self.spawner_present = false
self.smart_terrain_conditions = nil
self.smart_terrain_conditions_initialized = false
self.check_distance = false
self.min_distance = 150
-- ýòîò ôëàã áåð¸òñÿ èç ðàáîòû ñìàðòà
-- true = âñåãäà â îíëàéíå
-- false = âñåãäà â îôëàéíå
-- condlist = óñëîâèå, êîòîðîå îòïðåäåëÿåò true èëè false
-- nil = ñìàðòó âñ¸ ðàâíî
self.job_online = nil
self.job_online_condlist = nil
-- ïîñåùàë ëè ñòàëêåð õîòü îäèí smart_terrain
self.was_in_smart_terrain = false
end
--------------------
function se_monster:get_ini()
if not self.ini_initialized then
self.ini = self:spawn_ini ()
self.ini_initialized = true
self.spawner_present = self.ini:section_exist ("spawner")
if self.ini ~= nil and self.spawner_present == true then
if self.ini:line_exist ("spawner", "check_distance") == true then
self.check_distance = self.ini:r_bool ("spawner", "check_distance")
if self.check_distance == nil then self.check_distance = false end
if self.ini:line_exist ("spawner", "min_distance") == true then
self.min_distance = self.ini:r_u32 ("spawner", "min_distance")
end
end
if self.min_distance == nil then
local sys = system_ini()
if sys ~= nil and sys:line_exist ("alife", "switch_distance") == true then
self.min_distance = sys:r_u32 ("alife", "switch_distance") - 50
if self.min_distance == nil then
self.min_distance = 150
else
if self.min_distance <= 50 then
abort ("SE_MONSTER - SWITCH DISTANCE IS TOO SMALL !!!")
end
end
else
self.min_distance = 150
end
end
end
end
end
--------------------
function se_monster:get_job_online()
if self.job_online_condlist == nil then
return self.job_online
else
return xr_logic.pick_section_from_condlist(db.actor_proxy, self, self.job_online) ~= nil
end
end
--------------------
function se_monster:can_switch_offline ()
if self:get_job_online() ~= nil then
return not self:get_job_online()
else
return cse_alife_monster_base.can_switch_offline (self)
end
end
--------------------
function se_monster:can_switch_online ()
if self:get_job_online() ~= nil then
return self:get_job_online()
end
--' self:get_ini()
--ñòàíäàðòíàÿ ïðîâåðêà ó ðîäèòåëÿ, åñëè íåò ñïàâíåðà èëè èãðîê ïîìåð
if self.ini == nil or self.spawner_present == false then --or (db.actor ~= nil and db.actor:alive () == false)
--if self.ini == nil or self.spawner_present == false or db.actor == nil
return cse_alife_monster_base.can_switch_online (self)
end
if self.online == false then
-- åñëè èãðîêà íåò, òî â îôôëàéí
if db.actor == nil or db.actor:alive () == false then return false end
--åñëè çàäàíà äèñòàíöèÿ ïðîâåðêè, òî ïðîâåðèì.
if self.check_distance == true then
--printf ("Check distance")
--ïîëó÷èì ïîçèöèþ.
local pos = level.vertex_position (self.m_level_vertex_id)
-- ïðîâåðèì äèñòàíöèþ äî èãðîêà. åñëè ìåíüøå òðåáóåìîé, òî îò âèíòà
if pos:distance_to (db.actor:position ()) < self.min_distance then
--printf ("Check distance 1")
return false
end
end
--âñå ïðîâåðêè ïðîøëè - ôèíàë, âûçîâ ñïàâíåðà
return xr_spawner.check_spawn (self) and cse_alife_monster_base.can_switch_online (self)
else
if db.actor == nil or db.actor:alive () == false then return true end
if xr_spawner.check_spawn (self) == true then
return true
end
if self.check_distance == true then
local pos = level.vertex_position (self.m_level_vertex_id)
-- ïðîâåðèì äèñòàíöèþ äî èãðîêà. åñëè áîëüøå òðåáóåìîé, òî îò âèíòà
if pos:distance_to (db.actor:position ()) > self.min_distance then
return false
end
end
return cse_alife_monster_base.can_switch_online (self)
end
end
--------------------
function se_monster:STATE_Write(packet)
cse_alife_monster_base.STATE_Write (self, packet)
if self.job_online == true then
packet:w_u8(0)
elseif self.job_online == false then
packet:w_u8(1)
elseif self.job_online == nil then
packet:w_u8(2)
else
packet:w_u8(3)
packet:w_stringZ(self.job_online_condlist)
end
packet:w_bool(self.was_in_smart_terrain)
end
--------------------
function se_monster:STATE_Read(packet, size)
cse_alife_monster_base.STATE_Read (self, packet, size)
if self.script_version >= 4 then
local t = packet:r_u8()
if t == 0 then
self.job_online = true
elseif t == 1 then
self.job_online = false
elseif t == 2 then
self.job_online = nil
else
self.job_online_condlist = packet:r_stringZ()
self.job_online = xr_logic.parse_condlist(nil, "se_monster:STATE_Read", "job_online", self.job_online_condlist)
end
end
if self.script_version >= 5 then
self.was_in_smart_terrain = packet:r_bool()
end
end
--------------------
function se_monster:on_before_register()
self:fill_exclusives()
end
--------------------
function se_monster:on_register()
cse_alife_monster_base.on_register( self )
--'self:fill_exclusives()
--' Âûòàëêèâàåì ìóòàíòîâ èç ìåñò, ãäå èõ íå äîëæíî áûòü.
--' Íóæíî òîëüêî äëÿ èãðû ñ ñîõðàíåíèÿ.
if self:alive() then
local sim = alife()
if sim then
local obj = sim:object(self.id)
local strn_id = obj:smart_terrain_id()
if strn_id ~= 65535 then
local strn = sim:object(strn_id)
if strn then
local strn_name = strn:name()
if string.find(self:name(), "pri_depot") and strn_name ~= "pri_depot" or
self:name() == "val_sos_bs" and strn_name ~= "val_sos" or
strn_name == "pri_monolith"
then
strn:unregister_npc(obj)
end
end
end
end
end
--' Íàðèñîâàòü ìàïñïîò ñ ñîáîé
--' if self:alive() and sim_statistic.show_monster_spot == true then
--' local community, rank = sim_statistic.getNpcType(self)
--' level.map_add_object_spot_ser(self.id, "alife_presentation_monstr", self:name().." "..community)
--' end
end
--------------------
function se_monster:on_unregister()
cse_alife_monster_base.on_unregister( self )
--' Óáðàòü ìàïñïîò ñ ñîáîé
--' if sim_statistic.show_monster_spot == true then
--' local community, rank = sim_statistic.getNpcType(self)
--' level.map_remove_object_spot(self.id, "alife_presentation_monstr")
--' end
smart_terrain.unregister_npc(self)
end
--------------------
function se_monster:on_death(killer)
cse_alife_monster_base.on_death(self, killer)
--' Óáðàòü ìàïñïîò ñ ñîáîé
if sim_statistic.show_monster_spot == true then
local community, rank = sim_statistic.getNpcType(self)
level.map_remove_object_spot(self.id, "alife_presentation_monstr")
end
end
--------------------
function se_monster:fill_exclusives()
self:get_ini()
self.smart_terrain_conditions = smart_terrain.read_smart_terrain_conditions( self )
if self.smart_terrain_conditions then
for name, condlist in pairs(self.smart_terrain_conditions) do
smart_terrain.exclusives[name] = (smart_terrain.exclusives[name] or 0) + 1
end
end
end
Maybe self.ini_initialized = false, self.spawner_present and self.smart_terrain_conditions_initialized need setting to true? Not sure if this script is vanilla or not... can't remember.
se_respawn;
local simMaxCount = {
stalker_novice = 40, stalker_regular = 70, stalker_veteran = 70, stalker_master = 50,
monolith_novice = 40, monolith_regular = 70, monolith_veteran = 70, monolith_master = 50,
military_novice = 40, military_regular = 70, military_veteran = 70, military_master = 50,
killer_novice = 40, killer_regular = 70, killer_veteran = 70, killer_master = 50,
ecolog_novice = 40, ecolog_regular = 70, ecolog_veteran = 70, ecolog_master = 50,
dolg_novice = 40, dolg_regular = 70, dolg_veteran = 70, dolg_master = 50,
freedom_novice = 40, freedom_regular = 70, freedom_veteran = 70, freedom_master = 50,
bandit_novice = 40, bandit_regular = 70, bandit_veteran = 70, bandit_master = 50,
zombied_novice = 40, zombied_regular = 70, zombied_veteran = 70, zombied_master = 50,
rat_weak = 0,
tushkano_weak = 200,
flesh_weak = 40, flesh_normal = 80, flesh_strong = 80,
boar_weak = 40, boar_normal = 80, boar_strong = 80,
dog_weak = 40, dog_normal = 150, dog_strong = 150,
pseudodog_weak = 40, pseudodog_normal = 80, pseudodog_strong = 80,
psy_dog_weak = 40, psy_dog_normal = 80, psy_dog_strong = 80,
zombie_weak = 40, zombie_normal = 80, zombie_strong = 80,
snork_weak = 40, snork_normal = 80, snork_strong = 80,
poltergeist_weak = 40,
pseudo_gigant_weak = 40,
controller_weak = 40,
burer_weak = 40,
cat_weak = 80,
bloodsucker_weak = 40, bloodsucker_normal = 80, bloodsucker_strong = 80
}
local idle_spawn_preset = {
seldom = 300*60,
medium = 240*60,
often = 180*60
Pretty sure only this part of se_respawn I edited.
Thats everything... I'm not missing anything here surely.. am I? Help someone