Jump to content

Recommended Posts

After digging through the dynamicmusic file, I noticed the game makes use of _iscave and _isruins variables (Which already uses inst:HasTag("cave"/"ruins")) to recognize if the player is within their ranges

Is there such a tag for being on the Lunar/Hermit Islands?

On 9/4/2024 at 2:57 AM, Sukaiba said:

After digging through the dynamicmusic file, I noticed the game makes use of _iscave and _isruins variables (Which already uses inst:HasTag("cave"/"ruins")) to recognize if the player is within their ranges

Is there such a tag for being on the Lunar/Hermit Islands?

the tags are attached to the whole world. that is sth totally different than to recognize where the player in the world is.

I'm out of modding since years, but I think there might be something called "areaaware", maybe search all lua files from the game for sth like this.
Eg there you will find things like

giver.components.areaaware:CurrentlyInTag("Atrium")

although I'm not sure if these Tags are the same kind of tags attached to prefabs

6 hours ago, Serpens said:

the tags are attached to the whole world. that is sth totally different than to recognize where the player in the world is.

I'm out of modding since years, but I think there might be something called "areaaware", maybe search all lua files from the game for sth like this.
Eg there you will find things like

giver.components.areaaware:CurrentlyInTag("Atrium")

although I'm not sure if these Tags are the same kind of tags attached to prefabs

Oh yeah, I am aware of the existance of areaaware, dynamicmusic.lua does seem to make use of areaaware to create functions that are used to trigger stuff, like so

local function IsInRuins(player)
    return player.components.areaaware ~= nil
        and player.components.areaaware:CurrentlyInTag("Nightmare")
end

local function IsOnLunarIsland(player)
    return player.components.areaaware ~= nil
        and player.components.areaaware:CurrentlyInTag("lunacyarea")
end

Although being a complete noob to .lua, most of the code present is complete white noise for me unless its something near universal and basic like conditions and establishing variables

The thing that puzzles me is that while it uses areaaware and functions involving it to trigger musical cues

            if IsOnLunarIsland(player) then
                if _busytheme ~= BUSYTHEMES.LUNARISLAND then
                    _soundemitter:KillSound("busy")
                    _soundemitter:PlaySound("turnoftides/music/working", "busy")
                end
                _busytheme = BUSYTHEMES.LUNARISLAND

Other instances such as Hermit Island or Farming, seemingly summon music cues without making use of area triggers

local function StartHermit(player)
    if _dangertask == nil and _pirates_near == nil and (_extendtime == 0 or GetTime() >= _extendtime) and _isenabled then
        if _busytask then
            _busytask:Cancel()
            _busytask = nil
        end
        if _busytheme ~= BUSYTHEMES.HERMIT then
            _soundemitter:KillSound("busy")
            _soundemitter:PlaySound("hookline_2/characters/hermit/music_work", "busy")
        end
        _busytheme = BUSYTHEMES.HERMIT

        _soundemitter:SetParameter("busy", "intensity", 1)
        _busytask = inst:DoTaskInTime(30, StopBusy, true)
        _extendtime = 0
    end
end

So I was curious if the game had player location or action tags besides areaaware, as I recall earlier versions of dynamicmusic.lua using a simple '_isruins' instead of CurrentInTag("Nightmare"), and even now it still makes use of an _iscave to determine if the player is on the Caves at all

I guess its time to scan every script on databundles to find any mention of areatags lol

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...