Page 1 of 2

Accidental givings

Posted: Sun Nov 30, 2014 1:22 am
by Yemin
Would it be possible for NPCs to drop items that their given on accident?
I know on some muds NPCs will drop an item if its not an item their supposed to have but i'm not clear how those are built so yeah.

I'm suggesting something like this because I'm half hoping that from time to time people give the wrong or possibly valuable item to NPCs like on accident like myself and would appreciat a measure like this.

Re: Accidental givings

Posted: Sun Nov 30, 2014 1:26 am
by Yemin
P.s. or if the request command could be amended to include all alignments?
I'm not clear why or if the command does actually stick to LG chars like it says so in the help file but it seemed fairly meh for a farmer npc to have constant know alignment or something.

Re: Accidental givings

Posted: Sun Nov 30, 2014 7:59 pm
by Harroghty
This really is not an epidemic problem requiring a solution on that scale. If there is an immortal on-line then he or she will typically return the objects, if not then applications can address issues.

If one finds that it becomes a routine problem then the easiest solution is to be more careful.

Re: Accidental givings

Posted: Fri Dec 05, 2014 9:55 pm
by Bronson
For the record: I too would love to see something like this implemented. I have had three instances that have occurred like this, 1 was fixed by an online IMM, the other two were applied to have fixed, and were both denied, one of which left me with an unfinished quest.

Re: Accidental givings

Posted: Fri Dec 05, 2014 10:15 pm
by Yemin
Its not exactly a titanic game ending issue as such. But when a typo / tired typing can lose you one or several earned items in a only slightly less painful way than death..., I'd wager its worth a fix tbh.

Re: Accidental givings

Posted: Sat Dec 06, 2014 12:17 am
by Xryon
Compared with the effort involved, though... It really comes down to people need to be more careful. You're talking about either adding an else clause to every single mob with a give quest in the game, or a hard-code solution that checks first for whether or not they have a give prog, then has them deny everything else... I'm not even positive the code checks for whether mobile progs exist. Basically, it's a hell of a lot of work for what can be solved by paying attention.

Re: Accidental givings

Posted: Sat Dec 06, 2014 3:55 am
by Algon
Xryon wrote:Compared with the effort involved, though... It really comes down to people need to be more careful. You're talking about either adding an else clause to every single mob with a give quest in the game, or a hard-code solution that checks first for whether or not they have a give prog, then has them deny everything else... I'm not even positive the code checks for whether mobile progs exist. Basically, it's a hell of a lot of work for what can be solved by paying attention.
I agree with this completely. There are many many other things the builders and Imms can be focusing on, like bringing in new areas and fixing actual bugs. Like was said above, the Imms are pretty good at helping out when this happens. Just be double careful when giving anything to a mob :)

Re: Accidental givings

Posted: Sat Dec 06, 2014 1:22 pm
by Yemin
I see..., I wasn't aware that was the nature of the code here. Fair enough.

Re: Accidental givings

Posted: Tue Dec 09, 2014 4:21 am
by Kregor
Xryon wrote:Compared with the effort involved, though... It really comes down to people need to be more careful. You're talking about either adding an else clause to every single mob with a give quest in the game, or a hard-code solution that checks first for whether or not they have a give prog, then has them deny everything else... I'm not even positive the code checks for whether mobile progs exist. Basically, it's a hell of a lot of work for what can be solved by paying attention.
Did this in my own code base... about three years ago. Every operation of do_give checks for a mobile prog with a give trigger. So, in the actual give trigger check I added 15 lines of code, after the function checks whether or not the program triggers:

Code: Select all

	if (!IS_PET(mob, ch))
	{
		if (!IS_ACT(mob, ACT_SCAVENGER))
		{
			act( "$N seems a bit puzzled by your gesture, and hands back $p.", ch, obj, mob, TO_CHAR);
			act( "$N seems a bit puzzled by $n's gesture, and hands back $p.", ch, obj, mob, TO_ROOM);
			obj_from_char(obj);
			obj_to_char(obj, ch);
		}
		else
		{
			act( "$N seems quite pleased by your generosity.", ch, NULL, mob, TO_CHAR);
			act( "$N seems quite pleased by $n's generosity.", ch, NULL, mob, TO_ROOM);
		}
	}
The basic operation is: If the mobile doesn't have a give prog (or even if you just give it the wrong thing... either would mean the check didn't return TRUE), then check if it's a pet (which you can give to all you like); if it isn't a pet, then check if it's a scavenger (the mobiles that pick up random stuff off the ground, which I'm not certain if FK even still has as an ACT flag, but could be omitted if not); if neither of these is the case, the mobile gladly hands the given item back to the PC.

Mileage may vary, and you may have to use a line or two more or less, and FK is written in C++, whereas my code is in C, but all told, the time to figure out the operation, code it up, and playtest the addition took less than an hour, and then less than 5 minutes here to remember where the function was, search it up in the file, and share. Not a lot of effort, really. And it would make the way give progs operate far more newbie friendly.

Re: Accidental givings

Posted: Tue Dec 09, 2014 5:05 pm
by Yemin
Thanks for the help. Here's the the smart people that make fun games fun. :)

Re: Accidental givings

Posted: Tue Dec 09, 2014 8:48 pm
by Xryon
Ah, that makes a lot of sense. I didn't even think about the fact you could just definie it in the prog code itself. Thanks for the response, Kregor.

What do you think, code team? People have been complaining about this since I started here, and it looks like the solution is pretty readily presented.

Re: Accidental givings

Posted: Wed Dec 10, 2014 11:26 am
by Harroghty
I still believe that this problem is capably addressed by our current system because we typically have only one or two, if any, such requests in a player's career. Specifically, the staff will help you out a few times, but expects you to then learn to be more careful.

I have built programs into some quest NPCs with whom it is an historical problem.

Re: Accidental givings

Posted: Wed Dec 10, 2014 2:29 pm
by Yemin
Dunno, I know for myself Its happened more than 1 or 2 times... and will likely happen, not regularly, but even occasionally can be painful. Personally I'd be happier with NPCs that are expected to be given something to have the code... quest givers, stablemen... whichever priests take tythes if thats still a thing and so on.

Because of the wide and much appreciated items in FK eventually a few items will share keywords which is the causal factor here and to be honest I think this is one of those things that happens more than is reported because of how trivial it may seem to lose a +1 cha bracelet. But thats 1 bracelet less to trade / use and will probably leave a sense of minor loss that dampens your enjoyment of the game.

Accidents are called accidents for a reason and I've never been a fan of leaving something as is just because its not a colossal issue since most of what I appreciate about FK is in the details. But I recognize there is a effort cost - gain line with everything so it does just come down to the team's view on how much a fix now can save in the longterm of having a legitimate reason not to take applications like this in the future. Which again, is probably a minor effort for an admin = 5 mins of logging in the character and replacing the items given... but it adds up if you multiply it by the previously mentioned 1 - 2 times even just by half the number of players on FK, Vs what seems like a similar time frame to save yourself from distractions.

But yea, just my thoughts. My favourite math teacher all those long years ago told me that the best mathmeticians are the laziest because they solve a problem in the least amount of moves and I guess i take that to heart with almost everything.

Re: Accidental givings

Posted: Fri Dec 12, 2014 12:19 am
by Mele
He isn't speaking from 'dunno'. He's a staff member who has been handling applications for years.

As am I, and I will reiterate his sentiment: This only happens 1 or 2 times in the career of the average character.

Re: Accidental givings

Posted: Sun Dec 21, 2014 10:19 pm
by Yemin
Well, not sure if / how i've stepped on some toes with this one so my apologies,

Re: Accidental givings

Posted: Tue Dec 23, 2014 11:31 pm
by Harroghty
No reason to apologize. The current solution is just effective to the need; while it would be great to go and code every game mobile, that amount of effort is not necessary for something which is only a problem for a select few people. In general, most people only do this once or twice and then not again (judging from observation and the records of applications); applications and on-line immortals are sufficient for the current problem.

I find that personally using the full name of my PC's horse, for example, takes only a second to type and prevents a lot of trouble.

Re: Accidental givings

Posted: Wed Dec 24, 2014 2:05 am
by Xryon
Possible solution would be to set up a trigger to make 'give *' (pretty sure * is wildcard) not do anything. Forces the step Harroghty recommended. I know I had to do this with 'k *' because I kept attacking things when I meant to just look at them.

Re: Accidental givings

Posted: Wed Dec 24, 2014 10:57 am
by Tortus
As far as aliases go, % is wildcard. I, too, have the routine of adding the 'alias k look %' to all my characters.

Re: Accidental givings

Posted: Wed Dec 24, 2014 11:56 am
by Yemin
hmmm, Alrighty, thanks

Re: Accidental givings

Posted: Sat Dec 27, 2014 7:29 pm
by faylen
Sometimes mobs also have keywords we don't know they have.

Yesterday I was trying to give 15 plat coins to Mearki, typed give 15 plat mear, and it went to the constable. I totally was not expecting that. Of course request didn't do any good for that, so I just counted it as a loss, but if that had been 150 platinum I would have been pretty unhappy about it.

There's also the situation where you might thing a quest involves giving an object to a mobile when the correct step is actually something else, then you end up giving the object to them and it's gone. It hasn't happened to me, but I've seen others run into that. Personally it makes me extremely hesitant to give anything to a mob just in case I'm not supposed to, because I don't know if I'll get it back or not.