Page 1 of 1

UI_close_gumps not working?

Posted: Fri May 31, 2019 1:04 pm
by agentorangeguy
anyone else having trouble with getting the UI_close_gumps(); intrinsic working?? it doesn't appear to do anything anymore

Re: UI_close_gumps not working?

Posted: Fri May 31, 2019 1:12 pm
by agentorangeguy
I'm trying to make a usecode egg with "something on", that once you remove the object on the egg, or put something on it, all gumps should close.

In the past this has worked, but now it doesn't...?

the DOUBLECLICK event seems to work if you use UI_close_gumps but the EGG event doesn't seem to?

Re: UI_close_gumps not working?

Posted: Fri May 31, 2019 1:32 pm
by Dominus
Hmm, I'm triyibg to think of an in game egg like this. I know there is one but right now I cannot remember.
And probably needs a mod to test it, too, so I can do a regression test.

Re: UI_close_gumps not working?

Posted: Fri May 31, 2019 6:08 pm
by agentorangeguy
Try the egg in front of Penumbra's house maybe? in U7

Re: UI_close_gumps not working?

Posted: Fri May 31, 2019 7:30 pm
by Dominus
well, at least that is working. Take a look at the keyring mod, there are some UI_close_gumps in there. Mostly doubleclick but some are Scripted maybe that helps.
KnightCaptain to the rescue? :)

Re: UI_close_gumps not working?

Posted: Sat Jun 01, 2019 10:11 am
by agentorangeguy
They should work up on EGG event too, they used to. One of the eggs I had for my mod for an egg triggered by "Something On" used to close the gumps when it was triggered, but it no longer does that.

Re: UI_close_gumps not working?

Posted: Sat Jun 01, 2019 1:47 pm
by Dominus
Can you give me pointers in how to implement that in a mid so I can see if I can reproduce it?

Re: UI_close_gumps not working?

Posted: Sun Jun 02, 2019 3:52 pm
by agentorangeguy
something basic like

Code: Select all

if (event == EGG)
{
    UI_close_gumps();


}
with the usecode egg set to "something on". If an object is on the egg and removed, it should activate the code, and it *should* close the gumps, but doesnt.

Re: UI_close_gumps not working?

Posted: Sun Jun 02, 2019 7:55 pm
by Knight Captain
Can you email me your function?

Also, what settings are you using in ES for the egg?

I'm always a fan of Usecode debug messages going to stdout. ;)

Re: UI_close_gumps not working?

Posted: Mon Jun 03, 2019 1:55 pm
by agentorangeguy
ES settings for the egg:

Something On
probability 100
checked autoreset
Distance 1
Function number 0xbe8
quality 0

I can't seem to ever find where the stdout file goes to so I just use party barks when I need to make sure if something is working haha

Email sent with the code in question

Re: UI_close_gumps not working?

Posted: Tue Jun 04, 2019 7:37 pm
by agentorangeguy
anyone know whats up with it?

Re: UI_close_gumps not working?

Posted: Wed Jun 05, 2019 2:30 am
by Dominus
I'll investigate after this little business trip

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 8:18 am
by Dominus
I don't know if I did it correctly, but in the islandfaq mod, I changed usecode like this:

enum events
{
EGG = 0
};

//TEST usecode egg
void Somethingegg object#(0xbe8) ()
{
if (event == EGG)
{
UI_close_gumps();
}
}

And in Exult added an egg according to your instructions:
Something On
probability 100
checked autoreset
Distance 1
Function number 0xbe8
quality 0

But it's not triggering as far back as my snpashots archive of 2012. So I think either I'm doing it wrong, or ucc changed and the resulting usecode is broken, or this way of doing it wrong and that's why it isn't working for you.
I'll see if Marzo can chime in.

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 9:40 am
by Knight Captain

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 10:05 am
by Dominus
I don't think that matters when I just enumerate this

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 11:42 am
by Dominus
I think I got on the right track.

It does work (I just needed to get rid of the if (event == EGG) otherwise it wouldn't trigger at all for me, but I guess that is due to some other usecode stuff, I'm just doing wrong.
So

Code: Select all

void Somethingegg object#(0xbe8) ()
{	
	    UI_close_gumps();
}
diid work (only needs to be sure that only Auto-reset is ticked, for some reasons it often ticked hatched when applying - And I used Distance 5 to make sure).

BUT (and there is always a but), you need to have set Gumps to not Pause the game in Gameplay settings.
That's very likely the culprit in your setup.

And again, I tested this with snapshots archive, this worked like this already in January 2012.

But in the original it works when gumps are open. So we might need to fix this.

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 12:44 pm
by Knight Captain
Event 0 is proximity, and I don't believe that triggers when Gumps are open.

Gumps pause the gameplay by default.

Nice bug find, Dominus!

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 12:59 pm
by agentorangeguy
Excellent, so i wasn't crazy haha.

I remember the egg from Penumbra's in the original closing all gumps when you'd place the object to give the sparkly effect. I just tried it and it didn't work as it should, so yeah something definitely had changed over the years and got broken

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 1:29 pm
by Dominus
I have now tracked down the culprit in the code but I don't understand it enough to fix it on my own.
It's got something to do with Gump_manager.cc:668 void Gump_manager::set_gumps_dont_pause_game(bool p)
if I comment the first two code lines, both states close the gumps. But I don't get what this code does to begin with

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 1:44 pm
by agentorangeguy
We must summon Marzo! :D

Re: UI_close_gumps not working?

Posted: Tue Jun 11, 2019 5:19 pm
by Dominus
Funny, it's a 17 years old bug, introduced when Colourless made it possible to use gumps and not have the game paused by that. So Exult 1.0 was still correct, but Exult 1.2 was already broken.
The commit that broke it https://github.com/exult/exult/commit/2 ... 0a8fb3a533

Re: UI_close_gumps not working?

Posted: Thu Jun 20, 2019 8:37 pm
by Fretka Furlet
@agentorangeguy: If you're running in Win 10, the stdout.txt and stderr.txt files are located in C:\Users\Appdata\Local\Exult, same place the savegame files are.

Re: UI_close_gumps not working?

Posted: Sun Jun 30, 2019 3:58 pm
by agentorangeguy
Any luck contacting Marzo , or Dr Code? or anyone who could fix this? :D

Re: UI_close_gumps not working?

Posted: Sun Jun 30, 2019 4:22 pm
by Dominus
No luck ;(

Re: UI_close_gumps not working?

Posted: Mon Jul 01, 2019 6:34 pm
by drcode
Sorry, I've been really busy lately. Is this related to a problem I'm seeing when playing, where I'll perform some action when gumps are open, like giving food, but nothing happens until I close the gumps?

Re: UI_close_gumps not working?

Posted: Mon Jul 01, 2019 6:49 pm
by Dominus
Most likely.
It's got something to do with Gump_manager.cc:668 void Gump_manager::set_gumps_dont_pause_game(bool p)

if I comment the first two code lines, both states close the gumps and then they don't. But I don't get what this code does to begin

Re: UI_close_gumps not working?

Posted: Sun Jul 07, 2019 10:32 pm
by drcode
I think set_gumps_dont_pause_game only gets called when you bring up the game options menu. The real problem is the 'dont_pause' feature (which defaults to 'no'), which means we pause everything when a gump is open. This is what has been bothering me while I've been playing lately.

And it's probably preventing usecode from running too, so the 'close_gumps' intrinsic doesn't get activated until after you close the gumps. :-)

I'll try playing with 'dont_pause' set to 'yes'.

Re: UI_close_gumps not working?

Posted: Tue Jul 23, 2019 2:43 pm
by agentorangeguy
Any luck with this, Dr Code?

Re: UI_close_gumps not working?

Posted: Wed Mar 25, 2020 8:50 pm
by drcode
Try this in your exult.cfg:


...

yes

Re: UI_close_gumps not working?

Posted: Wed Feb 16, 2022 9:11 pm
by Dominus
I might have solved this finally https://github.com/exult/exult/issues/153

Re: UI_close_gumps not working?

Posted: Wed Feb 16, 2022 10:07 pm
by Dominus
And it's in the code. Marzo confirmed my findings.