What makes a boss fight a boss fight?Khollik wrote:Hello
I'm looking for a way to not make the health bar appear during a boss fight (so the fight would be more stressful...). Does anyone know how to do it? Until now, I didn't find out![]()
Thanks
Khollik
Code: Select all
defineObject{
name = "boss_fight",
components = {
{
class = "BossFight",
},
{
class = "Controller",
onActivate = function(self)
self.go.bossfight:activate()
end,
onDeactivate = function(self)
self.go.bossfight:deactivate()
end,
},
},
placement = "floor",
tags = { "scripting" },
editorIcon = 280,
}
GameMode.playStream(name)
So one question leading to another one, is it something hardcoded or is there a way to change the ambient track directly?
Cheers
Khollik
Code: Select all
defineObject{
name = "grim_bed_2",
baseObject = "base_obstacle",
tags = { "furniture" },
components = {
{
class = "Model",
model = "mod_assets/grim_assets/grim_bed_2.fbx",
staticShadow = true,
},
{
class = "Clickable",
offset = vec(0, 0, 0), --0,1.375,0
size = vec(2.5, 1, 1), ---0.5,0.2,0.2
maxDistance = 1,
debugDraw = true,
onClick = function(self)
GameMode.setEnableControls(false)
delayedCall("miscel_script", 6, "sleep1")
playSound("snor1")
party.party:rest()
end,
},
}
}
Code: Select all
function sleep1()
GameMode.setEnableControls(true)
end
Code: Select all
function initParty()
party.party:addConnector("onWakeUp", self.go.id, "partyWakeUp")
end
function sleepStart()
GameMode.setEnableControls(false)
party.party:rest()
counter_1.counter:reset()
timer_1.timer:start()
end
function sleepEnd()
party.party:wakeUp(false)
end
function partyWakeUp()
timer_1.timer:stop()
GameMode.setEnableControls(true)
hudPrint("The party has woken up!")
end
initParty()
One way is to place party-only activated floor-triggers in every tile in the region; tiles that all connect to the same script. You can inspect the the triggers to learn the exact location, if useful to you.Curunir wrote:How would I go about checking to see if the party is within a certain range of map coordinates (let's say a 4x4 grid at x16-19 and y16-19, one tile away from a fountain model) and if they are, execute a script?
Code: Select all
--Place script_entity at top left of region.
--Set values of regionX, and regionY to the number of columns & rows to check
party.party:addConnector('onMove', self.go.id, "positionCheck")
region_active = true
regionX, regionY = 7,7
function positionCheck()
if region_active then
local width, height = party.x +regionX, party.y +regionY
if (party.x >= self.go.x and party.x <= width) and (party.y >= self.go.y and party.y <= height)
then
--=======================================[ triggered actions ]
print('Party is in region.')
party:spawn("shockburst").tiledamager:setAttackPower(1)
--============================================================
end
end
end
function setActive(self, bool)
if type(bool)=="boolean" then region_active = bool return end
if type(self)=="boolean" then region_active = self return end
region_active = not region_active
end