Page 1 of 2

How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 4:03 pm
by Are
Hey Guys,

I was recently trying something out at the Pentragon Server an noticed, that in the Tutorial Zone, if you follow the quest, your Mini Stats Window starts blinking. Youtube Link

That attracted my attention and I started the packet Logger.
What I got was this Packet:
Code: Select all
<RECV TCP Time: 00h01m34s162ms Code:0x004C Len: 8>
06 37 08 0B 00 00 00 00 .7......
Which looks in the Logconverter like:
Code: Select all
00:01:34.162 S=>C 0x4C visual effect (oid:0x0637 subcode:8(BlinkPanel) flag:11(MiniInfo_Window) unk1:0)
My question now is, how do I use this information, to make the dolserver doing the same thing? I know that there are many packet manipulations in the PacketLibs, but I have no Idea how to add this new packet to it and make use of it.

Do you have any Idea?

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 4:25 pm
by Tolakram
Make a method implemented in ipacketlib and in the packets for SendBlinkPanel and in the implementation send the build the packet and set it to the client.

Check out packetlib186.cs, the last method

public override void SendMinotaurRelicBarUpdate(GamePlayer player, int xp)

uses the visualeffect packet to send an update. Just duplicate this but send the blink codes instead.

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 4:42 pm
by Graveen
Yay nice ! Please check if stoc 0x4C does not already exist - well if the packet logguer is giving it to you, it is perhaps already defined.

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 4:58 pm
by Are
Yes it is defined in IPacketLib.cs:
VisualEffect = 0x4C

It is used for many thinks like SendPlayerFreeLevelUpdate, SendNPCsQuestEffect, SendWarlockChamberEffect and so on.

Whoohoo, it worked! :) I have written this little Method...
Code: Select all
public override void SendBlinkPanel(GamePlayer player)
{
GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(ePackets.VisualEffect));

pak.WriteShort((ushort)player.ObjectID);
pak.WriteByte((byte)8);
pak.WriteByte((byte)11);
pak.WriteByte((byte)0);

SendTCP(pak);
}
and calling it via a /blink command.
Code: Select all
namespace DOL.GS.Commands
{
[CmdAttribute(
"&blink",
ePrivLevel.Player,
"make me blink",
"/blink")]
public class BlinkCommandHandler : ICommandHandler
{
public void OnCommand(GameClient client, string[] args)
{
GamePlayer player = client.Player;
player.Out.SendBlinkPanel(player);

client.Out.SendMessage("Starting Blinking!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
}
}
}
And now, when I'm typing /blink, my Status window Starts blinking like in my video :). I'll try some other values now, maybe that will affect other UI Elements.

Thanks to you both. :)

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 5:09 pm
by Tolakram
Does it stop after a set amount of time?

This could make a good April fools patch. :mrgreen:

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 5:16 pm
by Are
Yes it blinks 5 times and stops after that. I tried out some more FLAG Bytes, look at this Youtube Video :).

It seems, that you can make every single UI Element blink. This is very usefull to get the players attention (GM writes something important to the chat and makes the chatbar blink :P ).

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 5:25 pm
by Tolakram
I watched it, that's awesome. :)

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 5:29 pm
by Graveen
Are, can you define an enum for the knowed flags, and push a command + the packet in contrib section ?

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 5:31 pm
by Are
Are, can you define an enum for the knowed flags, and push a command + the packet in contrib section ?
I just asked the same thing myself :P.

The question that now grows is, why did the LogConverter know, that Flag 11 is MiniInfo_Window? Is it somewhere in the code, and I could maybe link that together?

The DolServer has no info like "MiniInfo_Window"


Edit:

See what I have found in the Logconverter Source :D
Code: Select all
public class BlinkPanelUpdate: ASubData
{
public enum ePanel : byte
{
Command_Window = 0,
Journal_Button = 1,
Map_Button = 2,
Sit_Button = 3,
Stats_Index_Window = 4,
Attributes_Button = 5,
Inventory_Button = 6,
Specializations_Button = 7,
CombatStyles_Button = 8,
MagicSpells_Button = 9,
Group_Button = 0x0A,
MiniInfo_Window = 0x0B,
CommandEnter_Window = 0x0C,
QuickBar1_Window = 0x0D,
QBar1_Bank1Button = 0x0E,
QBar1_Bank2Button = 0x0F,
QBar1_Bank3Button = 0x10,
QBar1_Bank4Button = 0x11,
QBar1_Bank5Button = 0x12,
QBar1_Bank6Button = 0x13,
QBar1_Bank7Button = 0x14,
QBar1_Bank8Button = 0x15,
QBar1_Bank9Button = 0x16,
QBar1_Bank10Button = 0x17,
}

public byte flag;
public uint unk1; // unused

public override void Init(StoC_0x4C_VisualEffect pak)
{
flag = pak.ReadByte();
unk1 = pak.ReadInt();
}

public override void MakeString(TextWriter text, bool flagsDescription)
{
text.Write("(BlinkPanel) flag:{0}({1})",
flag, (ePanel)flag);
if (flagsDescription)
text.Write(" unk1:{0}", unk1);
}
}

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 7:31 pm
by bluraven
Wow, nice discovery Are, and way to go for figuring it out and implementing it! =) Very useful to those who are re-creating the tutorial stuff.

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 8:02 pm
by Graveen
Ah damn i hope the DOL code is not "too much" in late of the PacketLogguer :D

Re: How to make the UI *blink*

PostPosted: Wed Mar 31, 2010 8:15 pm
by Are
I'll try to figure out, if there are other Flags as mentioned before and create an enum for the Dolserver. I think it would also be usefull to add something like /player blink to the GM commands. Unfortunately I can only continue it next week, too much work to do :P.

Re: How to make the UI *blink*

PostPosted: Fri Apr 02, 2010 6:55 am
by Are
BTW. is there anyone actively working on the Tutorial Zones?

Re: How to make the UI *blink*

PostPosted: Fri Apr 02, 2010 7:16 am
by Roozzz
BTW. is there anyone actively working on the Tutorial Zones?
Argo did a lot of work on them, but he is on small break I think :p

Re: How to make the UI *blink*

PostPosted: Fri Apr 02, 2010 3:30 pm
by Argo
BTW. is there anyone actively working on the Tutorial Zones?
Argo did a lot of work on them, but he is on small break I think :p
correct, and i really really nead that break :) but don`t worry, i am not lost to DOL :)

kind regards
Argoras