#im going insane over this modkit please help

39 messages · Page 1 of 1 (latest)

smoky shard
#
function ADVR.onEntityDeath(living, source, lastDamage)
    if player.SharedCashPool >= 4 and player.currentWispAmount < player.maxWispAmount then
        Recharge()
    end
end

--and

function ADVR.onEntityDeath(living, source, lastDamage)
    if player.currentWispAmount < player.maxWispAmount and helperMethods.IsValidWithLuck(0,0.3,0.15) then
        game.SpawnObjectNetwork(objects.COMPANION_WISP, game.playerController.rightHand.transform.position)
    end
end

--in two different relics
#

first one tells me that function is not a function and has no __call metamethod

#

second one doesnt even do anything somehow

#

both of them have entityDeathListeners for Objects.COMPANION_WISP

#

they do run, but the second one doesnt do anything

#

even though ive confirmed that the conditions both return true

#

and that my wisp system works

#

also, on a related note, why does innocents mark not have a check for if you have max wisp cap?

#

that oversight has sent me on a 2 day long dive into the rabbit hole of the companion wisps and how broken they are

#

.Despawned() doesnt work either

#

unless that doesnt happen on death

#

can you only have one onEntityDeath() or something?

#

thats only for it

#

not other functions

#

the others work

civic parcel
#

Can you send over the whole file so I can take a look?

smoky shard
#

also yea if this does turn out to be my code being bugged then uh

#

ig just close the post (but also id like to know what the hell is going on as well)

civic parcel
#

The issue is that function AICompanionWisp.Spawned() is not a valid method.
In order to listen to a spawn event you need to add a pre or post object spawn Listener.

For example progress_willful_hearts uses this.

Put this in onLoad

    base.postObjectSpawnListeners = {
        game.GetObjectMapping("item_ethereal_heart"),
    }

And then you listen to the spawn event like this:

function ADVR.onPostObjectSpawn(prefab, override)
        -- do stuff
end
smoky shard
#

Alright

#

I dont get why ethereal drum fails tho still

#

Cause i have confirmed its running and the conditions can be met

#

This isnt a bug report really anymore but yea

#

I would still like to be able to figure out ethereal drum breaking and why my active relics are so damn big though

#

I'll probably be able to figure out ethereal drum on my own

#

But I do have absolutely no idea about the big active relics issue

civic parcel
#

hmm ethereal drum looks good to me, nothing stands out at first glance 🤔

smoky shard
#

yea it just doesnt trigger

#

thats why i thought it was a bug with the whole "duplicate field" thing

#

btw, what actually is base?

#

cause .postObjectSpawnListeners is in the same format as entityDeathListeners but it just uses base instead

#

base.postObjectSpawnListeners = {game.GetObjectMapping("COMPANION_WISP")}
and would this be right for it?

smoky shard
#

ill probably close this

tribal kraken
smoky shard
#

he would be able to see it anyways as someone with admin perms no?

#

also he reopened it i think cause i already closed it

tribal kraken