Thread Tools Display Modes
06/10/23, 12:10 AM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Question SCENE_MANAGER:GetScene("???")

Hey I was wondering if anyone has found the scene name for the loading screen like when your zoning or reloading. I have a function delay that checks other scenes to increase delay but there is a small remote chance it could trigger during load screen instead of delay more.
  Reply With Quote
06/10/23, 11:34 AM   #2
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 409
Load screens do not have a scene. Instead of looking at scenes, use the events EVENT_PLAYER_DEACTIVATED and EVENT_PLAYER_ACTIVATED to determine when a player is in or not in a loading screen.

Also, for reloading UI all addons will be disabled anyway, so you don't need to worry about that particular situation
  Reply With Quote
06/10/23, 04:05 PM   #3
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
well my concern was actually indirectly related to my compatibility with your addon and the game itself. I have a delay on returning meticulous disassembly cp back once engaged so its not doing it everytime u hop between crafting machines because I discovered the game will allow it 9x quickly but not more without error. What happened to me once was i deconed my stuff and then teleported and I think it tried to swap cp during teleport so im trying to prevent that. What I'm currently testing is checking for "hud" scene and if not then add more delay. so far so good. I suppose its not critical it swap back original cp as long as it does it eventually within a reasonable amount of time instead of error and not doing it at all which is the struggle with it. I think jackofalltrades struggling with this as well. Im trying to remain compatible with his while finding a way to make it 100% reliable as well. I'm not into 99%

Last edited by sinnereso : 06/10/23 at 04:10 PM.
  Reply With Quote
06/10/23, 05:16 PM   #4
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 409
So if you don't want to run code while in a load screen, you'll want to use the player activated and deactivated events. Have a flag and toggle it on each of those events, and if the flag is false don't swap. If you want to check if you have a craft station active, the function is something like GetCurrentCraftInteraction (probably not 100% correct name)
  Reply With Quote
06/11/23, 04:27 AM   #5
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
the stations have scenes actually that work quite well so far..

Code:
local deconCraftScene = SCENE_MANAGER:GetScene("smithing")
local deconEnchantScene = SCENE_MANAGER:GetScene("enchanting")
local deconAssistScene = SCENE_MANAGER:GetScene("universalDeconstructionSceneKeyboard")
smithing is all but the enchanting station oddly and the universal is the decon assistants.

I just run a 10sec delayed loop.. if in any of those scenes then loop again sort of thing.. ive added the "hud" now so if its in any of those or NOT in "hud" scene then loop in hopes it might prevent the loading screen action. if it fails ill try the player activated.

Last edited by sinnereso : 06/11/23 at 04:29 AM.
  Reply With Quote
06/11/23, 07:14 AM   #6
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 88
those delayed loops dont sound like they are every going to provide a full proof solution.

maybe try directly detecting scene changes.
  Reply With Quote
06/11/23, 01:15 PM   #7
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Yes, USE the callback manager of the scene like described here
https://wiki.esoui.com/Scene_Manager:_On_scene_change
to check for the scene shown/hidden/hiding/showing states and react to them, instead of adding 10s delays that might work now but not anymore in the future (and all only if the PCs hardware doesn ot change and the server's speed neither does...).

Adding delays is in 90% not needed or leading to more incompatibility ad problems.
Try to e.g. find a function that is called by the event in vanilla game code and SecurePostHook it to run your code after that vanilla game code was run from the event or scene.
  Reply With Quote
06/11/23, 11:39 PM   #8
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
I originally had it detecting scene changes and was working perfectly and swapping cp back when you left crafting station but there was a problem with that.. the game will not allow returning the cp after leaving the 5th station. So what ive done is delayed the initial return 30+secs and then checking every10secs if your not at a station but then I once had an issue I THINK teleporting where it tried to swap cp mid teleport and locked me up. So now im just checking for HUD scene every 10secs and im hoping that will prevent it swapping during zoning.

Last edited by sinnereso : 06/11/23 at 11:42 PM.
  Reply With Quote
06/12/23, 01:57 AM   #9
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
just use the mentioned scenes and events then.
At crafting scene hidden: Start cp changes with your whatever delay. Set a variable to savedvars: cp change needed.

Playery_deactivated: set an addon local prevention variable to true (will reset automatically to false then as you reliadui/zone).
In every situation where the cps should be changed check if the prevention variable is false, else do nothing! Just register the next event to check when cp changes could be done, see below.

Player_activated: check for SavedVars variable cp change needed. If true, change cps and reset sv variable to false.

And für all other cp charges without zoning just start it 10s after crafting scene hidden state.
Use event_player_combat_state and if you are in combat then set the same prevention variable as above.

If the prevention variable is true just delay the cp change again, depending on the current state: in combat, zoning, other things that block cp change) use the appropriate events (comvat state, player activated, crafting station interact end,..) to start the cp change check again. And do not add any "do very 10sc times where not needed and events and scenesmfragments hidden state should be enough and the correct" do now "triggers.

Last edited by Baertram : 06/12/23 at 02:05 AM.
  Reply With Quote
06/12/23, 09:03 AM   #10
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
thats what I was doin but I dont think your understanding... if you were to go to your house and "unload" and decon everythign at every station you 100% would error out at the last station becauser the game or client stops allowing cp swapping rapidly after 9 total swaps! Meaning at the last station it errors out trying to return to original cp everytime. Techically it might probably be fine but I have a compatibility with "mass deconstructor" and swap meticulous in for enchanting station which isnt actually useful but his addon thinks it is and warns so I added it. But even without that and only doing 8 swaps at the required machines leaves open the risk of that error if someone decided to go back to a machine again.

Ive been forced to delay to reduce the number of swaps but with the delay comes the danger of teleporting etc which is what im trying to deal with. So far so good though ONLY swapping back in "hud" scene. im swapping meticulous IN at any of the stations and delayed 10s loop back to original ONLY if in "hud" scene now. My hopes is this will prevent during zoning.

Last edited by sinnereso : 06/12/23 at 09:13 AM.
  Reply With Quote
06/12/23, 09:53 AM   #11
ExoY
 
ExoY's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2020
Posts: 88
The problem is clear and the solution Bartram describes covers all the issues you described as well as peventing the problem with the porting.
So it makes it more robust for any special cases.
  Reply With Quote
06/12/23, 03:09 PM   #12
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Well his idea may work but id have to rewrite some stuff and use a saved variable for the original cp so it would know what WAS there after a reload. currently im using a global switch and variable to know when changes are required and what was the original cp.

**EDIT
the problem isn't exactly clear. I'm trying to determine why i can sometimes swap cp 5x and others 25x and then all stops working completely but reports its fine with

GetChampionPurchaseAvailability()
GetExpectedResultForChampionPurchaseRequest()

and even

EVENT_CHAMPION_PURCHASE_RESULT

all reporting 0 in a branch of code that cannot even get to that point unless the correct skills are slotted to replace. It works flawless fast upto 25x and then just stops, code runs as normal and results are all 0(which is perfect) and then executes SendChampionPurchaseRequest() but nothing happening.

Last edited by sinnereso : 06/12/23 at 07:26 PM.
  Reply With Quote
06/12/23, 09:22 PM   #13
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
Just a reminder. You do realize anything you automate like auto swapping CP, mass mail, anything for any innocent reason, does technically... well do something. I can't say what the something is because I'm not ZOS but it's not just conjecture. They do not like anything happening 5x, or 25x.

https://wiki.esoui.com/How_to_get_your_AddOn_removed

I only mention this because, you say it works 5x or 25x and then stops. Did you stop to think server side they might be blocking that?
  Reply With Quote
06/12/23, 11:46 PM   #14
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Originally Posted by Sharlikran View Post
Just a reminder. You do realize anything you automate like auto swapping CP, mass mail, anything for any innocent reason, does technically... well do something. I can't say what the something is because I'm not ZOS but it's not just conjecture. They do not like anything happening 5x, or 25x.

https://wiki.esoui.com/How_to_get_your_AddOn_removed

I only mention this because, you say it works 5x or 25x and then stops. Did you stop to think server side they might be blocking that?
Yes I have 100% been considering that but its been so random its hard to pinpoint an exact cause but its my most likely theory I just haven't proven it yet.

It is designed to simply slot meticulous at crafting stations and return original cp when leaving the station. It just randomly stops ACTUALLY doing it while still executing the same code and doing the same checks and reporting no errors. Ive checked everything 50x and the only explanation that does make sense is they prevented it on they're end but reported normal execution.

Last edited by sinnereso : 06/13/23 at 12:06 AM.
  Reply With Quote
06/13/23, 05:06 AM   #15
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 655
Yes. And since that is not necessary for people to have happening each time they work with a crafting station then this is why sometimes I (well anyone really) seem like they dislike what someone is doing. It's not that I dislike it I'm supportive of creative mods that improve the game for others.

Say you keep at it trying to figure it out and then players can only swap those abilities at an Armory and I can't use a mod like Dynamic CP to do it. I may not change my setup more then once or twice a day. As to where if you were doing writs on 19 chars, and 5 stations, adding and removing that slotted ability. Adding and removing is 2x, 5 stations is 10x, and 19 chars is 190 times a day.

As opposed to once or twice a day. I may even go several days without swamping that out for something else. I get it that people are forgetful or have different builds on alts. I am sure there are other reasons. CP is account wide and usable at any level so I know that isn't a limitation.

If the day comes that mods are no longer allowed to swap slotted abilities and you will have to painstakingly manually add and remove them, then you will have to do things how you probably should be doing it already. Why cause the devs to make a change that could affect players that way. And they may or may not, or they just restrict the crap out of it, who knows.

Just something to think about.

Last edited by Sharlikran : 06/13/23 at 05:08 AM.
  Reply With Quote
06/13/23, 08:17 AM   #16
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Ya for sure I agree.. Its why I was moving to the delayed return but was risky for teleports etc. Ideally it will only swap in and out once while doing all deconning is my plan not 10x.

**EDIT

Im implementing a saved variable now for the cp swapping to cover reloadui which is used both as a switch and the data needed to swap back. I have also returned back to a 32sec delay + repeated 10sec loop if not in "hud" scene which I think covers mid reload or zone. I went with 32 cuz 30 is the cooldown supposedly but was a bit of a race to decon at all machines. Seems to be working well so far.. also i revamped my compatibility with jackofalltrades and I just return end my function if its running period instead of that specific meticulous feature. also added the same for Dynamic CP which you mentioned and I was unaware of.

Seems to be working properly... Uploading now and then gonna work on possibly character specific data incase of toon swap mid cycle because I know people run 18 alts through the dailiy writs very quickly and a toon swap is highly likely.

Last edited by sinnereso : 06/13/23 at 12:03 PM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » SCENE_MANAGER:GetScene("???")


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off