ID:138476
![]() Jul 22 2000, 5:28 am
|
|
Well I finally got my spell system working, and my ordering thing works now thanx to Tom. Now I'm having problems making it so you can actually cast the spells in your spellbook. Basically what a spell or ability is as of now is an obj inside a list such as magespells, priestspells, or abilities. When I try using set src in usr.magespells I get an error. My cast verb doesn't come up when I right click the spell in the spellbook. Do I need to set the src differently? I was able to cast it with the call proc, but this is cumbersome and doesn't allow me to specify targets or use my multiple ways of casting thing.
|
(If Dantom has time, I humbly and quietly request as a feature "set src" may be used with any defined reference, list, or list of references, not simply the ones given.) It'd be a nice feature, but it seems like this could also be an invitation to disaster! I could be all wrong, but here's how I *think* it works. The client has to be aware of the potential src values constantly. If you have, say, a SaveStone that creates a verb "save" with set src = view(5) so anyone nearby can save the game, that means a quick response time is needed. You don't want to walk within 5 spaces of the stone and then wait a few seconds for the verb to appear in your panel; it should be almost instantaneous. In DM, it is indeed almost instantaneous, and the reason (I assume) is because "set src" has to use a list that the client is already using (and the list might even be specially optimized for quick update across the network). Now, if you create some list that may mean a lot to the server but means nothing to the client--let's say, for example, you build a list of evil PC's who can use a take_hostage verb--then, in order to check whether a given verb should be active, the client would have to be constantly checking the server to see how the list of evil PC's is changing. In many cases this might not take up too much bandwidth, but if the list gets real long or you have a screen with 10 different objects all using custom-src verbs, then your game will update at about 5 frames per minute and your modem is going to melt in protest. Or maybe not. Like I said, this is all just my speculation. Still, it makes a kind of sense to me... (Also see Dan's message about expansion from last night. You can use this feature to get a lot of extra mileage out of verbs--though without an implementation of your suggestions for "set src", you're always going to have the opportunity for situations where someone can see a verb, but when he goes to use it, you just have to tell him "Sorry, this isn't for you." Small price to pay for snappy response time, though!) |
On 7/22/00 8:28 am DerDragon wrote:
Well I finally got my spell system working, and my ordering thing works now thanx to Tom. Now I'm having problems making it so you can actually cast the spells in your spellbook. Basically what a spell or ability is as of now is an obj inside a list such as magespells, priestspells, or abilities. When I try using set src in usr.magespells I get an error. My cast verb doesn't come up when I right click the spell in the spellbook. Do I need to set the src differently? I was able to cast it with the call proc, but this is cumbersome and doesn't allow me to specify targets or use my multiple ways of casting thing. I don't know if you are showing the spells in the panels, but if you are, you might need to do set src in world to get the verbs to show up. |
let's say, for example, you build a list of evil PC's who can use a take_hostage verb Hmm, that's not a particularly sensible example, since the list in question refers to what can provide accessibility to the verb rather than who can use the verb. Oh well... I guess I need a few hours away from the computer. :) |
mob
var
list/spells
verb
cast(spell/mySpell in usr.spells)
mySpell.Cast()
New()
. = ..()
spells = new /list()
spells += new /spell/Fireball
spells += new /spell/Light
spell
var/name
Fireball
name = "Fireball"
Light
name = "Light"
proc/Cast()
world << "[usr] just cast a [name] spell!"