Divergent/mods/Redone Limansk and Hospital/gamedata/scripts/redone_lc_kat_transition_lo...

111 lines
3.7 KiB
Plaintext
Raw Permalink Normal View History

function actor_on_first_update()
local lc_pool = {
["lc_kat01_kat02"] = {
pos = vector():set(-75.825736999512, 31.959331512451, 677.81079101562),
smart = "katacomb_smart_terrain",
spot = "level_changer_spot_mini",
hint = "space_restrictor_to_rostok_desc",
},
["lc_kat01_kat02.1"] = {
pos = vector():set(-75.778915405273, 31.957206726074, 678.24426269531),
smart = "katacomb_smart_terrain",
spot = "level_changer_spot_mini",
hint = "space_restrictor_to_rostok_desc",
},
["lc_kat01_kat02.2"] = {
pos = vector():set(-76.451171875, 31.9587059021, 677.56561279297),
smart = "katacomb_smart_terrain",
spot = "level_changer_spot_mini",
hint = "space_restrictor_to_rostok_desc",
},
["lc_kat01_kat02.3"] = {
pos = vector():set(-75.596542358398, 31.958549499512, 677.50256347656),
smart = "katacomb_smart_terrain",
spot = "level_changer_spot_mini",
hint = "space_restrictor_to_rostok_desc",
},
["lc_kat01_kat02.4"] = {
pos = vector():set(-74.652267456055, 31.980018615723, 677.97442626953),
smart = "katacomb_smart_terrain",
spot = "level_changer_spot_mini",
hint = "space_restrictor_to_rostok_desc",
},
["lc_kat01_kat02.5"] = {
pos = vector():set(-75.775314331055, 31.959434509277, 677.16015625),
smart = "katacomb_smart_terrain",
spot = "level_changer_spot_mini",
hint = "space_restrictor_to_rostok_desc",
}
}
for sec,v in pairs(lc_pool) do
local se = get_story_se_item(sec)
if not (se) then
local pos = v.pos
local vid = level.vertex_id(pos)
local gid = SIMBOARD.smarts_by_names[v.smart].m_game_vertex_id
se = alife():create(sec,pos,vid,gid)
end
if (se.position:distance_to_sqr(v.pos) > 0.1) then
local pos = v.pos
local vid = level.vertex_id(pos)
local gid = SIMBOARD.smarts_by_names[v.smart].m_game_vertex_id
TeleportObject(se.id,pos,vid,gid)
end
if (level.map_has_object_spot(se.id,v.spot) == 0) then
level.map_add_object_spot_ser(se.id,v.spot,game.translate_string(v.hint))
end
end
end
function check_name(actor,obj,p)
return p and p[1] and obj and string.find(obj:name(),p[1]) and true
end
function teleport_actor(actor,obj)
local p = {
["lc_kat01_kat02"] = {
pos = vector():set(-75.825736999512, 31.959331512451, 677.81079101562),
w_p = vector():set(-75.474349975586, 33.441356658936, 679.43859863281),
smart = "katacomb_smart_terrain",
},
["lc_kat01_kat02.1"] = {
pos = vector():set(-75.825736999512, 31.959331512451, 677.81079101562),
w_p = vector():set(-75.474349975586, 33.441356658936, 679.43859863281),
smart = "katacomb_smart_terrain",
},
["lc_kat01_kat02.2"] = {
pos = vector():set(-75.825736999512, 31.959331512451, 677.81079101562),
w_p = vector():set(-75.474349975586, 33.441356658936, 679.43859863281),
smart = "katacomb_smart_terrain",
},
["lc_kat01_kat02.3"] = {
pos = vector():set(-75.825736999512, 31.959331512451, 677.81079101562),
w_p = vector():set(-75.474349975586, 33.441356658936, 679.43859863281),
smart = "katacomb_smart_terrain",
},
["lc_kat01_kat02.4"] = {
pos = vector():set(-75.825736999512, 31.959331512451, 677.81079101562),
w_p = vector():set(-75.474349975586, 33.441356658936, 679.43859863281),
smart = "katacomb_smart_terrain",
},
["lc_kat01_kat02.5"] = {
pos = vector():set(-75.825736999512, 31.959331512451, 677.81079101562),
w_p = vector():set(-75.474349975586, 33.441356658936, 679.43859863281),
smart = "katacomb_smart_terrain",
},
}
local sec = obj and obj:section()
local v = sec and p[sec]
if (v and v.w_p and v.pos and v.smart) then
db.actor:set_actor_position(v.w_p)
end
end
function on_game_start()
RegisterScriptCallback("actor_on_first_update",actor_on_first_update)
end