#:Awake Function Bug (in global scripts)
49 messages · Page 1 of 1 (latest)
For some reason, the ShowBubbleMessage only appears in a save if the map has been finalised or the script is compiled. It doesn't carry over through editor saves though so it won't appear if the map is saved and loaded again through the editor
Additionally, if you finalise the map while that code has created a field, the field never gets deleted on the next save(s) until scripts get recompiled. I guess I can use a if(GetEditMode not) around the SetFcSave to create a fix for this but I feel like what I found is another bug?
It makes sense that it doesn't display if the script that calls it never gets compiled, doesn't it?
Yes, but in future editor loads it doesn't appear (until the map is finalised/compiled again)
sorry that was bad wording xd
Hope that makes more sense
got it
Obv it shouldn't be a problem when playing the map to upload it... but it'll be annoying if you wanna continue seeing them in the editor. I guess if not then it makes you not have to click them if you need to see what's underneath the text boxes so maybe it's a qol feature? Would be an odd one though
Wait I think I might misunderstand how Awake works
It looks like :Awake only ever runs after the map is recompiled or finalised
And doesn't when game is loaded for the 'first time' (like how CW4 worked iirc?)
Ima test a little more just to confirm what I'm saying
Right so I used PlaySound to test this (in the :Awake func)
And yeah, it only ever played the sound when the script was compiled
Never played when loading the save or even the save if it was finalised
I've also tested by using ShowConversation and it's the same thing
Also, I tested :Gameloaded with this code and it never ran at all after save and loading or even finalising and loading
I'M SO CONFUSED WHAT
You finalized it, played it, saved it and then loaded it and it didnt work?
One time I compiled, saved and loaded
Another time I compiled and finalised and then loaded
I think GameLoaded might only run when you load a map save that you've already started.
I'm really confused though because this stuff worked the last time I did this
Okay yeah that is weird.
Idk if maybe a new build has bugged something out or maybe I'm being dumb
I have the global script identical to how my last map had it, obviously with the .irpl script parameter matching the new script
My old map still works even after recompiling and making a new finalised save, so it must be something I've done?
Oh
That I couldn't tell you. You could try porting all your scripts to a fresh map; I find sometimes "undead" scripts happen when editing the same map frequently where there seem to be multiple outdated copies of scripts running on top of the newest version for some reason.
Was that ever an issue in older games?
I never ran into it but that doesn't mean it never happened.
I've never experienced these issues before so I'm really confused
Wait my old map used this thing I did where I went
@Init
:Init...```
Lemme see what happens when I change that to :Awake and :Gameloaded by themselves
Oh okay... I think I get it now
:Awake only runs on a game compile now
Instead of when it's loaded for the first time like last games
So using :Awake and expecting it to work like how it did in old games was really throwing me off
No, Awake definitely runs every time the script starts executing.
hm
I think some functions fail when used in Awake, but I thought they'd been fixed.
:Once is the function that only runs on compile/map start.
Huhhh
Oh
Yeah but :Once runs after the game is unpaused, while I'm trying to get it so the function runs instantly one time
In CW4 I'd use Awake for that but obviously that doesn't work here from what I can see atm
Wait no the bubblemessage is appearing now
I'm so confused xd