Jump to content
Korean Random
Kodak

Has anyone tried to show battle results after battle replay?

Recommended Posts

Hi,

as wotreplay has battleResult structure inside one could use it to display BattleResultsWindow at the end of replay.

I was able to trigger BattleResultsWindow creation using some tweaks but of course nothing shows up. For sure AS3 got stuck as python.log is clear.

Any hints?

def showReplayResultsWindow():
  from helpers import dependency
  from skeletons.gui.battle_results import IBattleResultsService
  battleResults = dependency.instance(IBattleResultsService)
  battleResults.postResult( { hash with battle result }, False)

  from gui.Scaleform.daapi.settings.views import VIEW_ALIAS
  from gui.shared.utils.functions import getViewName
  arenaUniqueID = 2141373401651619

  from gui.Scaleform.framework import g_entitiesFactories
  g_entitiesFactories.addSettings(GroupedViewSettings(VIEW_ALIAS.BATTLE_RESULTS, BattleResultsWindow, 'battleResults.swf', ViewTypes.WINDOW, 'BattleResultsWindow', None, ScopeTemplates.DEFAULT_SCOPE))
  g_appLoader.getDefBattleApp().loaderManager.loadView(VIEW_ALIAS.BATTLE_RESULTS, getViewName(VIEW_ALIAS.BATTLE_RESULTS, str(arenaUniqueID)), {'arenaUniqueID': arenaUniqueID})

Using procmon I see that battleResults.swf with required swf files are being loaded...

Share this post


Link to post

Short link
Share on other sites

First of all you need change the AppEntry from battle to lobby, bcs battleResult window is lobby window, and thay referer to "net.wg.gui.lobby.*" which is not in battle code base.

Then you need to solve problems with battleResults dataProvider, bcs there are some parameters "*Replay" that do not fall into dumped json battle result.

And no more obstacles =)

Edited by POLIROID

Share this post


Link to post

Short link
Share on other sites

net.wg.gui.lobby.* is just a namespace; I see no functional connection between battle result and the lobby itself

Are there any possibilities to debug AS3 somehow?

Share this post


Link to post

Short link
Share on other sites

net.wg.gui.lobby.* is just a namespace; I see no functional connection between battle result and the lobby itself

When replay ends,and message about the end is displayed, we still have a battle.

Class which UI of battleResultsWindow refers to "net.wg.gui.lobby.battleResults.BattleResults" is not available to us (it's not included in battleEntry - battle.swf).

 

Are there any possibilities to debug AS3 somehow?

Use DebugUtils in AS3 and LOG_LEVEL.DEV in PY, or override Flash.__onLogGui

Share this post


Link to post

Short link
Share on other sites

...but it is available in battleResults.swf which is being loaded during view creation; isn't that enough? Why battle.swf need to know anything about battle result window to be created? Isn't it python initiating flash object and adding it to existing battle app?

Share this post


Link to post

Short link
Share on other sites

it is available in battleResults.swf

Noup, as 5-6 patches, the entire codebase except the UI-s itself is embedded in the root flash of the current entry (lobby.swf/battle.swf)

 

Isn't it python initiating flash object and adding it to existing battle app?

Totally wrong.

Share this post


Link to post

Short link
Share on other sites

yes, thank you; i now see that battleResults.swf has no scripts; could i potencially try to patch battleResults.swf and copy codebase there from lobby.swf?

Share this post


Link to post

Short link
Share on other sites

yes, thank you; i now see that battleResults.swf has no scripts; could i potencially try to patch battleResults.swf and copy codebase there from lobby.swf?

No, no, no, no, this is absolutely a bad idea, never patch ingame flash files, if you can do without patching! =)

All you need is just to switch from battleEntry to lobbyEntry (for example, the login window) and then run your code.

 

Although, if you need your window during a battle, then do not patch battleResults.swf, create your own swf with all dependencies and load it before the battleResultWIndow fires.

 

But, this is a bad idea, do not do it! Just switch AppEntry to lobby =)

Edited by POLIROID

Share this post


Link to post

Short link
Share on other sites

But it feels attractive to see results on the battlefield :)

Hmm, how about copying battleResults.swf into inBattleResults.swf and putting all necessary code there? Normal results will stay untouched and this will be just used in the replay

Share this post


Link to post

Short link
Share on other sites

You can create your own result window with blackjack and ...
Btw, use ingame window it's more simple

 

I hope I helped you, good luck =)

Share this post


Link to post

Short link
Share on other sites

yes, thank you; as JPEXS AS capabilities are so limitted (I can;t export script from one file to import it in another one) I will probably look for other mod endeavours :)

I highly prefer pure python ones...

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...