Extra code ideas for items

For builders to discuss and ask building questions.
Post Reply
User avatar
Gwain
Sword Grand Master
Sword Grand Master
Posts: 2354
Joined: Tue Nov 01, 2005 9:25 pm
Location: Waterdeep

Extra code ideas for items

Post by Gwain » Thu Feb 02, 2012 6:30 pm

My experience in the mud is moreso about ideas than coding. Speaking of which I am familiar with osetting and how code works. I'd like to add a thread here for builders looking for ideas for specially coded items. Items like relayerable scabbards, open/close cloaks and weapons that turn into other ones. Its more of an idea machine, if you don't know how to code it, you can still suggest it if you think it is possible in the current code and maybe an active builder will know how to code it and add it to their areas if they wish to in the future, or they might post the code here for general archiving.

I'll start:

Partially renameble scabbard/sheaths:
Like the puppets in the mud, these scabbards can be altered to show the pommel of the weapon currently inside them, basically, you sheath the weapon then can use a command to rename a part of the short description to include the pommel of the weapon: So a scabbard would become a scabbard with an ivory pommel sticking out of it, or an ivory pommeled scabbard. When you type draw, the scabbard automaticly resets because there is no longer a weapon in it.
Last edited by Gwain on Fri Feb 03, 2012 6:40 pm, edited 1 time in total.
Justice is not neccesarily honourable, it is a tolerable business, in essence you tolerate honour until it impedes justice, then you do what is right.

Spelling is not necessarily correct :)
User avatar
Raona
Staff
Staff
Posts: 4944
Joined: Fri Aug 19, 2005 3:40 pm
Location: Waterdeep - Halls of Justice
Contact:

Re: Extra code ideas for items

Post by Raona » Fri Feb 03, 2012 12:05 pm

Elsewhere I've pined for items to give the light-fingered what's coming to them! Booby traps, so to speak, so if someone picks the shiniest thing in your inventory, they get a nasty surprise. But I've not put in the effort to try coding it myself, hence my plopping it down here for the taking.
User avatar
Gwain
Sword Grand Master
Sword Grand Master
Posts: 2354
Joined: Tue Nov 01, 2005 9:25 pm
Location: Waterdeep

Re: Extra code ideas for items

Post by Gwain » Sun Feb 05, 2012 3:16 am

Also to add to the puppet scabbards, I'd use that on quivers or baskets, to classify the contents, like gold ore or ingots.
Justice is not neccesarily honourable, it is a tolerable business, in essence you tolerate honour until it impedes justice, then you do what is right.

Spelling is not necessarily correct :)
User avatar
Gwain
Sword Grand Master
Sword Grand Master
Posts: 2354
Joined: Tue Nov 01, 2005 9:25 pm
Location: Waterdeep

Re: Extra code ideas for items

Post by Gwain » Fri Feb 17, 2012 1:12 pm

Item smotes

I've seem some of these on hard-set puppets, meaning puppets that you don't build, but are built by a builder. They have one command smote, they are very clever, I could see this applied to items used in smotes to generate smotes without the owner being included, such as foods or armour. For example, if you hold an apple with apple or foodsmote, you can go "a red apple dribbles juice all over Gwain's chin. This could also work for weapons in the sense of sentience, you can make weapons smote or even talk if it called for it. Great preexisting code.
Justice is not neccesarily honourable, it is a tolerable business, in essence you tolerate honour until it impedes justice, then you do what is right.

Spelling is not necessarily correct :)
User avatar
Algon
Sword Grand Master
Sword Grand Master
Posts: 1070
Joined: Thu Aug 14, 2003 12:44 am
Location: Waterdeep

Re: Extra code ideas for items

Post by Algon » Fri Feb 17, 2012 3:59 pm

I really like the idea behind this! But would this specific line of code have to be manually applied to each item in game for this to work? Also, with the puppets you use puppetsmote, I believe it is, to make them work. Would we need to add something like an Ismote to make an item work?

Example Ismote apple drips dribbles juice all over $Gwain's chin.
You see "a red apple dribbles juice all over Gwain's chin"

Also, would there be restrictions on which items could actually use an smote or would they need to be set up to only use emotes? That way every random person in the game could not have a talking apple? lol Maybe just set it up as Imote and have that be unable to add speech text? Just throwing out ideas! :D

I am sure this would be some massive undertaking, but it could definitely add an exciting element to the game!
Counting bodies like sheep...to the rhythm of the war drums. ~~~ Maynard
Xryon
Sword Master
Sword Master
Posts: 233
Joined: Thu Aug 25, 2005 5:24 am
Location: Waterdeep

Re: Extra code ideas for items

Post by Xryon » Fri Feb 17, 2012 4:10 pm

I haven't looked very closely at the oprogs here, but this should be already doable via use_progs and wear_progs (for equipment) coupled with mpechoaround/at's, I would think. If incorrect, feel free to disregard me.
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: Extra code ideas for items

Post by Harroghty » Sat Feb 18, 2012 4:03 am

Code: Select all

>intercept_prog desiredcommandhere~
if actorhasobjnum(QQ01)
  mpforce $n smote whatever you want.
  mpunintercept
else
  mpunintercept
endif
~
Or something similar.
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
User avatar
Gwain
Sword Grand Master
Sword Grand Master
Posts: 2354
Joined: Tue Nov 01, 2005 9:25 pm
Location: Waterdeep

Re: Extra code ideas for items

Post by Gwain » Sat Feb 18, 2012 4:09 am

I'd add that if you wanted to avoid the item being too smart, we could make it use emote. that way it uses colours and does not talk
Justice is not neccesarily honourable, it is a tolerable business, in essence you tolerate honour until it impedes justice, then you do what is right.

Spelling is not necessarily correct :)
Xryon
Sword Master
Sword Master
Posts: 233
Joined: Thu Aug 25, 2005 5:24 am
Location: Waterdeep

Re: Extra code ideas for items

Post by Xryon » Sat Feb 18, 2012 4:04 pm

Items should probably avoid emotes, to be honest... i'm not sure that would work as intended, though, once again, I haven't started tinkering with it yet (I haven't forgotten, boss man!) What I would recommend is actually just an mpechoat/around to simulate the emote function. It would essentialy be the same thing, except would allow more customisable messages. I.e., instead of $n (or $o for objects? Im on my phone, I can't remember) at the start of the "emote" you could have it anywhere in the print.

Excuse my rambling; I'm stuck in a van on the way to a job, and building discussion is infiniely more interesting than staring out the windshield -cough-
User avatar
Harroghty
Staff
Staff
Posts: 9695
Joined: Tue Jul 27, 2004 5:38 pm

Re: Extra code ideas for items

Post by Harroghty » Sat Feb 18, 2012 6:01 pm

Using a preset smote (a sound effect really) is the most efficient way to code this. e.g.
mpforce $n smote takes a bite out of a juicy apple.
...instead of...
mpechoat $n {60}You take a bite out of a juicy apple.
mpechoaround $n @N {60}takes a bite out of a juicy apple.
It is the extremely rare item that will have something like this:

Code: Select all

>intercept_prog action~
smote $0
~
The result of which would like this if it were on, let's say, a sentient sword...
action sings a song.
A sentient sword sings a song.
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Xryon
Sword Master
Sword Master
Posts: 233
Joined: Thu Aug 25, 2005 5:24 am
Location: Waterdeep

Re: Extra code ideas for items

Post by Xryon » Sat Feb 18, 2012 8:13 pm

Yeah, that's what I was going for with my rambling. I misunderstood and thought we were looking for prints from the item itself, not a player-centric display.
User avatar
Gwain
Sword Grand Master
Sword Grand Master
Posts: 2354
Joined: Tue Nov 01, 2005 9:25 pm
Location: Waterdeep

Re: Extra code ideas for items

Post by Gwain » Sun Feb 19, 2012 1:38 am

That would keep the more devious people in line :evil:
Justice is not neccesarily honourable, it is a tolerable business, in essence you tolerate honour until it impedes justice, then you do what is right.

Spelling is not necessarily correct :)
Post Reply