Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Dynamic Description

Dynamic Description

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Faedara   (106 posts)  Bio
Date Wed 14 Jul 2010 11:40 PM (UTC)
Message
I just finished my anti-theft triggers, much thanks to Nick and Lua, but looking over that script I had an idea:
In Lua, is it possible to make a script that changes your description depending on *all* the clothes you're wearing?

Say I have a mask, a cloak, and my undergarments. If I'm wearing both the cloak and the mask my description would be:

She is about six feet tall, and all defining features are hidden by her clothing.

If I remove the mask it would be:

She is about six feet tall, and *facial description here*

If I wear the mask but remove the cloak it would be:

She is about six feet tall, and *body description here*, but her face is completely hidden.


etc, etc, etc...

I have a feeling that the script I need for such a task is going to be much more complicated than I'll be able to understand, but so far Lua seems pretty simple.

The eternally clueless <3
Currently looking for a mentor/tutor to help me learn everything about Lua from the ground up. I can't understand 28*41 until I learn what causes 2+2.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 15 Jul 2010 01:20 AM (UTC)
Message
Certainly a small script. :-)

Maybe some sort of tree arrangement (that is, a cloak might cover your arms, wrist, hand, shirt etc.). So based on what you are wearing you go down a list and turn on a "hidden" flag. Then display what is not hidden.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Faedara   (106 posts)  Bio
Date Reply #2 on Thu 15 Jul 2010 01:42 AM (UTC)
Message
Alright, that sounds like it could work... time to get to work and make my very first script! If I finish it and it works I'll post it here.

The eternally clueless <3
Currently looking for a mentor/tutor to help me learn everything about Lua from the ground up. I can't understand 28*41 until I learn what causes 2+2.
Top

Posted by Faedara   (106 posts)  Bio
Date Reply #3 on Thu 15 Jul 2010 04:23 AM (UTC)
Message
Yeah... I never finished it. So far I know it will have the variables:

Head = description
arms = description
(etc)

then a list of clothing and what they cover, but I have no clue what to do with all the pieces. I'm a failure.

The eternally clueless <3
Currently looking for a mentor/tutor to help me learn everything about Lua from the ground up. I can't understand 28*41 until I learn what causes 2+2.
Top

Posted by KaVir   Germany  (117 posts)  Bio
Date Reply #4 on Thu 15 Jul 2010 09:28 AM (UTC)
Message
I designed a system for generating dynamic descriptions based on worn equipment last year, although I did it server-side, and even then I found it non-trivial. I discussed my approach (and got feedback from other developers) here: http://www.mudbytes.net/topic-1890

For example, this my character's description, in which my head and face are uncovered:

He is reasonably attractive, with pale white skin, glowing red eyes and long curly black hair which reaches his bare shoulders, held away from his face with a bandanna. Thin lines of dark runes cover his cheeks and naked upper body, tracing the muscles of his chest, coiling around his bare arms and twisting across his flat stomach. He has a pair of trousers tucked into his boots, with a black sash tied around his waist and greaves strapped over his shins. He is nearly six and a half feet tall, and seems quite agile on his feet. A pair of knives are strapped to his forearms.

But this is what I see when I look at someone who is covering their head and face:

A pair of light green eyes gaze out through the slit in the closed visor of his full helm, which fully conceals the rest of his features. He is wearing a breastplate over his chainmail shirt, and a pair of bracers are strapped to his forearms. He has a codpiece over his chainmail leggings, which are tucked into his boots, with a belt tied around his waist and greaves strapped over his shins. He is about six feet tall, and rides his greater warbeast with grace and balance. He is holding a dripping wet brass demonic battleaxe in both gauntleted hands. A pair of wands are strapped to his belt, while a crescent shield is slung across his back.

Doing this with a client script would require access to quite a lot of character and equipment data though...are you able to retrieve such information?
Top

Posted by Faedara   (106 posts)  Bio
Date Reply #5 on Sat 17 Jul 2010 09:17 AM (UTC)
Message
No, which is why I'd need variables. Every time I wear or take off an article of clothing, the variable for that article becomes 0. That means I'd need to set up a trigger identifying all clothing I own and/or might wear, as well as one that sends the new description every time I change clothes.

The eternally clueless <3
Currently looking for a mentor/tutor to help me learn everything about Lua from the ground up. I can't understand 28*41 until I learn what causes 2+2.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


20,129 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.