Close life bar when out the line of sight
Moderator: POL Developer
Close life bar when out the line of sight
Hi everyone.
Anybody know how to close life bar when out the line of sight both NPC and player?
Example:
When i see the NPC (or player) life bar:
When i out the line of sight:
is there anyway to auto close life bar when out the line of sight?
I'm using the client UO 6.0.1.7.
Thanks for any help.
Anybody know how to close life bar when out the line of sight both NPC and player?
Example:
When i see the NPC (or player) life bar:
When i out the line of sight:
is there anyway to auto close life bar when out the line of sight?
I'm using the client UO 6.0.1.7.
Thanks for any help.
Re: Close life bar when out the line of sight
+1
It will be very nice to resolve this moment..
It will be very nice to resolve this moment..
Re: Close life bar when out the line of sight
I don't think this is possible because these bars are handled on the client side and aren't even known by the server.
Re: Close life bar when out the line of sight
Hello.
I found a way to make this works.
Let create a packethook to check 0x1D packet.
Create a 'delete_hook' folder inside /pkg/
Example: /pol/pkg/delete_hook/
And put this files inside folder:
Create the file: uopacket.cfg
Create the file: pkg.cfg
Create the file: deletehook.src
Compile the src file to ecl.
This script was tested and worked!
Thanks to Nando for help me in the packet hook.
[]'s.
I found a way to make this works.
Let create a packethook to check 0x1D packet.
Create a 'delete_hook' folder inside /pkg/
Example: /pol/pkg/delete_hook/
And put this files inside folder:
Create the file: uopacket.cfg
Code: Select all
Packet 0x1D
{
Length 5
SendFunction deletehook:deletehook
}
Code: Select all
enabled 1
name deletehook
Code: Select all
//Close life bar when a player out the line of sight
//By Skinny/Nix 11/07/2016
//ChaosAge Shard - www.chaosage.com.br
use uo;
use polsys;
program DeleteObjectFromScene()
return 1;
endprogram
exported function deletehook(who, byref packet)
var chr := SystemFindObjectBySerial(packet.GetInt32(1));
if(!chr)
return 0;
endif
if(chr.acctname AND (Distance(who, chr) > 18))
var packet1 := CreatePacket(0xAF, 13);
packet1.SetInt32(1, chr.serial);
packet1.SetInt32(5, 0);
packet1.SetInt32(9, 0);
packet1.SendPacket(who);
var packet2 := CreatePacket(0xAF, 13);
packet2.SetInt32(1, who.serial);
packet2.SetInt32(5, 0);
packet2.SetInt32(9, 0);
packet2.SendPacket(chr);
return 1;
endif
return 0;
endfunction
This script was tested and worked!
Thanks to Nando for help me in the packet hook.
[]'s.
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Close life bar when out the line of sight
Which client version is this working with? I am testing on version 7 and it doesn't close the health bar.
Re: Close life bar when out the line of sight
I've tested with client version 6.0.1.7.Yukiko wrote:Which client version is this working with? I am testing on version 7 and it doesn't close the health bar.
This script has been configured to close the health bar only players. NPCs not then configured.
If you test with a character staff, you need do unhide the character (chr.hidden := 0).
Re: Close life bar when out the line of sight
See the test that i made and saved on Youtube:
https://youtu.be/ieiWNSbiJm0
https://youtu.be/ieiWNSbiJm0
Re: Close life bar when out the line of sight
I tested now with client version 7.0.53.1 and works too.
Re: Close life bar when out the line of sight
Skinny, thank you for your decision!
I'll try and tell here.
You said that Nando helped with packets.
Tell me please some tricks with it, 'cause I don't really understand how to make packethooks.
With best regards!
UPD:
With 7.0.3 it works!
Interesting, what about NPC? What we have to do, that this works with NPC bar?
I'll try and tell here.
You said that Nando helped with packets.
Tell me please some tricks with it, 'cause I don't really understand how to make packethooks.
With best regards!
UPD:
With 7.0.3 it works!
Interesting, what about NPC? What we have to do, that this works with NPC bar?
Re: Close life bar when out the line of sight
Hi.Harley wrote:Skinny, thank you for your decision!
I'll try and tell here.
You said that Nando helped with packets.
Tell me please some tricks with it, 'cause I don't really understand how to make packethooks.
With best regards!
Well, a traditional way that the health bar close is when the npc/player die.
So, I analyzed the packets logs with Razor enabling packet logging:
Then, I realized that the POL (server side) sends the "0xAF" packet, which is the death animation, and it is this packet that makes the health bar close. So when someone leaves the line of sight (more than 18 tiles), the POL (server side) sends the "0x1D" packet to the client delete the object.
Commenting on the code:
Code: Select all
(...)
exported function deletehook(who, byref packet)
// packet.GetInt32(1) is the serial player that POL sent to delete the object.
var chr := SystemFindObjectBySerial(packet.GetInt32(1)); //Get the Object reference
if(!chr)
return 0; //Send 0x1D packet (Delete Object) to player.
endif
if(chr.acctname AND (Distance(who, chr) > 18)) //if object is a player and the distance between player and another player is more than 18 tiles
var packet1 := CreatePacket(0xAF, 13); //Create the Display Death Action
packet1.SetInt32(1, chr.serial); //the serial player that out the line of sight
packet1.SetInt32(5, 0);
packet1.SetInt32(9, 0);
packet1.SendPacket(who); //Send to player that was asked to delete the object
//Well, if out the line of sight for a player, also out the line of sight to the another player.
var packet2 := CreatePacket(0xAF, 13); //Create the Display Death Action
packet2.SetInt32(1, who.serial); //the serial player that out the line of sight
packet2.SetInt32(5, 0);
packet2.SetInt32(9, 0);
packet2.SendPacket(chr); //Send to player that was asked to delete the object
return 1; //And do not send 0x1D packet to player.
endif
return 0; //Send 0x1D packet (Delete Object) to player.
endfunction
Re: Close life bar when out the line of sight
Hum... I think if you change this line:Harley wrote: Interesting, what about NPC? What we have to do, that this works with NPC bar?
Code: Select all
if(chr.acctname AND (Distance(who, chr) > 18))
Code: Select all
if((chr.acctname OR chr.npctemplate) AND (Distance(who, chr) > 18))
Re: Close life bar when out the line of sight
Awesome and very helpful!!!
About packets, this is analog algorithm to all of them?
About packets, this is analog algorithm to all of them?
mm.. with this it doesn't work(Skinny wrote: Hum... I think if you change this line:to this:Code: Select all
if(chr.acctname AND (Distance(who, chr) > 18))
Then it should work.Code: Select all
if((chr.acctname OR chr.npctemplate) AND (Distance(who, chr) > 18))
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Close life bar when out the line of sight
I used a logged in player character to test it. I was using Assist UO which allows me to run multiple instances of a client on the same computer. Perhaps Assist UO or having two clients open on the same machine conflicts with the packets being sent from the Core. I'll test it again using two different machines for log-in.
Re: Close life bar when out the line of sight
Yukiko, i tested with two clients with Razor on the same machine and it works.Yukiko wrote:I used a logged in player character to test it. I was using Assist UO which allows me to run multiple instances of a client on the same computer. Perhaps Assist UO or having two clients open on the same machine conflicts with the packets being sent from the Core. I'll test it again using two different machines for log-in.
-
- Distro Developer
- Posts: 2825
- Joined: Thu Feb 02, 2006 1:41 pm
- Location: San Antonio, Texas
- Contact:
Re: Close life bar when out the line of sight
Maybe Assist UO is the problem then. I'll try it with Razor and also with clients patched that don't perform the check for instances of an open UO client.