Resolved Tactical Signs for Monsters.

HuzarO

Vassal
Customer
Hi I wanted to know if it's possible to add more tactical signs in game, (see /tacticalsign1, /tacticalsign2 etc), but which apply on Monsters. I can modify the client to implement that, but then how I could implement that on the server, I know through custom java extension, but what I should look for? Is that even possible, or if not through extension, then could be that implemented on the server main java code itself? Please let me know.
 
Hi I wanted to know if it's possible to add more tactical signs in game, (see /tacticalsign1, /tacticalsign2 etc), but which apply on Monsters. I can modify the client to implement that, but then how I could implement that on the server, I know through custom java extension, but what I should look for? Is that even possible, or if not through extension, then could be that implemented on the server main java code itself? Please let me know.

It's all extremely simple, no, you won't be able to add a working icon at the client level itself. As it requires intervention in its core functions, not just the interface, but also in DLLs, so you can safely forget about this endeavor.
It's done trivially on the server, without any complexities.

did you try to just send the packet extacticalsign with the mob object id?
It already works perfect. You simply didn't understand what he is asking and saying.
1763850434812.webp
 
I have added new icons already, it seems it does not need to modify any .dll files. Just interface .u and .xdat. If anyone need help with adding those, please let me know, I can help :)

1764596124318.webp
 
I have added new icons already, it seems it does not need to modify any .dll files. Just interface .u and .xdat. If anyone need help with adding those, please let me know, I can help :)

View attachment 7336
Bored Come On GIF


and ??? Congratulations to you, and what about the icons for the targets? And did you add the functionality in the CLIENT?
Stop talking nonsense, do something useful.
 
Hey, why so aggressive? Of course I've implemented it and it works. See attached. I've replied to this thread to tell I was able to successfully implement it, so people seeking similar functionality will know that it is fully possible, and if anyone want help I'm available to assist.

On the other hand, will you be able to modify a part of code inside Party.java class, the function `addTacticalSign`, what I assume, looking at the L2JMobius code for faufrion, there is a piece of code to send SystemMessage to user that used the token, and is using `TACTICAL_SYS_STRINGS` which is array of system message ids, which is crashing the execution. It has just 5 entries [0, 2664, 2665, 2666, 2667] which are used for the 4 implemented by NCSoft tokens, and is based on the index, first token is 1, second 2 etc. New tokens I've added are 5, 6, 7, 8, which indexes are not available in that array, and because of that it's not executing this function fully, it just adds tacticalSign into the array, but not sending to the clients, because SystemMessage is before. I think you have try catch while executing any custom extension, that's why the server is not crashing and not reporting any errors, but as my tests are done if I write my code as:

Java:
player.getParty().addTacticalSign(player, tacticalSignId, creatureTarget);

It does not send `ExTacticalSign` packet to players if the tactical token is above 4, which are my custom ones, but for default hardcoded ones it work fine.

So a little hacky way is if I do:

Java:
player.getParty().getPartyMembers().forEach(member -> member.sendPacket(new ExTacticalSign(creatureTarget, tacticalSignId)));
player.getParty().addTacticalSign(player, tacticalSignId, creatureTarget);

It works property, because I send this packet first to refresh players. Anything after calling `addTacticalSign` function is never invoked, that's why I guess it's a crash error because of `TACTICAL_SYS_STRINGS` array not having enough elements inside (ArrayOutOfBoundsException).

Ideally would be if you add function that will allow to add other system message ids in there, so it will future proof adding more custom tactical signs, or at least wrap piece of code responsible for sending the SystemMessage into try catch for ArrayOutOfBoundsException so it does not stop execution of the custom extension code, after calling `addTacticalSign` invoke, and I can handle sending SystemMessage manually in the extension itself.

1764608395409.webp
 
Hey, why so aggressive? Of course I've implemented it and it works. See attached. I've replied to this thread to tell I was able to successfully implement it, so people seeking similar functionality will know that it is fully possible, and if anyone want help I'm available to assist.

On the other hand, will you be able to modify a part of code inside Party.java class, the function `addTacticalSign`, what I assume, looking at the L2JMobius code for faufrion, there is a piece of code to send SystemMessage to user that used the token, and is using `TACTICAL_SYS_STRINGS` which is array of system message ids, which is crashing the execution. It has just 5 entries [0, 2664, 2665, 2666, 2667] which are used for the 4 implemented by NCSoft tokens, and is based on the index, first token is 1, second 2 etc. New tokens I've added are 5, 6, 7, 8, which indexes are not available in that array, and because of that it's not executing this function fully, it just adds tacticalSign into the array, but not sending to the clients, because SystemMessage is before. I think you have try catch while executing any custom extension, that's why the server is not crashing and not reporting any errors, but as my tests are done if I write my code as:

Java:
player.getParty().addTacticalSign(player, tacticalSignId, creatureTarget);

It does not send `ExTacticalSign` packet to players if the tactical token is above 4, which are my custom ones, but for default hardcoded ones it work fine.

So a little hacky way is if I do:

Java:
player.getParty().getPartyMembers().forEach(member -> member.sendPacket(new ExTacticalSign(creatureTarget, tacticalSignId)));
player.getParty().addTacticalSign(player, tacticalSignId, creatureTarget);

It works property, because I send this packet first to refresh players. Anything after calling `addTacticalSign` function is never invoked, that's why I guess it's a crash error because of `TACTICAL_SYS_STRINGS` array not having enough elements inside (ArrayOutOfBoundsException).

Ideally would be if you add function that will allow to add other system message ids in there, so it will future proof adding more custom tactical signs, or at least wrap piece of code responsible for sending the SystemMessage into try catch for ArrayOutOfBoundsException so it does not stop execution of the custom extension code, after calling `addTacticalSign` invoke, and I can handle sending SystemMessage manually in the extension itself.

View attachment 7337
Are these icons already integrated into the client, or did you add them? If they were, tell me their ID and I'll add them myself.
 
As far as I can see, there are none in the client.
Code:
action_begin    tag=1    id=78    type=-1    category=3    category2={-2}    cmd=[Use Token 1]    icon=[icon.action067]    iconEx1=[None]    name=[Use Token 1 on the target. It is only available with party status.\n\n(Command: /usetoken1)]    toggle_group_id=0    desc=[tacticalsign1]    action_end
action_begin    tag=1    id=79    type=-1    category=3    category2={-2}    cmd=[Use Token 2]    icon=[icon.action068]    iconEx1=[None]    name=[Use Token 2 on the target. It is only available with party status.\n\n(Command: /usetoken2)]    toggle_group_id=0    desc=[tacticalsign2]    action_end
action_begin    tag=1    id=80    type=-1    category=3    category2={-2}    cmd=[Use Token 3]    icon=[icon.action069]    iconEx1=[None]    name=[Use Token 3 on the target. It is only available with party status.\n\n(Command: /usetoken3)]    toggle_group_id=0    desc=[tacticalsign3]    action_end
action_begin    tag=1    id=81    type=-1    category=3    category2={-2}    cmd=[Use Token 4]    icon=[icon.action070]    iconEx1=[None]    name=[Use Token 4 on the target. It is only available with party status.\n\n(Command: /usetoken4)]    toggle_group_id=0    desc=[tacticalsign4]    action_end
action_begin    tag=1    id=82    type=-1    category=3    category2={-2}    cmd=[Token 1 Targeting]    icon=[icon.action071]    iconEx1=[None]    name=[Make a target of an object that was applied with the token 1.  It is only available with party status.\n\n(Command: /targettoken1)]    toggle_group_id=0    desc=[targettacticalsign1]    action_end
action_begin    tag=1    id=83    type=-1    category=3    category2={-2}    cmd=[Token 2 Targeting]    icon=[icon.action072]    iconEx1=[None]    name=[Make a target of an object that was applied with the token 2.  It is only available with party status.\n\n(Command: /targettoken2)]    toggle_group_id=0    desc=[targettacticalsign2]    action_end
action_begin    tag=1    id=84    type=-1    category=3    category2={-2}    cmd=[Token 3 Targeting]    icon=[icon.action073]    iconEx1=[None]    name=[Make a target of an object that was applied with the token 3.  It is only available with party status.\n\n(Command: /targettoken3)]    toggle_group_id=0    desc=[targettacticalsign3]    action_end
action_begin    tag=1    id=85    type=-1    category=3    category2={-2}    cmd=[Token 4 Targeting]    icon=[icon.action074]    iconEx1=[None]    name=[Make a target of an object that was applied with the token 4.  It is only available with party status.\n\n(Command: /targettoken4)]    toggle_group_id=0    desc=[targettacticalsign4]    action_end
 
Are these icons already integrated into the client, or did you add them? If they were, tell me their ID and I'll add them myself.
They’re custom icons, I’ve made them myself, I’m planning on adding 8 more, that’s why I’m asking for the change in the main server code. I can make a guide topic in forum if there are people interested in integrating this in their servers.
 
The Tactical Sign code is elementary. It only works in party, as on the official server.
Code:
            if(activeChar.isInParty() && target != null && target.isCreature())
            {
                activeChar.getParty().addTacticalSign(activeChar, 1, (Creature) target);
            }
addTacticalSign(Player player, int tacticalSignId, Creature target)
 
The Tactical Sign code is elementary. It only works in party, as on the official server.
Code:
            if(activeChar.isInParty() && target != null && target.isCreature())
            {
                activeChar.getParty().addTacticalSign(activeChar, 1, (Creature) target);
            }
addTacticalSign(Player player, int tacticalSignId, Creature target)
Yes, you’re correct, anyways that’s the main point of these icons, to use in party, so party members are not confused on PvP/raids etc, only thing is in my opinion having only 4 of them is way to less.
 
Ideally would be if you add function that will allow to add other system message ids in there, so it will future proof adding more custom tactical signs, or at least wrap piece of code responsible for sending the SystemMessage into try catch for ArrayOutOfBoundsException so it does not stop execution of the custom extension code, after calling `addTacticalSign` invoke, and I can handle sending SystemMessage manually in the extension itself.
Ok, wait. I will make this more flexible now, so that you can specify the SysString id.
 
Lovely, thank you Sir

Code:
/**
* Registers a custom tactical sign for use in extensions.
* @param tacticalSignId Sign ID
* @param sysStringId System string ID for the message, or -1 if no message is needed
 */
public static void registerTacticalSign(int tacticalSignId, int sysStringId)
{
TACTICAL_SYS_STRINGS.put(tacticalSignId, sysStringId);
}

/**
* @return sysStringId or -1 if not found
 */
public static int getTacticalSysString(int tacticalSignId)
{
return TACTICAL_SYS_STRINGS.getOrDefault(tacticalSignId, -1);
}

Do you understand how it works?
 
Code:
/**
* Registers a custom tactical sign for use in extensions.
* @param tacticalSignId Sign ID
* @param sysStringId System string ID for the message, or -1 if no message is needed
 */
public static void registerTacticalSign(int tacticalSignId, int sysStringId)
{
TACTICAL_SYS_STRINGS.put(tacticalSignId, sysStringId);
}

/**
* @return sysStringId or -1 if not found
 */
public static int getTacticalSysString(int tacticalSignId)
{
return TACTICAL_SYS_STRINGS.getOrDefault(tacticalSignId, -1);
}

Do you understand how it works?
Yes, this is perfect!
 
Yes, this is perfect!
// During initialization - register custom markers
Party.registerTacticalSign(5, 2668); // with a system message
Party.registerTacticalSign(6, -1); // without message

// Call as usual - it won't crash
party.addTacticalSign(player, 5, target);
party.addTacticalSign(player, 6, target);

// For signs without sysStringId, you can send your own message after
player.sendMessage("Custom sign applied!");

Commited
 
Back
Top