Sign in to follow this  
Pulentolento

Help Xdat Editor Using Script Console

5 posts in this topic

Posted (edited)

Hey Guys!!

 

I have been using XDAT Editor to make new Windows.

 

The problem I found and the lack of information of this software, I couldn't find on Internet anything of how to use this Script Console. I just found some samples of "SAVO" He shared long time ago on other RU forums.

 

I know you can add windows, tabs, textures etc, etc, if you are using the GUI, but some times when your project is getting too big, better start using the Script Console.

 

So, long story short, this is the problem:

 

How to add a "TabElement" and filling it with some data information? for example this is the code I have been trying:

println "Data Base Windows"

xdat.windows.add(new Window(
	name: "DataBaseWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 800,
	size_absolute_height: 490,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	parent: "undefined",
	backTex: "L2UI_CT1.Windows_DF_Large_Bg",
	script: "DataBaseWnd",
	state: "GamingState",
	frame: 1,
	hidden: 1,
	alwaysFullAlpha: 1,
	savePosition: 1,
	title: 6000,
	exitbutton: 1,
	workingConfiguration: "Game"))

def DataBaseWnd = xdat.windows["DataBaseWnd"]

DataBaseWnd.children.add(new Texture(
	name: "TexTabBg",
	parentName: "MagicSkillWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 800,
	size_absolute_height: 458,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	anchor_y: 31.0,
	virtual: 1,
	file: "L2UI_CT1.tab.tab_df_bg",
	type: "Stretch",
	layer: "Background",
	alpha: -9999))

DataBaseWnd.children.add(new Texture(
	name: "TexTabBgLine",
	alwaysOnBack: 1,
	parentName: "MagicSkillWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 631,
	size_absolute_height: 30,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	anchor_x: 164.0,
	anchor_y: 31.0,
	virtual: 1,
	file: "L2UI_CT1.tab.tab_df_bg_line",
	type: "Stretch",
	layer: "Background",
	alpha: -9999))

DataBaseWnd.children.add(new Tab(
	name: "DataBaseTabCtrl",
	parentName: "DataBaseWnd",
	anchored: 0,
	size: 1,
	size_absolute_width: 160,
	size_absolute_height: 23,
	usePosition: 1,
	relativePoint: Alignment.TOP_LEFT,
	anchorPoint: Alignment.TOP_LEFT,
	anchor_x: 8.0,
	anchor_y: 31.0))

def DataBaseTabCtrl = DataBaseWnd.children["DataBaseTabCtrl"]

DataBaseTabCtrl.tabs[0].buttonName = 6001
DataBaseTabCtrl.tabs[0].target = "NpcDataTab"
DataBaseTabCtrl.tabs[0].width = 78
DataBaseTabCtrl.tabs[0].height = 23
DataBaseTabCtrl.tabs[0].normalTex = "L2UI_CT1.tab.Tab_DF_Tab_Unselected"
DataBaseTabCtrl.tabs[0].pushedTex = "L2UI_CT1.tab.Tab_DF_Tab_Selected"


DataBaseTabCtrl.tabs[1].buttonName = 6002
DataBaseTabCtrl.tabs[1].target = "ItemDataTab"
DataBaseTabCtrl.tabs[1].width = 78
DataBaseTabCtrl.tabs[1].height = 23
DataBaseTabCtrl.tabs[1].normalTex = "L2UI_CT1.tab.Tab_DF_Tab_Unselected"
DataBaseTabCtrl.tabs[1].pushedTex = "L2UI_CT1.tab.Tab_DF_Tab_Selected"

println "done!"

And this is the error of the Script Console:

Data Base Windows
java.lang.NullPointerException: Cannot set property 'buttonName' on null object
	at org.codehaus.groovy.runtime.NullObject.setProperty(NullObject.java:80)
	at org.codehaus.groovy.runtime.InvokerHelper.setProperty(InvokerHelper.java:195)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.setProperty(ScriptBytecodeAdapter.java:484)
	at Script1.run(Script1.groovy:86)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:623)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:594)
	at acmi.l2.clientmod.xdat.scripting.Controller.lambda$execute$0(Controller.java:156)
	at acmi.l2.clientmod.xdat.scripting.Controller$$Lambda$442/1071997580.call(Unknown Source)
	at acmi.l2.clientmod.xdat.XdatEditor.lambda$execute$7(XdatEditor.java:219)
	at acmi.l2.clientmod.xdat.XdatEditor$$Lambda$209/1755738610.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

So, as you can see, the problem is when I'm trying to add some data information on "DataBaseTabCtrl".

 

I hope someone have any clue or experience doing this process and it would be grateful share their knowledge to resolve this issue.

 

thx so much guys!!

Edited by Pulentolento

Share this post


Link to post
Share on other sites
vampir    9

Shouldnt buttonName value be a string?

 

The best way of using those scripts is to create objects with UI on your own and then just copy automatically created script for later use. They are not perfect, if you make some modifications that collide with the script, it will not work well.

Share this post


Link to post
Share on other sites
Akar0    5
Posted (edited)

According to groovy, its an INT

static class TabElement implements IOEntity {
        @Sysstr
        int buttonName = -9999
        String buttonNameText = 'undefined'
        String target = 'undefined'
        int width
        int height
        @Tex
        String normalTex = 'undefined'
        @Tex
        String pushedTex = 'undefined'
        boolean movable
        int gap
        @Sysstr
        int tooltip = -1
        int noHighlight = -1

        @Override
        String toString() {
            getClass().simpleName
        }
Edited by Akar0

Share this post


Link to post
Share on other sites
Akar0    5
Posted (edited)

Found the problem!!!  ;D

 

this is the right way to add a Tab Element with info:

 

DataBaseTabCtrl.tabs.add(new Tab.TabElement(
	buttonName: 6001,
	target: "NpcDataTab",
	width: 78,
	height: 23,
	normalTex: "L2UI_CT1.tab.Tab_DF_Tab_Unselected",
	pushedTex: "L2UI_CT1.tab.Tab_DF_Tab_Selected"))
Edited by Akar0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



  • Similar Content

    • By ChillStep
      Hello to everyone ! i want some help with buff icons .. you know l2 have really to big icons (buff icons) can i get something to make them smaller ? any help ? or any file .. ! i love the buff bar and icons from l2 classic .. to small and dont waste your free space .. ! if someone know about that . replay please ! thanks for your time :)
    • By Designatix
      Format : TTF
      File Size : 26.42 KB
      License : Personal Use Only
       

       
      Download:
      https://mega.nz/#!0pd3HJgZ!WIlVfFXnkC-S6g7VTtTzWVFCsg8rYQwx2iDdIVUc514   Resource from: https://freedesignresources.net/
    • By ganjaradio
      Hello everyone.
      How can i make an instances that will last for ever and players will be able to be there all together?
    • By SillverShadow
      Can i change the range i can see static objects through any file or is it fixed?  @deMEV 
    • By tazerman2
      hello all i have a little problem with a event i try to fix auto create but all time use same
      player in multi add look photo image
      if any can experience or help to fix multi add or tell me whare is the problem for fix it
      code is this
      protected FastMap<PcInstance, int[]> players; public void createParty(int teamId) { int count = 0; Party party = null; FastList<PcInstance> list = new FastList<>(); for (PcInstance p : players.keySet()) if (getTeam(p) == teamId) list.add(p); FastList<PcInstance> sublist = new FastList<>(); for (PcInstance subPlayers : list) { if (count % 9 == 0 && list.size() - count != 1) { if (sublist.size() == 0) { sublist.add(subPlayers); } else { if (subPlayers.getParty() == null) { party = new Party(subPlayers, sublist.get(0), LootRule.ITEM_LOOTER); } else { if (party != null) party.addPartyMember(subPlayers); } sublist.reset(); sublist.add(subPlayers); } } if (count % 9 < 9) { sublist.add(subPlayers); } count++; } }  
  • Posts

    • Edit it for ConcurrentHashMap and drop the synchronize block.
    • Hello.   WTS Adena/Items/RuRs/Pwlvl/Acc RPG x7 NEW   prices and other things at skype - coinsbomb
    • Hello I am adapting AntiFeed Manager for now but I have these errors. how would it be in place of these imports?   import gnu.trove.map.hash.TIntObjectHashMap; import gnu.trove.procedure.TObjectProcedure; private Map<Integer,Long> _lastDeathTimes;private TIntObjectHashMap<Map<Integer, Connections>> _eventIPs;     /**      * If number of all simultaneous connections from player's IP address lower than max      * then increment connection count and return true.      * Returns false if number of all simultaneous connections from player's IP address      * higher than max.      * @param eventId      * @param player      * @param max      * @return      */     public final boolean tryAddPlayer(int eventId, L2PcInstance player, int max)     {         return tryAddClient(eventId, player.getClient(), max);     }     /**      * If number of all simultaneous connections from player's IP address lower than max      * then increment connection count and return true.      * Returns false if number of all simultaneous connections from player's IP address      * higher than max.      * @param eventId      * @param player      * @param max      * @return      */     public final boolean tryAddClient(int eventId, L2GameClient client, int max)     {         if (client == null)             return false; // unable to determine IP address         final Map<Integer, Connections> event = _eventIPs.get(eventId);         if (event == null)             return false; // no such event registered         final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());         int limit = Config.DUALBOX_CHECK_WHITELIST.get(addrHash);         limit = limit < 0 ? Integer.MAX_VALUE : limit + max;         Connections conns;         synchronized (event)         {             conns = event.get(addrHash);             if (conns == null)             {                 conns = new Connections();                 event.put(addrHash, conns);             }         }         return conns.testAndIncrement(limit);     }  
  • Topics