[Ohrrpgce] thinking out loud about magic variables in hamsterspeak

dan155424 at msn.com dan155424 at msn.com
Fri Jan 9 21:38:42 PST 2009


> 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.

_________________________________________________________________
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20090110/e5ae1903/attachment-0001.htm>


More information about the Ohrrpgce mailing list