[Ohrrpgce] thinking out loud about magic variables in hamsterspeak

Adam Perry arperry at gmail.com
Fri Jan 9 22:06:49 PST 2009


On Fri, Jan 9, 2009 at 9:38 PM, <dan155424 at msn.com> wrote:

>  > Date: Fri, 9 Jan 2009 16:11:05 -0800
> > From: Bob at HamsterRepublic.com
> > To: ohrrpgce at lists.motherhamster.org
> > Subject: [Ohrrpgce] thinking out loud about magic variables in
> hamsterspeak
> >
> > So in python you can do something pretty cool where you set up get/set
> > functions for a property name, and then you can read and write to it as
> > if it was a variable, buty all your reads and writes go through the
> > get/set functions
> >
> > Why couldn't we do something kinda like this in HamsterSpeak?
> >
> > Suppose we create a new class of variables. To distinguish them from
> > global and local variables, I'm going to call them "magic variables"
> >
> > So maybe you create one with a command like this:
> >
> > magic variable(v, get v, set v)
> >
> > where v is the name of the new magic variable, "get v" is a script that
> > returns something, and "set v" is a script that takes 1 argument. See
> > how that could be cool?
> >
> > magic variable(money, party money, set money)
> >
> > Then you could set money by saying:
> >
> > money := 100
> >
> > Or retieve money by saying:
> >
> > show value(money)
> >
> > Now what would make this even cooler is if arguments could be added.
> > Maybe something like:
> >
> > magic variable(spell, 3, read spell, write spell)
> >
> > So you could specify 3 arguments to the "spell" magic variable,
> > something like this:
> >
> > spell(who, 0, 0) := atk:Punch
> >
> > or
> >
> > get attack name(0, spell(who, 0, 0))
> >
> > The above two examples operating on the first spell in the first spell
> > list of the hero specified in the "who" variable.
> >
> > Anyway, I just wanted to share that idea while I had it, in case anyone
> > has any comments on whether or not it seems like a good idea, how how it
> > might be done better.
> >
> > ---
> > James Paige
> > _______________________________________________
> > Ohrrpgce mailing list
> > ohrrpgce at lists.motherhamster.org
> > http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
>
> That's an awesome idea.  That'd make it easier to set values for such
> variables without having to remember the function names to do so with.
>

Make it able to do hero stats/enemy stats and I will love it forever

-- 
"Today is victory over yourself of yesterday; tomorrow is victory over
lesser men" -Miyamoto Musashi.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20090109/7e696a34/attachment-0002.htm>


More information about the Ohrrpgce mailing list