<br><div class="gmail_quote">On Fri, Jan 9, 2009 at 9:38 PM,  <span dir="ltr"><<a href="mailto:dan155424@msn.com">dan155424@msn.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
> Date: Fri, 9 Jan 2009 16:11:05 -0800<br>> From: Bob@HamsterRepublic.com<br>> To: <a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>> Subject: [Ohrrpgce] thinking out loud about magic variables in hamsterspeak<br>
> <br>> So in python you can do something pretty cool where you set up get/set <br>> functions for a property name, and then you can read and write to it as <br>> if it was a variable, buty all your reads and writes go through the <br>
> get/set functions<br>> <br>> Why couldn't we do something kinda like this in HamsterSpeak?<br>> <br>> Suppose we create a new class of variables. To distinguish them from <br>> global and local variables, I'm going to call them "magic variables"<br>
> <br>> So maybe you create one with a command like this:<br>> <br>>  magic variable(v, get v, set v)<br>> <br>> where v is the name of the new magic variable, "get v" is a script that <br>> returns something, and "set v" is a script that takes 1 argument. See <br>
> how that could be cool?<br>> <br>>  magic variable(money, party money, set money)<br>> <br>> Then you could set money by saying:<br>> <br>>  money := 100<br>> <br>> Or retieve money by saying:<br>
> <br>>  show value(money)<br>> <br>> Now what would make this even cooler is if arguments could be added. <br>> Maybe something like:<br>> <br>>  magic variable(spell, 3, read spell, write spell)<br>
> <br>> So you could specify 3 arguments to the "spell" magic variable, <br>> something like this:<br>> <br>>  spell(who, 0, 0) := atk:Punch<br>> <br>> or<br>> <br>>  get attack name(0, spell(who, 0, 0))<br>
> <br>> The above two examples operating on the first spell in the first spell <br>> list of the hero specified in the "who" variable.<br>> <br>> Anyway, I just wanted to share that idea while I had it, in case anyone <br>
> has any comments on whether or not it seems like a good idea, how how it <br>> might be done better.<br>> <br>> ---<br>> James Paige<br>> _______________________________________________<br>> Ohrrpgce mailing list<br>
> <a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.org</a><br>> <a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
<br><br>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.<br></div></blockquote></div><br>Make it able to do hero stats/enemy stats and I will love it forever<br clear="all">
<br>-- <br>"Today is victory over yourself of yesterday; tomorrow is victory over lesser men" -Miyamoto Musashi.<br>