[vworld-tech] Verb/action handling
Brian Hook
hook_l at pyrogon.com
Mon Feb 2 18:19:21 PST 2004
Just to elaborate some more, I'm pretty confident that I'm doing is
the norm for this type of game (including IF games).
Everything in game is derived from a Game Object ('Gob'). Since it's
Lua, it's not really derived, it's using Lua's wacky metatable system,
but that's another topic.
Anyway...actions are resolved in three phases: before, during and
after. The flow chart now looks like:
get input
normalize input
determine verb,actor,target,other_object
Find "do_verb" for "target".
Call target:do_verb( actor, other_object )
The "do_verb" then checks surrounding objects to see if they want to
veto:
for all objects
if o.before_verb( ... ) == false then
return
end
end
-- Do the real work here
for all objects
o.after_verb( ... )
And that's pretty much it. Lots of subtleties still need to be
resolved, but as a beginning framework it suffices. Since I have time
on my hands, I'll try to hunt down that paper that Bruce was
recommending. Happy Bruce? =)
Brian
More information about the vworld-tech
mailing list