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 ➜ SMAUG ➜ SMAUG coding ➜ A common misunderstanding about smaugspells (FWD)

A common misunderstanding about smaugspells (FWD)

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


Pages: 1 2  

Posted by Valcados   (15 posts)  Bio
Date Thu 02 Aug 2007 12:46 PM (UTC)

Amended on Thu 02 Aug 2007 12:47 PM (UTC) by Valcados

Message
I'm deciding to publish a recent e-mail I sent to one of the imms at Lands of Aethar, because I think this is a very common misunderstanding which many SMAUG muds suffer from.

----------------------------


On 8/2/07, (Censored) wrote:

> Yeah ... a command like this would be best.
>
> If you give me the details, I can do up the help file for it.
>
> Also, what is the sset line to add the following affect to a skill?
>
> Affect 1 modifies affected by 'curse' and applies curse for '12' rounds ?
>
> Thanks

The affected thing is one of the most misunderstood things in SMAUG. The 'curse' in quotes actually gets translated by the smaugdice machinery (so in theory it'd be possible to do something like "affects affected by '1d6'"). Since 'curse' is nonsense as a smaugdice, the whole thing is equivalent to:

Affect 1 modifies affected by '0' and applies curse for '12' rounds

Anyway, the syntax is
sset curse affect affected curse 12 curse

Or if you wanted to do it more correctly (see above),
sset curse affect affected 0 12 curse

You can add that affect bit at the end of ANY affect, btw. So you could do
sset curse affect hitroll -2 12 curse
and it would be
Affect 1 modifies hitroll by '-2' and applies curse for '12' rounds

Incidentally, a similar misunderstanding exists with the "resistant", "susceptible", "immune" fields. It's common to see something like:
Affect 1 modifies resistant by 'fire' for 100 rounds.
Here, 'fire' gets sent to the smaugdice formula, which can't make sense of it and so the affect does NOTHING! The correct way to do these is to figure out the bitvectors. To do this, type "HELP RESISTANT". Find the number of a desired resistance, starting at 0 and reading left to right, eg fire=0, cold=1, electricity=2, etc. Call this number X. Then the number you want to affect resistant by, is 2 to the X. For example, say we want to affect resistant to electricity for 100 rounds. Electricity has number 2, and 2 to the 2 is 4, so the correct way is "sset spell affect resistant 4 100". You can actually affect more than one resistances with the same affect, by adding the powers of 2. For example, say you want it to give resistance to both electricity AND energy. Energy has number 3, electricity has number 2, so you want to affect by 2^2+2^3=4+8=12. sset spell affect resistant 12 100. Now the spell gives resistance to BOTH things.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Thu 02 Aug 2007 01:29 PM (UTC)
Message
This would make a good article on MudBytes. :)

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #2 on Fri 03 Aug 2007 04:30 PM (UTC)
Message
I can't help but thinking there might be some way to address this in code too.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #3 on Fri 03 Aug 2007 06:13 PM (UTC)
Message
I think you could do it if the commands were more based around their intention than around literal syntax of how the data is stored in game. If I try to make an effect of resist-electricity, I should be able to say "resist electricity" and have the command do whatever is necessary to turn that into the right numbers etc.

The problem is that it makes for a fair bit of maintenance of the building command, but on the other hand, a lot of these commands really are obscure, persnickety and fragile to use, in the sense that you need to know fairly strange syntax and if you don't get it just right it either won't work or won't do what you thought it was going to do (what it "should" do given the command you typed).

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Valcados   (15 posts)  Bio
Date Reply #4 on Fri 03 Aug 2007 06:46 PM (UTC)

Amended on Fri 03 Aug 2007 06:51 PM (UTC) by Valcados

Message
Yeah, I agree more could be done codewise. I didn't post it at SMAUGFUSS because there isn't any actual *BUG* though, just suboptimal user interface.

Before rashly running out and making changes, consider that there IS use in the current system. For example,

Affect 1 modifies resistant by '((1d2)-1)*8'

would give resistant to energy with 50% chance.

I dunno whether anyone would ever actually use such obscure feature though.

It'd suck, though, if someone does, and a SMAUGFUSS upgrade made their spellfile corrupt.

Probably the best would be to make smaugspells smart enough to be able to figure out whether to send the argument to smaugdice or to search a table of flags.

Of course this is a lot of work to make a change that is invisible to players.

EDIT: I even managed to think of a spell which could potentially be pretty cool on a small MUD.

sset gambleshield affect resistant '1d4194304-1' 100
sset gambleshield affect susceptible '1d4194304-1' 100

In theory (I didn't test it and there may be an issue with rolling such enormous dice) this would make the gambleshield spell add a totally random set of resistances and susceptibilities :)
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #5 on Fri 03 Aug 2007 07:51 PM (UTC)
Message
I'm not sure I see much point in randomized effects: you can just keep adding and removing the object until you get the one you want. If the object could only be worn once, though, it'd be a different question.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #6 on Fri 03 Aug 2007 08:17 PM (UTC)
Message
David, why assume that it's only cast by a wearspell? Or what if this gambleshield simply isn't recastable, once cast, you'd ahve to wait for it to wear off or cast a dispel magic before you could just recast it? Or, if it was on a wearspell, why not simply include a noremove flag on that object too?

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #7 on Fri 03 Aug 2007 08:33 PM (UTC)
Message
I was responding to the example Valcados gave, which for some reason I did assume was for equipment. And a noremove flag isn't too great, but for other reasons. (But let's get into that later...)

I'm also not entirely sure I like the idea of long-duration spells that are randomized: that is introducing sheer luck into the equation for benefits that (presently at least) are not really clear to me. It's one thing to have "instantaneous" randomization to keep things interesting, but it's another to have a randomized decision made that you are stuck with for a long time just to recast when the spell works. Seems pretty boring to me, frankly.

And if you allow dispel magic, that is just encouraging people to write scripts to do this for them. It'd be just like stat rollers, except this time it is a "spell roller": you cast, look at what it did, if it doesn't satisfy you, dispel and start again.

I think it was Richard Bartle (but I could be wrong) who said that if a feature encourages players to automate in order to best exploit the feature, you should seriously rethink the feature.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Valcados   (15 posts)  Bio
Date Reply #8 on Sat 04 Aug 2007 01:54 AM (UTC)
Message
David's post made me realize, I should add something to the original post.

The misunderstanding; the syntax stuff; everything in the original post, applies ONLY to smaugspell affects.

Affects on equipment don't use smaugdice, and "oset sword affect resistant fire" DOES realize that "fire" means "bitvector 1<<0".


Postscript
The gambleshield was just an example. Other useful things which wouldn't involve luck, would be, eg, giving different resistances based on the spellcaster's wis.
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #9 on Sat 04 Aug 2007 04:22 AM (UTC)
Message
Even if the spell in question required you to wait out it's duration, regardless of whether the affects in question were the ones you wanted or not, if the spell has too brief a duration, it serves no purpose. But I agree, there's nothing about this that indicates that duration has to be a period of more than a couple of minutes (max) I'd think, though I suppose even a spell that lasted an hour wouldn't exceed some of the spells already in the game.

Dispel magic is already allowed in stock Smaug, so that's not even an issue. Besides, stat rollers seem to be pretty popular. *shrug* (My mud doesn't use one, but plenty of muds do.)

As for the noremove flag, yes, it can be bypassed with a remove curse spell, but then you're the one who'd suggested that it'd work for you if the item could only be worn once. *shrug*

I agree that adding a feature that encourages players to automate to get around it is a bad idea, but we're discussing Valcados' example affect randomization spell, not necessarily a real feature.

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #10 on Sat 04 Aug 2007 04:37 AM (UTC)
Message
It's not just a question of duration per se, it's a question of how long you have to wait to restart the spell.

Quote:
Besides, stat rollers seem to be pretty popular. *shrug* (My mud doesn't use one, but plenty of muds do.)
I was talking about client-side stat rollers, which seem like "cheating", but only because (IMO) the system they are exploiting is broken and encourages "cheating" to begin with.

Quote:
As for the noremove flag, yes, it can be bypassed with a remove curse spell, but then you're the one who'd suggested that it'd work for you if the item could only be worn once. *shrug*
Yes, and I meant once. :) As in, you use it once, and can't do it again, ever.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #11 on Sun 05 Aug 2007 01:32 AM (UTC)
Message
For most spells that would depend on the caster's level or other stat that was used as part of the duration calculation, course, it doesn't have to be..

Ah, hadn't encountered one of those yet, but yeah, I would think that'd be a bit of cheating too.

Hmm, maybe you could give it a wear prog to go with the wearspell that would force the player to remove and sac the object in question, but that'd suck if to get the item you had to fight a tough mob and then you put it on before the last instance of the spell in question had worn off. *snicker*

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #12 on Sun 05 Aug 2007 02:20 AM (UTC)
Message
Quote:
Ah, hadn't encountered one of those yet, but yeah, I would think that'd be a bit of cheating too.
Really? We probably get several requests a month to make one of these things. Ticks me off, but again I think the blame lies a little more with the MUD than the players.


And yeah, that would be a kind of "oops" moment. :) I was thinking something kind of like the sigil stones in Oblivion, where, just once, you use them to add an effect to an item or weapon.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Conner   USA  (381 posts)  Bio
Date Reply #13 on Sun 05 Aug 2007 04:15 AM (UTC)
Message
Right off-hand, I can't think of any way in stock smaug to make an item cast a spell once only, though I suppose in smaug (fuss) 1.8 you could maybe use the mptags to accomplish it. *shrug*

-=Conner=-
--
Come test your mettle in the Land of Legends at telnet://tcdbbs.zapto.org:4000
or, for a little family oriented medieval fun, come join us at The Castle's Dungeon BBS at telnet://tcdbbs.zapto.org
or, if you just want information about either, check our web page at http://tcdbbs.zapto.org
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #14 on Sun 05 Aug 2007 08:26 AM (UTC)
Message
Well, you might have to add some code to make it work, that's not much of a problem, it should be easy enough to just dispose of the object as soon as it's been consumed.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
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.


48,732 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.