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