Page 1 of 2

Merchants actions with hailing

Posted: Sun Mar 19, 2017 7:21 pm
by Gangrenous
So you go up to a normal NPC and the action would possibly be hail. On a merchant though, the action is to bring up the inventory of the merchant. As far as the PlayFlavor, that does fire upon hail. What is the proper way to do this? Do we leave the flavor and such as just working if the NPC is hailed?

Re: Merchants actions with hailing

Posted: Mon Mar 20, 2017 4:47 pm
by Jabantiz
This one is a lack of support on our end, on live both hail and opening the merchant window are executed at the same time, essentially 2 primary commands, the emu however supports only 1 primary command so currently we can only do one or the other.

Re: Merchants actions with hailing

Posted: Mon Mar 20, 2017 6:38 pm
by Gangrenous
I could always do a proximity check, and maybe have them fire 30% or so, that way you are not bombarded every time you walk by an NPC.

Re: Merchants actions with hailing

Posted: Sun May 19, 2019 1:05 am
by Cynnar
I just remembered this while working on a merchant today. This is what [mention]jakejp[/mention], I think, came up with a while back to handle the merchant window popping up and getting a conversation going in the hail function.

Code: Select all

function targeted(NPC, Spawn)
    if GetDistance(Spawn, NPC) < 10 then
        hailed(NPC, Spawn)
    end
end
I think it is better than just a proximity check as this one works when you target the NPC, then it does a distance check to make sure you are in range. Also you could use it for other functions besides the hailed function.

Re: Merchants actions with hailing

Posted: Sun May 19, 2019 2:48 am
by Gangrenous
Yeah, that would be another way to slice it.

Re: Merchants actions with hailing

Posted: Sun May 19, 2019 1:25 pm
by tyrbo
Is targeted meant to catch when someone clicks on the spawn?
That would also get triggered if I tabbed to the spawn, which might not be the behavior you want.

Re: Merchants actions with hailing

Posted: Tue May 21, 2019 2:00 pm
by Cynnar
Yes targeted is to catch when you target a spawn.

I really never thought about tabbing to target, and it would probably set off the hailed function. TBH though I, like most windows users, am a point and click guy. Meaning I'm not going to use tab unless it's required, and that's not around merchants. In fact everyone I've ever seen interact with a merchant runs up to each and every one of them. Makes the chances they are clicking on them vs tabbing to target them more probable. So I bet this would only be a rare issue at best.

Wonder if it's set in a packet?

Re: Merchants actions with hailing

Posted: Tue May 21, 2019 5:18 pm
by Ememjr
maybe we showed create a wanted change forum, like bugs, but for unimplemented things that dont exist so we have a place to keep track of them and possibly add that functionallity, it should not be to difficult to add a primary action command that does both or code it so that if it is a hail action and a merchant that the merchant window comes up

Re: Merchants actions with hailing

Posted: Wed May 22, 2019 11:40 pm
by tyrbo
You're right that most everyone clicks on an NPC like that to interact with it, but I also tend to just absentmindedly tab around all the time, possibly a habit I picked up on PVP servers.

I'm also thinking about mobs that might be outside the city, where a player might be naturally tabbing to find PVE or PVP targets, and happen to tab over an NPC with that hail functionality.

It'd probably be really simple to just add the hail behavior to the entity command that is fired.

Re: Merchants actions with hailing

Posted: Thu May 23, 2019 12:48 am
by Cynnar
tyrbo wrote: Wed May 22, 2019 11:40 pm It'd probably be really simple to just add the hail behavior to the entity command that is fired.
Unless you don't want a conversation to start when you click on the merchant. That would get annoying really fast if a conversation started every time you wanted to sell to the merchant, or buy from them.

Re: Merchants actions with hailing

Posted: Thu May 23, 2019 3:47 am
by Ememjr
yes it would but if we make it like live and i do believe thats the goal, then should add it, if an admin dowsnt want it then they select the non hailing action for the spawn

Re: Merchants actions with hailing

Posted: Thu May 23, 2019 10:06 am
by Cynnar
That's what I'm talking about. If you have a mender, and I believe there is one in darklight, that has a quest, then every time you click on the mender you will end up with the quest dialog. Naturally once you complete the quest it will be the final saying the npc has. I think, and not 100% sure, there are spawns, like merchants, that the dialog doesn't show unless you actually hail the npc. So how would you handle that? I will have to see if I can find it again, but do think it exists.

Even if it doesn't for the sake of being customizable do we want to lock that in to one way?

Re: Merchants actions with hailing

Posted: Thu May 23, 2019 10:36 am
by Ememjr
theres also a merchant in frostfang that has a quest attached, i will look at that one, and if needed at a minimum make it work like live

Re: Merchants actions with hailing

Posted: Thu May 23, 2019 1:01 pm
by Jabantiz
Really this is just multiple primary commands, hail and merchant, but the server code does not support that yet.

Re: Merchants actions with hailing

Posted: Thu May 23, 2019 2:58 pm
by Cynnar
Is that the secondary command, or what it's supposed to be anyway? I've never tried to use it so I wasn't sure.