#How do you create chests with custom items inside

51 messages · Page 1 of 1 (latest)

tight sky
#

firstly, do you know how to get the flowscript with atlusscriptgui? (or another method?)

mint lagoon
#

ik I have to make a new procedure for it and then run that through the HTB, but I'm wondering if there's some kind of work around to DATTBOX mostly, since that'd be easiest

#

since I want to add chests without it interfering with those entries

#

and the ftd scares me tbh

tight sky
#

yes, looking at the script it does check that "var9 = FLD_GET_TBOX_ITEM_ID(var8)" but you CAN brute force anything in these files too in any case

mint lagoon
#

is there a good way to open the chest without using the function dedicated to it?

#

since that function gives you whatever item it gets from dattbox

#

and if I just give the item with the script I can open it and then give the player whatever I want rather than whatever I want and the tbox item

tight sky
#

I haven't actually tested any of this yet, but its really easy to do. you just hijack the original code

i might need some time to give an specific answer because i will have to test it. never done this. but you may find the chest I THINK using the https://amicitia.miraheze.org/wiki/Persona_5_Royal/dataR.cpk/Field field ids here. get the area where it appears and match with the file name. im assuming because its what makes most sense here

find where the game might be calling for the 'give item to player' thing

you make the code load these functions

SET_ITEM_NUM( (12288 + 243), 1 );
GET_ITEM_WINDOW( (12288 + 243), 1, 0 );

and have the specifics be the item category + decimal id. i'm pretty sure works either adding to the hex or adding to the corresponding decimal. the item is given silently, you need to show the item window

this emulates the giving of item and you can hardcode what you want with this. i'll probably change some chests myself eventually in my mod but right now i dont know the specifics, sorry if something doesnt work

Amicitia Wiki
mint lagoon
#

because getting the item from dattbox is part of the FLD_OPEN_TBOX or whatever function it's called

#

if there's a function related to opening the chest that still plays the animation but does not give the item, that'd be helpful

#

basically I want to be able to add custom TBOXes to maps ideally without using the table at all

tight sky
#

I'll look into this then. might take a while

mint lagoon
#

thanks

#

I'm working on events rn but I'll probably do further testing later

#

if I can't figure it out, worse comes to worst, maybe I'll hijack the search object animations, since you can play those without giving an item

tight sky
#

are you testing the new event tool? eventually i'll dabble on events and i cant imagine doing the old way

mint lagoon
#

I'm making custom events for my mod

tight sky
#

yeah, doesnt seem like you can

lets look at

// Procedure Index: 3
void common_dng_tbox()
{
    int var0;
    SET_COUNT(182, (GET_COUNT(182) + 1));
    var0 = FLD_GET_TBOX_FLAG();
    
    if (var0 == 0)
    {
        return;
    }
    else if (BIT_CHK(var0) == 0)
    {
    
        BIT_ON(var0);
        FLD_OPEN_TBOX_SIMPLE();
        dng_tbox_seq();
    }

}

here, if i add my item code and remove the fld_open_tbox, then it does work, but it doesnt play the animation

the code has to execute dng_tbox_seq(); next

void dng_tbox_seq()
{
dng_tbox_Tutorial();
dng_tbox_flag_set();
}

any code here has already executed past the chest opening. so yeah, FLD_OPEN_TBOX_SIMPLE is what dictates it... as well as its cousing FLD_OPEN_TBOX(); for the locked chests it seems?

and the only times it seems the code sets anything before the animation, are these

SET_COUNT(182, (GET_COUNT(182) + 1));
var0 = FLD_GET_TBOX_FLAG();

unless this correlates with the chest table, this is a dead end.

mint lagoon
#

since whether there's anything in them or not, you can activate them

#

so I can just make it so there is something in one

#

though idk if third eye will reveal it

tight sky
#

so yeah i put a return at the beginning of every other function and that doesnt do anything. its def not here

>search object

where's that?

mint lagoon
#

I'm sure those are in the FBN too

#

and if there's any script controlling them, then you can probably hijack it

tight sky
#

aka it doesnt switch the scene, its seamless

mint lagoon
mint lagoon
#

the regular tbox function is mostly used for locked chests, but it won't force you to use a key if you run it btw

#

that's a different check

tight sky
#

it doesnt switch the scene, but it does have a transition for the animation. its not seamless

#

thats what that code calls and the item is definitively handled there

mint lagoon
#

btw

#

you've been looking a lot into enemies as well right?

tight sky
#

yeah, why?

mint lagoon
#

do all disaster shadows use the same script?

#

because I want to make it do something goofy

#

but I don't want to replace it for every single disaster shadow if they're individual

tight sky
#

i haven't actually gotten to the disaster shadow part... but i can do a quick check if my custom ai still runs on them at least

mint lagoon
#

👍

tight sky
#

... well thats embarrassing. i died in the tutorial

mint lagoon
#

lol

tight sky
#

confirmed. they use the ai of the normal enemy. i dont know if you can check for 'am i a disaster shadow?' in the ai script

here are all the functions:
https://github.com/tge-was-taken/Atlus-Script-Tools/blob/master/Source/AtlusScriptLibrary/Libraries/Persona5Royal/Modules/AI/Functions.json

the disaster shadow logic is handled somewhere else

GitHub

A set of tools for working with scripts used in various game developed by Atlus. - tge-was-taken/Atlus-Script-Tools

mint lagoon
#

I've kinda been relying on seeing how events that do what I want to do do it

mint lagoon