Problems with character.concealed member

Report core bugs regarding the Ultima Online Emulator Core release (version 097). You can attach your Core Dump. One bug per post.

Moderator: POL Developer

Locked
Tomi
POL Developer
Posts: 477
Joined: Tue Feb 21, 2006 5:08 pm

Problems with character.concealed member

Post by Tomi » Tue Jan 20, 2009 2:00 pm

Okay so the concealed member for characters work nicely. but.... there was something I did notice strange about this.

Character A conceals himself with level 3.
Character B has cmdlevel 3 and see character A.
Character B changes cmdlevel to 2 and still see Character A. until Character A does something with his character that updates the mobile for Character B.

other way.

Character A conceals himself with level 3.
Character B has cmdlevel 2 and doesnt see Character A.
Character B changes cmdlevel to 3 and still doesnt see Character A. until Character A does something with his character that updates the mobile for Character B.


Any way to fix this by scripts ?? ( without packethooks )

Tomi
POL Developer
Posts: 477
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problems with character.concealed member

Post by Tomi » Tue Jan 20, 2009 2:06 pm

I just found this function....

09-08 Turley:
Added: uo::UpdateMobile(mob)
Sends to mobiles in visual range UpdatePlayer packet of mob, for example to
inform of notority changes

I will try if using this should help with the problem.

Tomi
POL Developer
Posts: 477
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problems with character.concealed member

Post by Tomi » Wed Jan 21, 2009 12:53 am

okay tried with that function without succes.

I'm starting to think if this has to do with new ObjectCache packets, that will be the next test.

EDIT: that was not the problem either.

Tomi
POL Developer
Posts: 477
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problems with character.concealed member

Post by Tomi » Wed Jan 21, 2009 3:06 am

This problem seems to be fixable with adding 2 MoveObjectToLocation calls in the command that changes cmdlevel, beause as long as you are in range of the character who conceal, it will not update for you when you change cmdlevel.

Tomi
POL Developer
Posts: 477
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problems with character.concealed member

Post by Tomi » Wed Jan 21, 2009 3:32 am

Same problem seems to appear with privileges and hidden characters.

EDIT: And same FIX for this one too.

I assume this will happen with invisible items, ghosts and all everything that is controlled by privileges aswell.

User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Re: Problems with character.concealed member

Post by OldnGrey » Wed Jan 21, 2009 3:47 am

For as long as I've know it, concealed and hidden things will not suddenly become visible or invisible just because you have gained or lost a privilege.

It's a curious thing that old sets of scripts resorted to instantly transporting you away and back again when you toggled seeing invisible items. The update when entering a new area did the trick but I am sure you won't like than as a solution.

Tomi
POL Developer
Posts: 477
Joined: Tue Feb 21, 2006 5:08 pm

Re: Problems with character.concealed member

Post by Tomi » Wed Jan 21, 2009 4:08 am

Yes for now Im using the following functions

Code: Select all

function EnablePrivilege( object, privilege )

	var x := CInt( object.x );
	var y := CInt( object.y );
	var z := CInt( object.z );

	object.enable( CStr( privilege ) );

	MoveObjectToLocation( object, 1, 1, 0, object.realm, MOVEOBJECT_FORCELOCATION );
	Sleepms( 2 );
	MoveObjectTOLocation( object, x, y, z, object.realm, MOVEOBJECT_FORCELOCATION );

endfunction

function DisablePrivilege( object, privilege )

	var x := CInt( object.x );
	var y := CInt( object.y );
	var z := CInt( object.z );

	object.disable( CStr( privilege ) );

	MoveObjectToLocation( object, 1, 1, 0, object.realm, MOVEOBJECT_FORCELOCATION );
	Sleepms( 2 );
	MoveObjectTOLocation( object, x, y, z, object.realm, MOVEOBJECT_FORCELOCATION );

endfunction

function ChangeCmdLevel( object, cmdlevel )

	var x := CInt( object.x );
	var y := CInt( object.y );
	var z := CInt( object.z );

	object.cmdlevel( CInt( cmdlevel ) );

	MoveObjectToLocation( object, 1, 1, 0, object.realm, MOVEOBJECT_FORCELOCATION );
	Sleepms( 2 );
	MoveObjectTOLocation( object, x, y, z, object.realm, MOVEOBJECT_FORCELOCATION );

endfunction
But the core should chek if some of these privileges or levels are changing and update everything in the characters visibility range that time.

AFAIK this is affecting the following members and methdos changes:

object.cmdlevel := cmdlevel;
object.SetCmdLevel( "cmdlevel_string" );
object.enable( "privilege_string" );
object.disable( "privilege_string" );

And yes OldnGrey, these updates should be handled in core, not by 2 move functions, that's why Im reporting it here.


EDIT: this post should be moved to Core bugs instead of Scripting help.

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Problems with character.concealed member

Post by Yukiko » Fri Jan 23, 2009 12:55 am

If I remember correctly this was addressed a long time ago and it was decided that it was, at that time, a client issue. I remember the same fix that OnG mentioned, ie. moving a character away and back again, being posted as the fix; that was pre-POL 0.96. Similar issues crop up in the client regarding Multi ghosts like sails and masts being vissible after dry-docking a boat and the odd one I found with Multis being ghosted in the first two maps. One would think sending an update character packet should fix this but I guess the client doesn't update properly unles it receives some sort of indication that the character has moved.

Terciob
Master Poster
Posts: 90
Joined: Fri Nov 07, 2008 3:47 am

Re: Problems with character.concealed member

Post by Terciob » Fri Jan 30, 2009 6:54 am

Use this ;)

Code: Select all

CONST PACKET_ID := 0x1D;
CONST PACKET_LENGTH := 0x5;
CONST BYTE_SERIAL := 0x1;
CONST RANGE := 0x24;
        
function RemoveObjectFromScene (object, flag := 0x01)

	var pessoas := listmobilesnearlocationex (object.x, object.y, object.z, RANGE, flag, object.realm);

	foreach mobile in pessoas
	
		if (mobile.connected)
			SendDestroyPacket(object.serial, mobile);
		endif
		
	endforeach

endfunction 

function SendDestroyPacket (serial, who)

    var pacote := createpacket(PACKET_ID, PACKET_LENGTH);
    
    pacote.setint32(BYTE_SERIAL, serial);
    
    pacote.sendpacket(who);
    
endfunction

Locked