Buy Prog - What have I done wrong?

For builders to discuss and ask building questions.
Post Reply
Nedylene
Sword Grand Master
Sword Grand Master
Posts: 517
Joined: Mon Aug 25, 2003 2:00 am
Location: Zhentil Keep

Buy Prog - What have I done wrong?

Post by Nedylene » Thu Sep 04, 2008 4:47 am

I have simply stared at this guild file for FAR too long. This is one of two small problems and for the life of me I cannot figure out what I did wrong in this prog

Code: Select all

>buy_prog i68~
if guild($n) == invokers
  if actorhasobjnum(18503)
    mpecho $I picks up a white velvet spellpouch off the shelf.
    mposet on $n i68 name i68 velvet spellpouch pouch silver runes
    mposet on $n i68 short {F0}a velvet spellpouch {70}embossed with silver runes
    mposet on $n i68 long {F0}A velvet spellpouch {70}embossed with silver runes {F0}lies here.
    mposet on $n i68 ed addline 'velvet spellpouch silver runes' {70}Silver runes sparkle faintly{F0}  on the soft white velvet of the spellpouch.
  endif
endif
~
|
It triggers.... Get the echo ... but nothing actually "happens"

Help?
User avatar
Argentia
Sword Grand Master
Sword Grand Master
Posts: 357
Joined: Fri Jul 23, 2004 4:31 am
Location: The City of Splendors
Contact:

Re: Buy Prog - What have I done wrong?

Post by Argentia » Thu Sep 04, 2008 1:20 pm

To what objects do i68 and i18503 correspond to?
Do not meddle in the affairs of dragons, for you are crunchy and go well with ketchup.
Nedylene
Sword Grand Master
Sword Grand Master
Posts: 517
Joined: Mon Aug 25, 2003 2:00 am
Location: Zhentil Keep

Re: Buy Prog - What have I done wrong?

Post by Nedylene » Thu Sep 04, 2008 2:30 pm

i68 is a spellpouch. i18503 is the guild school ring
Enig
Sword Grand Master
Sword Grand Master
Posts: 787
Joined: Wed Dec 20, 2006 5:28 pm
Location: The Frozen North (Canada!)

Re: Buy Prog - What have I done wrong?

Post by Enig » Thu Sep 04, 2008 2:56 pm

Well, since the echo is functioning it seems that the if condition is being returned as true, so there wouldn't be a problem there. I don't see anything particularly wrong with the mposets, either. It looks like it *should* work to me, which I'm sure isn't too helpful. Incidentally, I did notice it's almost verbatim of the lesson file, too, so the script really should be solid :P

That said, if there's nothing wrong with the script maybe the problem is somewhere else. Just a bit of random brainstorming but maybe you could try having the mob alter a different field on the object, like adding a flag. That way you could determine whether it's a problem setting the description in particular or manipulating the object at all. If the mob's having trouble manipulating the object, trying the script as a mort might help. It's a pretty big longshot since I think that mobs can alter objects on imm charcters but it couldn't hurt to give it a run.

Beyond that I'm not honestly sure. One thing I'd suggest trying, at least, is a bribe program, only because that's how I did the spellpouches in my guild area and I haven't noticed any problems with it. On the off chance that it's helpful, here's the script I used.

Code: Select all

    mpecho {60}$I picks up a spellpouch and deftly sews a sequin turtle into it.
    mpoload 68
    mposet i68 name i68 midnight blue spellpouch spell pouch azure turtle embroidered
    mposet i68 short {40}a midnight blue spellpouch embroidered with an {e0}azure turtle
    mposet i68 long {40}A midnight blue spellpouch embroidered with an {e0}azure turtle{40} is here.
    mposet i68 ed addline 'midnight blue spellpouch spell pouch embroidered azure turtle' {40}The spellpouch is made of midnight blue silk and embroidered on the side with an {e0}azure turtle{40}.
    mpgive i68 $n
Good luck! :)
Nedylene
Sword Grand Master
Sword Grand Master
Posts: 517
Joined: Mon Aug 25, 2003 2:00 am
Location: Zhentil Keep

Re: Buy Prog - What have I done wrong?

Post by Nedylene » Thu Sep 04, 2008 3:15 pm

Hmm.. see the problem. The builder lessons adds an "on" into the script which shouldn't be there
Enig
Sword Grand Master
Sword Grand Master
Posts: 787
Joined: Wed Dec 20, 2006 5:28 pm
Location: The Frozen North (Canada!)

Re: Buy Prog - What have I done wrong?

Post by Enig » Thu Sep 04, 2008 3:41 pm

Well, the buy_prog will trigger after the PC ($n) buys an object ($o) which should put it in his/her inventory and seems to necessitate the use of 'on $n' to alter it.

My program doesn't include that because it's triggered by a bribe and not a buy. I'm loading the object up on the mob who alters it while it's still in her inventory before she hands it over to the PC.
Nedylene
Sword Grand Master
Sword Grand Master
Posts: 517
Joined: Mon Aug 25, 2003 2:00 am
Location: Zhentil Keep

Re: Buy Prog - What have I done wrong?

Post by Nedylene » Thu Sep 04, 2008 4:07 pm

Oh bugger... How bout that. when testing.. It is altering the spellpouch I am WEARING instead of the one I am buying. Argh
Dalvyn
Sword Grand Master
Sword Grand Master
Posts: 4708
Joined: Tue Jul 15, 2003 9:26 pm
Location: House of Wonder, Waterdeep

Re: Buy Prog - What have I done wrong?

Post by Dalvyn » Fri Sep 05, 2008 4:38 pm

Try a buy_prog without the "on $n".

I *think* that the buy_prog triggers just before the object is actually placed in the buyer's inventory.
Image
Post Reply