[DiscordArchive] hey <@271350028985958408>, in your old scripts when writing dungeon mobs, you use variables at the t
[DiscordArchive] hey <@271350028985958408>, in your old scripts when writing dungeon mobs, you use variables at the t
Archived author: Crow • Posted: 2022-10-28T17:30:40.879000+00:00
Original source
hey <@271350028985958408>, in your old scripts when writing dungeon mobs, you use variables at the top that look like tables, and say
dungeon name = {}
dungeonname.VAR = {}
is that how you differentiate instance ids? and is that relevant to eluna now or redundant?
Archived author: stoneharry • Posted: 2022-10-28T17:32:57.893000+00:00
Original source
There's an extension that handles storing data by map and instance ID for you now, i.e: `unit:GetData("key", value)` and `unit:SetData("key", value)`
If you try to key your table by instance ID still that is fine, but bear in mind instance IDs can be reused after a dungeon is reset
Archived author: Crow • Posted: 2022-10-28T17:36:32.093000+00:00
Original source
oh well, wouldnt you just reset the data when you when bosses die or events are over?
Archived author: Foe • Posted: 2022-10-28T17:37:36.694000+00:00
Original source
Not necessarily
Archived author: Foe • Posted: 2022-10-28T17:38:05.456000+00:00
Original source
Some dungeons you want to track progress through the dungeon as an example. It doesn't make sense to reset the data when the boss is dead, but when the instance is deinstantiated
Archived author: Foe • Posted: 2022-10-28T17:38:32.011000+00:00
Original source
If you leave the dungeon as an example then go back to it, you want it to keep track of whatever progression data from your previous visit
Archived author: Foe • Posted: 2022-10-28T17:38:51.698000+00:00
Original source
It's much cleaner to create the storage on dungeon creation, then remove it on dungeon deinstantiation
Archived author: Crow • Posted: 2022-10-28T17:39:58.427000+00:00
Original source
and how precisely does one do that
Archived author: Foe • Posted: 2022-10-28T17:41:37.712000+00:00
Original source
GetData and SetData is a good way to do it on a creature level, I don't remember if you can do it on an instance object. Generally you'd have two functions, one for when a dungeon is created and one for when the dungeon is destroyed. In the dungeon created function you'd write to a script-scope table and use the instance ID as key. On destruction you'd nil that table entry based on same instance ID
Archived author: Foe • Posted: 2022-10-28T17:43:06.489000+00:00
Original source
Actually you don't even need to update on destruction, you'd just use the initialize function and always overwrite any previous data tied to that instance ID