Author |
Message |
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Tue Feb 12, 2008 12:51 am Post subject: LVZ toggling |
|
|
|
|
In mervbot's spawn.h:
// Increase this beyond 1 when Continuum supports LVZ object toggling with more than 1 object at a time.
#define MAX_OBJECTS 1
Can we toggle more than one lvz at once now? Does *objset really toggles many images at once, or sends a single packet for each object individually? _________________ (Insert a bunch of dead links here) |
|
Back to top |
|
|
dugwyler Newbie
Joined: Nov 29 2007 Posts: 7 Offline
|
Posted: Fri Feb 22, 2008 12:03 pm Post subject: |
|
|
|
|
Yeah, there's support for this now in packet C2S 0x0A:
index length desc
1 1 type byte (0x0A)
2 2 player id (0xFFFF for all players)
4 1 lvz packet type byte (0x35 for toggle)
5 2* lvz objID bitwise AND with 0x7FFF to turn on, 0x8000 to turn off
* repeat until done with all objects.
As for whether or not MERV supports this, dunno. See TWCore's GamePacketGenerator for an implementation that was ganked from Cerium's Hybrid. Also includes support for the type 0x36, for modification of LVZ objects.
As for just using *objset, yes, it works for any number of objects: *objset +5,-4,+3, -- just remember that you have to end with a trailing comma. I would recommend implementing on the packet level if MERV doesn't yet do it, though. |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Fri Feb 22, 2008 12:08 pm Post subject: |
|
|
|
|
Yeah, I'll check that... thanks
(If anyone else more familiar with the Merv core wants to help me out on this, it could help a lot )
Is there really no limit to the number of objects you can toggle with one packet? Would ridiculous amounts like 2000 work? or 70000? |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Fri Feb 22, 2008 1:35 pm Post subject: |
|
|
|
|
hmm... it only effectively toggles HALF the objects
I wanted 5, it toggled 3, I wanted 10, it toggled 5
EDIT:
oh wait... look at the packets the bot received... from the terminal:
PV:Samapico> !toggleon
A:Toggling ON 10 objects
Object number 200 enabled
Object number 19917 disabled
Object number 211 enabled
Object number 19917 disabled
Object number 222 enabled
Object number 19917 disabled
Object number 233 enabled
Object number 19917 disabled
Object number 244 enabled
Object number 19917 disabled
It was supposed to toggle on: 200, 211, 222, 233, 244 and 300, 311, 322, 333, 344
for some reason it queued these 19917 objects off...
Last edited by Samapico on Fri Feb 22, 2008 2:01 pm, edited 1 time in total |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Fri Feb 22, 2008 1:54 pm Post subject: |
|
|
|
|
Quote: | 5 2* lvz objID bitwise AND with 0x7FFF to turn on, 0x8000 to turn off | Wouldn't that be 0xFFFF to turn it off?
If you do ( id bitwise AND 0x8000 ) it will always give 0...
edit: oh.. it would be a bitwise OR with 0x8000 to turn it off...
Either way, the MSB of that integer is whether or not the object is being disabled, and the other 15 bits are the objectID. |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Fri Feb 22, 2008 2:19 pm Post subject: |
|
|
|
|
what the hell... now it says it's 2 bytes long.. I don't understand anything gaaaah
I made Console application projects in both VS6 and VS2005, and both give me a size of 2 bytes for that union...
Why does it show up as 4 in the plugin project...
Plugin project:
sendPublic("*arena size: " + (String) sizeof(Uint16) + " " + (String) sizeof(objectInfo) );
|
Outputs: "size: 2 4"
Visual Studio new console application project:
#include "stdafx.h"
typedef unsigned short Uint16;
union objectInfo
{
struct
{
Uint16 id : 15; // Object ident
Uint16 disabled : 1; // 1=off, 0=on
};
Uint16 n;
};
int main(int argc, char* argv[])
{
printf("%i %i\n", sizeof(Uint16), sizeof(objectInfo));
getchar();
return 0;
} |
Outputs: "2 2" in both Visual C++ 6.0 and Visual Studio 2005
What the hell am I doing wrong?
EDIT: I found the problem... the union posted above is from the clientprot.h file, in the core...
In spawn.h, there is a different definition of objectInfo:
union objectInfo
{
struct
{
unsigned id : 15; // Object ident
unsigned disabled : 1; // 1=off, 0=on
};
Uint16 n;
}; |
... so yeah.... unsigned != Uint16 I guess
By changing these 'unsigned' to Uint16, and changing MAX_OBJECTS to something bigger, anything using lvz's will be much more efficient...
Any chance of getting an updated version of Merv released with this? |
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:24 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Fri Feb 22, 2008 11:07 pm Post subject: |
|
|
|
|
Works like a charm now by the way...
My display module responds MUCH faster... When you change team for example, the whole display is changed on your screen with 1 packet, instead of like 20 :/ |
|
Back to top |
|
|
Smong Server Help Squatter
Joined: 1043048991 Posts: 0x91E Offline
|
Posted: Sun Mar 02, 2008 12:01 pm Post subject: Re: LVZ toggling |
|
|
|
|
Samapico wrote: | In mervbot's spawn.h:
// Increase this beyond 1 when Continuum supports LVZ object toggling with more than 1 object at a time.
#define MAX_OBJECTS 1 | Looks like you have an old version of the mervbot tutorial plugin code. I just downloaded a copy and it's set to 20.
Samapico wrote: | In spawn.h, there is a different definition of objectInfo | Can't see that in the tutorial code.
You might want to check for other differences between the latest tutorial code and your plugin before other old bugs creep in. _________________ ss news |
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sun Mar 02, 2008 7:50 pm Post subject: |
|
|
|
|
hmmm you're right... |
|
Back to top |
|
|
|