#wdym, this is the begin play of the room

1 messages Β· Page 1 of 1 (latest)

toxic apex
#

Alright I'm gonna start a thread on this post πŸ˜„

#

So from what I see here, the room manager tries to initialize the state of all clips based on arrays in the game instance

hidden citrus
toxic apex
#

no problem at all! Let's try to break it down

#

when do you update the game instance arrays?

hidden citrus
#

inside the clips thmselves they have a pickup function i call when the player overlaps w their collision sphere

toxic apex
#

Can you try nuking this array completely and replacing it with the array from the save game data?

#

if you really need it - you can also set the value of that game instance array once the save game is loaded - just before loading the level

hidden citrus
#

the clips also have this on begin play

toxic apex
#

ohh ok

#

hmm

#

there might be a bit of conflict between the two.

toxic apex
#

It looks like your clips initialized in the proper state based on your video earlier - so maybe it's not an urgent bug to fix, but I would recommend having either the room manager handling clip states OR having clips handling their own state, but not both

hidden citrus
toxic apex
#

πŸ˜„ got ya

#

So if your clips initialize properly, let's focus on something else

hidden citrus
#

clips also have a construction script

toxic apex
#

In your room manager's BeginPlay - once the ForEach is complete, can you have the room manager tell the UI to update the count?

hidden citrus
#

so like there?

#

or before checking if the clips starting room matches the roombp

toxic apex
#

you can either add a Sequence right after OnBeginPlay - or link it to the 'Completed' output of the foreach

hidden citrus
#

kk

toxic apex
#

I like sequences personally, but its up to you - depending on your preferences for readable BPs πŸ˜„

hidden citrus
#

lottta errrors

toxic apex
#

Interesting. Do you spawn your player manually?

hidden citrus
#

i do have the spawn default pawn at transform function overwritten

toxic apex
#

ok so that might be part of the problem

#

It's ok if your gamemode needs to spawn the player a bit later.

hidden citrus
#

😭 i just got that to working

toxic apex
#

I think for simplicity sake you could encapsulate your 'Update UI' function outside the player blueprint

hidden citrus
#

into the instance instead?

toxic apex
#

Can your room manager access your UI directly?

hidden citrus
#

i think so bc of the reference to player it has

toxic apex
#

You'll save yourself a lot of headaches if different BPs can talk to UI directly, without going through the player BP

hidden citrus
#

i was gna say cast to the ui and get a ref inside the roommanager bp but would that be bad for framerate

toxic apex
#

Get UI shouldn't be a problem for CPU

#

If you want to optimize already, you could create a 'Get UI' function in your game instance and cache the return value in a variable.

hidden citrus
#

so id make the cast and reference in a function inside my instance bp instead of casting inside the room bp itself?

toxic apex
#

Something like this:

#

In my example, MyHUD is a local variable but ignore that

hidden citrus
#

i dont think i have my widget im using for hud setup as hud

toxic apex
#

got ya

#

ignore the Get HUD and get a reference to that widget instead, no problem

#

I assume the widget you spawn for clip count is cached in a variable somewhere?

hidden citrus
#

in my player

hidden citrus
toxic apex
#

oof ok.

#

At what moment do you spawn the player? Where is it scripted?

hidden citrus
#

wdym

#

only thing w spawning player is just the overwrittten fuinction in the game mode

toxic apex
#

Yeah normally if the player was spawned as soon as the level load, your room manager should be able to access it. But it doesn't seem to be the case at the moment because of all the errors you pasted earlier

#

Could you try something ? Instead of respawning a new player - can you just set its transform?

hidden citrus
#

when i did thst the player fell through the floor before

toxic apex
#

If we can fix the fact that the room manager has a null player reference, we'll be good

#

hmm - that might be an issue with transform. Maybe it's clipping through the floor collision?

hidden citrus
#

they werent

toxic apex
#

ok - let's step back. Can you show me what is connected in the 'Update UI Count' function in the screenshot above? It was cropped

hidden citrus
toxic apex
#

And where do you set the value of this?

#

which seems to be a variable in the room manager BP

#

on begin play I assume?

hidden citrus
#

seems to only be on the overlap

toxic apex
#

ok !

#

So I don't think you need to cache the player reference in a variable here.

Can you try replacing it with the native function get player character instead?

#

Rule of thumb - try to avoid caching the same actor reference in multiple BPs - it'll shield you from invalid references or value discrepancies

hidden citrus
#

for the input on the update clipcounter funtion?

toxic apex
#

yep!

hidden citrus
#

it wont let me connect them

toxic apex
#

you have to cast it to your BP Third Person Character class

hidden citrus
#

ohh

toxic apex
#

you can right-click the cast and convert it to a 'pure' cast if you don't want the input/output

hidden citrus
#

off begin play?

toxic apex
#

yea that works - and if you don't want to have to connect it - you can right-click the cast and convert to pure (all the way at the bottom)

hidden citrus
toxic apex
#

great! now try to run it again

hidden citrus
toxic apex
#

ok that's progress - there is no null ref to the player now

hidden citrus
#

😭 i just saw wall of errors n thought shit were going backwards

toxic apex
#

can you click the first error 'Set Clip Count' and screenshot that function?

hidden citrus
toxic apex
#

m'kay how about UpdateClipCounterUI?

hidden citrus
toxic apex
#

ok

#

HUD variable here is null. Where is it set?

hidden citrus
#

begin play

#

of the player

toxic apex
#

small note - can you link 'self' in 'owning player' on the create player HUD widget?

#

or 'get player controller' if it doesn't work

hidden citrus
toxic apex
#

cool cool. So is this the only place in the whole BP where the player HUD widget is created and assigned to the HUD var?

hidden citrus
#

yea should be

toxic apex
#

can you try to add a breakpoint on both 'SET HUD' and 'UpdateClipCounterUI' and see which one fires first?

hidden citrus
#

the update clip counter ui fucntion in the player or on the calling of the function in the room bp

toxic apex
hidden citrus
#

this one hit

toxic apex
#

good - and the other one hits after? or doesn't hit at all

hidden citrus
#

if i hit continue execution yea

toxic apex
#

ok interesting. So that's the core of the issue. You have room manager trying to do things before player is finished spawning & initializing stuff (including HUD)

#

If you don't want to change the player spawning override thing you did, I might have a suggestion

#
  1. Open Game Mode
  2. Create a new 'Event Dispatcher' called 'OnPlayerSpawned' or something
  3. In your Room Manager's begin play, bind to the Game Mode's 'OnPlayerSpawned' event and disconnect the rest.
  4. When you receive that event, execute everything you connected to 'BeginPlay' before.
#

And then in your game mode's player spawn overriden function, once the player pawn is spawned, call that event dispatcher

#

That should fix a number of these errors. The last one to fix will be the 'SaveGameRef' variable being null

#

I have to drive back home and I'll log back in in about an hour. Let me know how it goes!

hidden citrus
#

sry my wifi cut out 😭

toxic apex
#

yeah that looks about right- did that fix the null HUD ref ?

hidden citrus
#

now when overlapping the room bounds the ui dosnt update stays at 0, when collecting a clip it counts down from 0

#

dosnt update on load still either

toxic apex
#

Yep looks like we'll have a few more null refs to fix

#

I have to log off for today but if you want, we could hop on a channel and live debug it tomorrow ! Could be simpler than pasting screenshots πŸ˜„

hidden citrus
toxic apex
#

Let me know what time works well for you today πŸ™‚

hidden citrus
#

i may be able to closer to 1 today

toxic apex
#

in which timezone? πŸ˜„

hidden citrus
#

😭sry est

toxic apex
#

haha ok good. I'm EST too and I would have some time now

hidden citrus
#

only thing i realized. my mic isnt working😭

toxic apex
#

That's alright. Would you like to continue typing in thread or do you prefer sharing your screen but I'd be the only one talking? πŸ˜„

hidden citrus
#

we could in the thread for a lil, im hoping😭 atleast looking at the screenshot of the errors i had that the rest of whats making it not work is inside the clip pickup bps themselves so hopefully we are close to it working😭

toxic apex
#

perfect - lets do that

#

So I suspect the invalid save game ref is this one?

hidden citrus
#

lemme check

#

not sure bc it comes off begin play

#

shit, am i in the wrong bp lol

hidden citrus
toxic apex
#

yep - the room blueprint is an actor already dropped in the level right, you don't spawn it at runtime?

hidden citrus
#

yea

toxic apex
#

ok. this is weird. So from what I remember from yesterday, you already set the game instance's save game variable before calling OpenLevel?

hidden citrus
toxic apex
#

This LoadGame event is in the game instance?

hidden citrus
#

yea is the function converted to an event

toxic apex
#

got it

#

if you add a 'Is Valid' check on the save game ref var right here, what does it return?

#

well, after the get game instance I guess

hidden citrus
#

nothing printed

toxic apex
#

ah so it is valid.

#

It must be a different savegame var check that returns null

#

This one here - is that the begin play of the clip BP ?

hidden citrus
#

yea

toxic apex
#

ok - and can you tell me the difference between what each clip does OnBeginPlay versus what the room manager does while looping through each clip?

hidden citrus
#

room manager loops through them to get a count of what ones in level are linked to that room bp as the starting room bp

toxic apex
#

ah ok - got ya

#

I have a suggestion. Since the room BP is already doing 'Get all actors of class' and looping through them -- Can you try replacing the 'On Begin Play' from the Clip BP with a custom event called like Initialize or something

#

and then call that Initialize event from the room BP, in the foreach loop

#

this way, it will defer the save game var check until the player has spawned

#

It's still very odd since the save game var is normally set before the clip even spawns, but I want to double check if that's the cause of the error spam we're seeing

hidden citrus
#

hmmm lemme try that

hidden citrus
#

so remove the begin play stuff from the clip bp, replace w an event called initalize inside the event get the clips starting room ref and get the for each ?

toxic apex
#

yes for the first half, and then call the initialize on each clip in the room's foreach yup

#

I'm curious to see if it'll make a difference

hidden citrus
#

im slightly confused 😭

toxic apex
#

Would you be willing to jump on a call even if no mic? I think we could save quite a bit of time πŸ˜„

hidden citrus
#

yea

toxic apex
#

Cool cool - I'll join..... let's say Public Boole

hidden citrus
#

kk

#

hi yea sry lol

#

😭

#

it says i cant share it in this channel 😭

#

ehhh maybe just stick w the thread lol

#

kk

toxic apex
#

that's a weird rule haha

#

oh well. Sooo.. I was talking about the Clip Blueprint

hidden citrus
#

this is the clip bps variables and what i have sofar

toxic apex
#

You can replace the Begin Play with the Initialize Clip event - and connect everything there

#

ah ok

#

I see what you confused

hidden citrus
#

the starting room is done on each instance i place in level

toxic apex
#

and then in the room BP:

#

this way the room takes care of initializing the clips

#

and this all happens after the player has spawned

hidden citrus
#

ohhhh

toxic apex
#

exactly! and then delete the begin play entirely

#

from the clip BP

hidden citrus
#

kk

toxic apex
#

Nice - let's see if that fixes the error spamming

hidden citrus
#

it stopped the errors but now all the clips i collect respawn on load

toxic apex
#

ok good, one step at a time haha

hidden citrus
#

and the count isnt updating is staying at 0 then counting down 😭

toxic apex
#

there's a lot of order of execution to clean up and regain control of

#

Now we have the level loading, the player spawning and the room fetching clips & initializing them.

#

Next step: set the clips' proper default state

hidden citrus
#

kk

toxic apex
#

Could you edit the Clip BP so that the clips spawn invisible + No collision by default?

hidden citrus
#

aside from the construction script? like just setting their visibility n stuff manually

toxic apex
#

Yea either settings on the components/actor or construction script- both would work

#

ah nice ok -

#

So in that case, Active? = false by default should do the trick

#

Now that this is done - you should spawn in the level with all clips turned off.

hidden citrus
#

kk i made it false by default lemme check

toxic apex
#

Which is great - then the clips can check in the 'Initialize' event if it should activate itself based on save game data

hidden citrus
#

yup all invisible

toxic apex
#

awesome

#

Now in the clip BP - in the Initialize event, you're already reading data from the save game ref var

#

If the ID of the clip is in the save game ID array, activate the clip!

hidden citrus
toxic apex
#

Does this path reenable collisions & make visible?

hidden citrus
#

it did at one point but now jus connects to setting the clips starting location

toxic apex
#

ok - you should bring it back

hidden citrus
toxic apex
#

that would be the perfect spot to reactivate the clip

hidden citrus
toxic apex
#

^

#

neat

#

so that should fix State initialization for your clips

hidden citrus
#

theyr still all hidden when loading in a level

toxic apex
#

can you try wiping save game and try again?

hidden citrus
#

that was after hitting new game

toxic apex
#

ok

#

this means that one of these two arrays contains the clip ID

#

Since its a new game, it's probably not the save game array

#

can you breakpoint on the OR Branch and check the value of both arrays?

toxic apex
#

I like the pixelized rendering πŸ˜„

hidden citrus
toxic apex
#

oh!

#

hmm

#

yea if you delete the save game there shouldn't be anything left

hidden citrus
toxic apex
#

what's the default value of that array in the save game object?

#

no need to clear - your save game ref var is already null at that point

hidden citrus
#

theres nothing in the default value for saved

toxic apex
#

ok and how about the game instance array - is it also empty?

hidden citrus
#

yea

toxic apex
#

ok

#

add a breakpoint on that branch

#

and when it breaks, mouse over both arrays to check their content

#

something must be filling it up

hidden citrus
#

its not breaking

toxic apex
#

oh really

#

is it breaking on 'Initialize Clip' event?

hidden citrus
#

nope only thing is a few errors

toxic apex
#

that's new. We can look at these later

#

do you have an instance selected in the clip BP dropdown? Maybe it can prevent breakpoint from working properly

#

either select none or select one in particular. Sometimes breakpoints are buggy with multiple instances of the same BP

hidden citrus
toxic apex
#

no this little dropdown :

hidden citrus
toxic apex
#

ok good

#

Can you breakpoint on these in the room BP?

#

to see how many actors you find and if they foreach loop fine

hidden citrus
#

they didnt break either

toxic apex
#

🫠

#

how about print string

#

does it print something?

hidden citrus
#

off the isvalid?

toxic apex
#

hmm let's say just print the display name of the BP in the InitializeClip event

#

oh I just realized something

#

In your screenshot, when you click New game - you delete the save game and call Open Level immediately after

#

but you don't re-create a new save game beforehand?

hidden citrus
#

no

toxic apex
#

that's probably the reason why it doesn't reach the foreach loop

#

game instance's save game var ref is probably null

hidden citrus
#

so have it save after loading the level?

toxic apex
#

Ideally, when you click new game it should:

  1. Delete old save file
  2. Create new Save Game object
  3. Update Game Instance save game var reference
  4. Async Save game
  5. Open level once save game is complete
hidden citrus
toxic apex
#

exactly

#

now the breakpoints should hit

hidden citrus
#

now when spawning player falls though the map

#

breakpoints dont hit either

toxic apex
#

I don't see how the change we did could affect the player at all

#

Is the spawn location of the player determined by data from the save game?

hidden citrus
#

this is the only thing afecting the spawn

toxic apex
#

ah

#

yep - the transforms are pulled from the save game

hidden citrus
#

if valid

#

if not its the player start

toxic apex
#

yep - now that we create the save game before loading the level, it becomes valid

hidden citrus
#

ohh

#

so it should wait til level loads then save so its not vaild before they spawn?

toxic apex
#

Nah it's ok that this happens before level load

#

I would recommend a different check

#

Can you add a boolean in the save game class called 'Custom Player Transform' and set it to false by default?

#

This way - instead of checking if save game is valid - you could check the value of that boolean in the save game data

#

if false = spawn at Default Player start
if true = spawn at save game Transform

#

and when you save the game later on and save the player's position in the world, just set this bool to true

hidden citrus
#

so jus use a normal branch

toxic apex
#

yea instead of the IsValid here:

hidden citrus
toxic apex
#

🀟

#

Player shouldn't spawn through the floor now

hidden citrus
toxic apex
#

ok you still need the IsValid check I guess

#

is valid would still branch to Default player start

hidden citrus
#

they didnt spawn through the floor tho

toxic apex
#

if false

#

nice. Yeah you could have a double check here just to remove the error

#

Is valid, then branch

hidden citrus
#

kk

toxic apex
#

ok! so are breakpoints still not hitting?

hidden citrus
hidden citrus
toxic apex
#

Alright - In the room BP - can you breakpoint on the playerspawned event?

#

and can you paste the event's blueprint graph again plz?

hidden citrus
toxic apex
#

Does this ever hit?

hidden citrus
#

no

toxic apex
#

lol ok - so it looks like the player is spawned before the binding happens

#

let's handle both cases

#

This is in the game mode BP right?

hidden citrus
#

yea

toxic apex
#

ok - let's try this

#

before doing the bind here, in the room bp:

#

add a IsValid check on the player ref variable from GameMode BP

#

if Is Valid = true, call 'OnPlayerSpawn' event directly.
if Is Valid = false, bind to OnPlayerSpawned

hidden citrus
#

the player ref variable is in the instance tho

toxic apex
#

oh yep ur right my bad

#

I'm talking about that var

hidden citrus
#

yea thats from the instance

toxic apex
#

good. Check that one

#

if it's valid - it means the player is already spawned therefore we don't have to bind & wait for it to spawn

hidden citrus
#

so cast to instance or promote instance to a varibale in the game mode n call it that way

toxic apex
#

No you can check the game instance var directly πŸ‘

hidden citrus
toxic apex
#

almost yea

#

so, if IsValid is true, call Onplayerspawns

#

if it's NOT valid, link to Bind Event

hidden citrus
toxic apex
#

Also I think your As NH Main Game Instance var will be null here. You have to move up your Get Game Instance + Cast + Var caching OnBeginPLay

hidden citrus
#

ahh ok

#

this hit now

toxic apex
#

Nice

#

so now you should break everywhere

#

the for each loop, the initialize clip events, etc.

#

are the clips in the proper state?

hidden citrus
#

they seem to, i think

#

but now when player loads it spawns them at player start instead of the saved transform again

toxic apex
#

Yep - that's because of the new boolean

#

In which blueprint do you save the current player's transform?

hidden citrus
#

ahh

hidden citrus
toxic apex
#

ok! You have to set that boolean to true at that exact moment as well, before saving

hidden citrus
toxic apex
#

nice. yep, right after that set transform

#

and if you collect a clip and reload the game, does the state work correctly?

hidden citrus
toxic apex
#

Sweet

So now we can attack the final boss - the counter on the screen

hidden citrus
#

😭 yay were getting there lol

toxic apex
#

πŸ˜„

#

Could you paste again what is inside the function that updates the counter UI?

hidden citrus
toxic apex
#

ok good

#

So when you press new game, the counter is 0 ?

hidden citrus
#

yes

toxic apex
#

Ok. Then it can either mean that 'Active room' is invalid OR that the remaining clip count check is buggy

#

Where do you set 'Active room' ?

hidden citrus
#

on overlap in the player and in the room

toxic apex
#

ok - I would like to propose a slightly different ownership approach here.

#

For that function specifically

#

You could add an input (integer) to that function - and link it direclty in SetClipCount

#

no need to fetch Active Room at all. The function would just get told what to set

hidden citrus
toxic apex
#

yea - remove the active room valid check too! let's keep it lean

hidden citrus
toxic apex
#

alright

#

Now, in the room BP - link the proper var in the 'UpdateClipCounterUI' call

#

Eventually, when you have multiple room BPs, you'll probably have to check if this room is active before calling the UpdateUI function

hidden citrus
toxic apex
#

ok

#

and then in the player BP / overlap event

#

hmm

hidden citrus
toxic apex
#

so quick question to understand the intention here

#

Is the counter supposed to only display how many clips are inside that specific room you just stepped in?

hidden citrus
#

yea

toxic apex
#

ok

#

in that screenshot you just posted - remaining clip count is a variable that also exists in the player bp?

#

or is that in the room BP as well

hidden citrus
#

thats in the room bp

toxic apex
#

ah nice

#

ok wonderful

#

does your room have a 'Is Active' boolean state too?

#

I'm thinking that it probably should have one.

#

This way you could add a 'Is Active' branch right here:

#

To make sure that all rooms don't update the counter UI all at once when the level starts

#

That brings me another question -- is the player always inside a room? Or is it possible for the player to be outside ALL the room triggers and be in ZERO room?

#

Hmm I'm thinking out loud here - but even if that was the case, that wouldn't be a problem since the count would be 0 and that would be OK πŸ˜„

#

so.. let's see

#

Yep that would be the only last thing to do.

#
  1. Create a 'Is Room Active' boolean (false by default)
  2. Set that bool to true OnOverlapBegin and false OnOverlapEnd
  3. Branch check that boolean before the 'UpdateClipCounterUI' connected to the foreach completed
#

just for safety

#

the rest should work !

#

There might be one last issue with players spawning inside a room and not firing the Overlap Event, we can fix that after.

hidden citrus
toxic apex
#

no worries

#

totally understandable πŸ˜„

hidden citrus
toxic apex
#

nice ok - in which case the counter would display 0 (or would be hidden) so I guess there's no additional needs there

hidden citrus
toxic apex
#

Nice

#

So if you give all this a quick run - how does it behave?

hidden citrus
#

loading into the room after saving the ui stays at 0

#

but other than that it seems to be working

toxic apex
#

excellent

#

as expected, the cursed player in trigger bug

#

So here's a suggestion for how we could go about it

#

In the room BP's construction script, disable collisions on the trigger volume

#

then, in the event 'Onplayerspawns' (which guarantees that the player is spawned), enable collisions on the trigger

#

hopefully this will trigger the overlap event

hidden citrus
#

that didnt seem to change it

toxic apex
#

ok.

#

Quick question

#

when you spawn inside a room - if you leave that room, does the Overlap End event fire?

hidden citrus
#

yea

toxic apex
#

nice ok

#

then let's use Plan B

#

you can delete the construction script stuff we just did

hidden citrus
#

kk

toxic apex
#

In the room BP, create a new function called 'Is Player In Room'

#

is your room trigger always a box?

hidden citrus
#

yea

toxic apex
#

awesome

#

In that function - check if the player pawn position is inside the box trigger component

hidden citrus
toxic apex
#

excellent

#

now could you screenshot the overlap event part of the graph pls?

hidden citrus
toxic apex
#

thanks !

#

Create a custom event and link it at the same place than OnBeginOverlap

#

something like 'OnPlayerEnteredRoom' or something

hidden citrus
toxic apex
#

nice

#

and finally:

#

in the room BP still, when you're done initializing clips-

#

Check if player is in room, branch the output result - and if it's TRUE, call the OnPlayerEntersRoom event

#

technically, you will be able to delete that UpdateCounterUI call too, since the new event will take care of it

hidden citrus
toxic apex
#

nice yep!

#

You can test it like that, but if it works, I would recommend removing these and testing again:

hidden citrus
toxic apex
#

🀞

hidden citrus
#

or do i not need the room active check anymore

toxic apex
#

oh right

#

yea you can remove it most likely

#

the IsPlayerInRoom is the equivalent in this case, only checked once, but ensures that the player is indeed in the room

#

and calling that event will set IsActive to true

#

so yeah you can delete it

hidden citrus
#

on load the ui is still at 0

toxic apex
#

you can breakpoint on the branch after Is Player In Room function to check the output value when testing

#

curious if the function works as expected

hidden citrus
#

it hit right as the level loads

toxic apex
#

can you mouse over the output of the function? (PLayer in room?)

#

does it say true or false

hidden citrus
#

false

toxic apex
#

ok!

#

inside that Is Player in Room? function - can you breakpoint on its return node ?

#

let's check the values of 'player position' versus 'box location & box extent'

#

I suspect it might be related to the player controller vs player pawn

#

Did you setup your player controller to follow the player pawn or not?

hidden citrus
#

it hit on level loading just like the branch

toxic apex
#

good good, mouse over the player controller location pls πŸ™‡

#

if its 0,0,0, then that will be an easy fix

hidden citrus
toxic apex
#

hmmm - how about the box world location?

hidden citrus
toxic apex
#

oh wow ok - huge diff

#

is the room bounds trigger big?

hidden citrus
#

yea

toxic apex
#

ok

#

Something interesting though

#

They have the same Z

#

Can you try getting the pawn's location instead of the controller?

#

I think the controller is placed at the root of the capsule - and the pawn's location is right in the middle of the capsule, which is better for trigger checks

hidden citrus
toxic apex
#

is it still false?

#

the Z is higher πŸ₯³

hidden citrus
toxic apex
#

can you mouse over the scaled extent?

hidden citrus
toxic apex
#

try unscaled box extent

hidden citrus
toxic apex
#

argh

#

ok

#

hmm

#

gimme a sec

hidden citrus
#

kk

toxic apex
#

thats so weird

#

it works on my end

hidden citrus
#

could it be the box collision isnt default scale before being placedin a level i edited the scale in the bp and in level

toxic apex
#

That should be ok - that's what the 'Scaled box extent' is for usually

hidden citrus
#

oh

toxic apex
#

there's something that bothers me with the maths though

#

Your screenshots say that the player is at x = 2430 , and that the trigger box is at x = 190 with an x extent of 540

#

so based on maths alone - the player is indeed outside the trigger

hidden citrus
#

yea bc im clicking new game

toxic apex
#

ohh

#

oh ok - I thought you were sending screenshot of the locations & extent when the player spawns inside a trigger

hidden citrus
#

ohh sry

toxic apex
#

lol

#

np

#

so then, you can remove all breakpoints

and you can place a single breakpoint on the custom event you added above the Beginoverlap

#

lets check if that one breaks when you load directly in a room

hidden citrus
#

didnt break when loading into a room

toxic apex
#

and what are the locations & extent of the box & player when loading directly in a room?

hidden citrus
toxic apex
#

ok lets try modifying the 'is player in room' function

hidden citrus
#

kk

toxic apex
#

Replace the Is Point in Box with this

hidden citrus
#

breakpoint hit

toxic apex
#

πŸ₯³

#

does the counter update?

hidden citrus
#

no is still 0 until player exits and re enters the room bounds

toxic apex
#

interesting ok

#

let's add a breakpoint on the UpdateUI function later after the OnPLayerEnterRoom event is called

#

I'm trying to scroll up to see the whole scripting chain

#

only see it partially

hidden citrus
#

now on overlapping the room it hits

#

but on loading it dosnt

toxic apex
#

ok - can you paste the whole script connected to OnPlayerEntersRoom event?

hidden citrus
toxic apex
#

ClipsActive is probably false

#

can you breakpoint on that branch and validate?

hidden citrus
#

hits on overlap but on load

#

not on load*

toxic apex
#

ohh wow ok

#

omg lol

#

ok nvm I know why haha

#

That custom event shouldn't try to read the 'Other Actor' value of the begin overlap event :d

#

πŸ˜„

hidden citrus
#

ahh

toxic apex
#

instead, you can get player pawn, cast to BP_ThirdPerson, set var value and link to 'Set room name'

hidden citrus
toxic apex
#

yes solid

#

that should work

hidden citrus
#

this hit i prolly shouldve removed it

#

still at 0 on load

toxic apex
#

ok

#

HUD seems null interesting

#

can you open the player BP and show where HUD is set?

hidden citrus
toxic apex
#

ok - begin play order of execution conflict

#

Let's do something in the player BP

#

Create a new function called 'Get Player HUD'

#

Select the function and set it as 'Pure'

#

Inside the function:

#

then, replace this with that function you just created

#

And finally, in the room BP, replace all the 'Get Character > HUD var' with 'Get Character > Get Player HUD'

#

To make sure this doesn't happen to you again somewhere else, you can set the HUD var to 'Private' in the player BP

hidden citrus
#

kk lemme try

toxic apex
#

this way no external BP can read the variable value - but the getter is public and makes sure that the widget always exists

#

Honestly I think you had the right approach for a lot of this stuff.

But when you have several actors spawning / initializing stuff on begin play and cross referencing each other, Unreal isn't good at controlling order of execution (which actor fires OnBeginPlay first)

So deferring initialization to managers or important blueprints + creating safe getters like the one we just did usually works out

hidden citrus
toxic apex
#

looks good - how about your Get Player HUD function?

toxic apex
#

Nice nice -

#

let's take it for a spin 🀞

#

there's the Set Clip Count in Update UI function that you also might have to replace

hidden citrus
toxic apex
#

yahhh

#

let's go. please work this time haha

hidden citrus
#

seems to be working 🀞

toxic apex
#

πŸ₯³

#

I hope the modifications we did throughout the afternoon make sense for you and work well for your project πŸ™‡

hidden citrus
#

ty that did make sense i was fully just troubleshooting in circles before this lol

toxic apex
#

haha

#

yea that can spiral real quick sometimes

#

I'm glad I was able to help a bit.

hidden citrus
#

me too i rly appreciate it

toxic apex
#

Have fun and I'll be looking forward to see your game progress!

#

Any socials where I can follow your game updates?

hidden citrus
#

not sure quite yet im workking w a few other people im mostly doing the programming/game design and asset porting from blender to unreal but were making the game as a surprise to somee content creators so we havent rly decided on where to post yet aside form i think itch.io

toxic apex
#

oh that's really cool

#

Good luck to you and your team!

hidden citrus
#

ty you too w your projects

toxic apex
#

thanks! πŸ˜„ yeah, shipping soon - I'm gonna need all the positive vibes I can get

hidden citrus
#

quick question 😭 i noticed a bug when loading in a build. if i quit out of the game then click load it acts as if theres not a save file,

toxic apex
#

Is there something setting the value of Save Game Ref variable to null when quitting back to main menu?

hidden citrus
#

i dont think so

#

but it only seems to happen if quit game is used, but the save file exists i can see it in the folder for the build

#

also randomly if the player's z value is high the room/ui acts like the player exits rq and re enters

hidden citrus
toxic apex
#

That is strange indeed for the save. But the save game object at runtime and the actual save file on disk are two different things

#

So are you saying that this returns invalid?

hidden citrus
#

yea im pretty sure that was the one that was printing since i added that as a check so the player couldnt load into a level if there isnt a save

toxic apex
#

You can try to search in all blueprints if there's something else resetting the value of that 'save game ref' variable