entity_command 'order by'

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

entity_command 'order by'

Post by John Adams » Sat Jan 24, 2009 9:16 pm

LE, unless you have a secret you haven't told me, we are going to need a few things with the command_primary and command_secondary lists.

Foremost, an 'order' needs to be applied to the command list. Either SOE does it alphabetically, or they allow commands to appear in a specific order (I am hoping for the former, cuz that's just easier ;))
command_order.jpg
In this pic, we should be seeing
  • buy from merchant
    hail
    sell to merchant
In that order.


Secondly, I have learned that some commands in the command list are "conditional"... specifically the 'assist' command that most NPCs seem to have. If you approach an NPC, target him with Tab and right-click, you'll see something like:
  • find npc
    attack
    hail
on NPCs like Guards and such. However, if you Hail that NPC and they turn to respond, a new command appears.
  • find npc
    assist
    attack
    hail
In this example, the command_primary is listed first, but everything in the command_secondary seems alphabetical. Woot. So while ordering the command_secondary list is probably simple, getting commands to stay hidden unless a certain criteria is met may be a little more involved.
You do not have the required permissions to view the files attached to this post.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: entity_command 'order by'

Post by John Adams » Fri Aug 28, 2009 9:14 am

Ok, 8 mos is long enough to try fixing this myself. I need someone with a brain to look at this.

I have tried using an order by id, command_text where entity_commands are loaded, yet it makes no difference. What keeps coming out (always) is the LAST, highest entity_command.id first, followed by the command_primary, then the second (or next few) command_secondaries... it makes no sense.

These are all the hail, buy, sell commands from our database:

Code: Select all

id, command_list_id, command_text, distance, command, error_text
5, 5, hail, 10, hail, 
8, 8, buy from merchant, 10, frommerchant, 
544, 100, hail, 10, hail, 
547, 101, hail, 10, hail, 
548, 101, sell to merchant, 10, frommerchant, 
558, 102, hail, 10, hail, 
I should see in position #1: (8) buy from merchant, because that is his PRIMARY command
Followed by #2: (101) hail
Followed by #3: (101) sell to merchant
commands.jpg
This probably has something to do with some diabolical C++ crap with the vector/iterator blahblahblahblah... that I cannot figure out.

Is there a way to sort a list after it's made? Maybe it'd be that simple. A push in the right direction would be appreciated on this miniscule bug.

TIA,
You do not have the required permissions to view the files attached to this post.
John Adams
EQ2Emulator - Project Ghost
"Everything should work now, except the stuff that doesn't" ~Xinux

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: entity_command 'order by'

Post by LethalEncounter » Fri Aug 28, 2009 1:22 pm

Hmm sorry I never got around to this, but have you tried looking at the packet that the emu is generating? It might be that the client is reordering them after we send the packet. If you have a chance, uncomment the DumpPacket(outapp); in Client::HandleVerbRequest(EQApplicationPacket* app) and paste what it displays here. If it is in the correct order there and it still isn't in the game then it is the client, otherwise it is the code.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: entity_command 'order by'

Post by John Adams » Fri Aug 28, 2009 1:24 pm

I'll give that a try, LE. Thanks. In the live game, the order is correct, so could that still be the clients fault?

It isn't super critical, just grating on my perfectionist nerves that it's not like Live =) I'll try the dump.

Locked

Who is online

Users browsing this forum: No registered users and 1 guest