The Airtank

or how to blow yourself up

(Written by Morphy with extra help from Crissa. Thank you Crissa! Please don't hit me any more} *^^*

I've been finding out that my airtank code (glorified number juggler) is not porting well to other mucks even though it should. Another is that the code has flaws in it that cause problems. This might be because the old code was versions 2 and 3 while I use version 4. Once more I'll step you through the process of creating a size changing device. No more bugs this time-- knock on wood. *^^*

Step 1, the airtank object

You could place the inflation code on yourself but then only you (or a wizard) could activate the commands. That's not very good if you want others to be able to affect your size. So we will make an object that is dropped on the ground so all my abuse it or handed to another so only they can use it. I'll also register it with the keyword pump so I can referece that way rather than object #163074 (I never was very good at memorizing particular numbers).

@create airtank=1=pump

Now I can always reclaim my airtank with this command at any time.

@tel $pump=me

For the furs of other than FurryMuck you may want to also link the device to yourself since it's not automaticly done for you.

@link $pump=me

And a generic description you can use for the device.

@desc $pump=An odd device, consisting of several knobs named {commas:{parse:exit,{exits:this},{subst:{fullname:{&exit}},;,\r}},,\, and,} hooked up to a tank and somehow linked to {name:{owner:this}}.

And some more settings for non-FurryMuck furs.

@succ $pump=You pick up {name:{owner:this}}'s pump.
@osucc $pump=picks up {name:{owner:this}}'s pump.
@drop $pump=You put down {name:{owner:this}}'s pump.
@odrop $pump=puts down {name:{owner:this}}'s pump.

If your muck supports it, you can now make a pet out of it or use it in other applications. See your muck's news or bulletins for details on those advanced projects.


Step 2, the action

Onto the 4th version of my code now. Again, it only uses one action to save quota. For now, I'll just install the three basic commands to the start of the metacommand which will be registered as button.

@action imor;smor;dmor=$pump=button

Since any unlinked action can be @chowned, stolen and @recycled on you. We'll link it to a do-nothing program that FurryMuck uses.

@link $button=$nothing

The next step is to set the success and failure of this action. You then have the option of building in a locking mechanisim at a later date so that only certain users my operate the airtank.

@succ $button={exec!:_msgmacs/{∓cmd},this}
@fail $button=You can't seem to work the controls on Morphy's airtank... drat!
@ofail $button=can't seem to work the controls on Morphy's airtank.


Step 3, the code (Aeiii!)

...Onto the real guts of the beast! First we need to install some functions that are used to convert or process data. This one converts a number (inches) passed to it (that :1 prop) into the verbal feet-inches string you can read. So it could take 18 and spit out 18" or take 70 and spit out 5'-10" which is a lot easier to visualize.

@set $button=_msgmacs/feetinch:{if:{le:{:1},24},{:1}",{div:{:1},12}'-{mod:{:1},12}"}

A slight explination on the integer percentage math used, "i + i * p / 100 = i" Simple, no? Because MPI can only do integer math (all decimals rounded off) we must fake it with a little algebra. To see it in action I'll assume my normal size of 70 inches and plug in a typical value of 50% increase: 70 + 70 * 50 / 100 = 105. 105 is then stored and my new size is done. This allows you to increment by as little as 1 percent but because all decimals are rounded off, only when you're huge will a 1 percent increase show at all.

Now that we have the formula ironed out, here it is in MPI-- I use the absolute to prevent someone from try to increase by negitive values which would have odd results.

{store:{add:{prop:inches,{owner:this}},{div:{mult:{abs:{∓arg}},{prop:inches,{owner:this}}},100}},inches,{owner:this}}

We still are not done however. Error checking must be added or else you would keep growing until the values cause an overflow error like on a calculator. As the value of inches passes the upper limit, it is set to the maximum...

{if:{gt:{prop:inches,{owner:this}},{prop:maxht,this}},{store:{prop:maxht,this},inches,{owner:this}}}

Once the inches are computed (or fixed by the {if}) we can figure out the human-readable height setting using that function we defined earlier.

{store:{feetinch:{prop:inches,{owner:this}}},height,{owner:this}}

To let the other furs know what's happening, we make a room-broadcasing otell. Note the use of {lit:,} to force the comma to displayed rather than evaluated and causing trouble.

{otell:{eval:inflates Morphy{lit:,} growing to {prop:height,{owner:this}}...},here,#-1}

And putting it all together with {nulls} to keep it silent and from spewing numbers as it works, it looks like this monster line. (I broke it up but it's all one long line. If your client supports cut∓paste, I'd learn how to use it)

@set $button=_msgmacs/imor:
{null:{store:{add:{prop:inches,{owner:this}},{div:{mult:{abs:{∓arg}},{prop:inches,{owner:this}}},100}},inches,{owner:this}}
{if:{gt:{prop:inches,{owner:this}},{prop:maxht,this}},{store:{prop:maxht,this},inches,{owner:this}}}
{store:{feetinch:{prop:inches,{owner:this}}},height,{owner:this}}}
{null:{otell:{eval:inflates Morphy{lit:,} growing to {prop:height,{owner:this}}...},here,#-1}}
{null:{comppink}}

Hey, what's that on the end you say? Let's just say I wouldn't be a male if I could pump that up too. I'll get to it later... So! We can pump up, but how do we deflate back down? The math is very close and you could probibly figure it out on your own so I'll just skip all that and give you the final answer. If you look close you'll see I subtract and check that the inches don't fall below a minimum limit.

@set $button=_msgmacs/dmor:
{null:{store:{subt:{prop:inches,{owner:this}},{div:{mult:{abs:{∓arg}},{prop:inches,{owner:this}}},100}},inches,{owner:this}}
{if:{lt:{prop:inches,{owner:this}},{prop:minht,this}},{store:{prop:minht,this},inches,{owner:this}}}
{store:{feetinch:{prop:inches,{owner:this}}},height,{owner:this}}}
{null:{otell:{eval:deflates Morphy{lit:,} shrinking to {prop:height,{owner:this}}...},here,#-1}}
{null:{comppink}}

This is all fine and dandy but suppose you have a size you need to be right now? You could play up and down games with imor and dmor but that's a pain in the neck. Here's a quick way to set the size in one step, instantly. Rather than do the math before the otell I just did it as I went along, inside the statement. Because there's no error checking, you can set this to any value, even negitive numbers.

@set $button=_msgmacs/smor:
{null:{otell:{eval:adjusts something. Suddenly{lit:,} Morphy is {store:{abs:{∓arg}},inches,{owner:this}}" tall [{store:{feetinch:{prop:inches,{owner:this}}},height,{owner:this}}]...},here,#-1}}
{null:{comppink}}

A few more props are needed though. The limits (in inches) for starters. Then a prop on yourself to "prime" the pump.

@set $button=maxht:12000
@set $button=minht:3
@set me=inches:70

And that's it. You have a functional size altering device. To use the values, I place {prop:height,{owner:this}} in my descriptions. Anyone looking at me then can see just how tall, or not, I am.

Let's get back to that extra function I've been sneaking in above. In the standard inflation code you change at a geometric rate, that is, if you kept inflating 100%, you'd double in size each time. This function only changes the percentage or proportion. Yes, this pink bit stays proportional with you no matter what size in inches-- so being 1 inch tall would flummux the package. The math this time is a bit more complicated because we toss in a new parameter, "( i / pmod ) * p / 100 = i". This new value, pmod, lets us change the base size of the pink balloon. For example, at 10, it's average size. If we set pmod to 9 or 8, it's larger. At 6 we have a real monster. But at 1 the pink balloon is as big as I am! See how it works? Here's the function.

@set $button=_msgmacs/comppink:
{store:{div:{mult:{div:{prop:inches,{owner:this}},{prop:pmod,{owner:this}}},{prop:pper,{owner:this}}},100},pinches,{owner:this}}
{if:{lt:{prop:pinches,{owner:this}},1},{store:1,pinches,{owner:this}}}
{store:{feetinch:{prop:pinches,{owner:this}}},psize,{owner:this}}

You'll also have to set up the pink balloon's own three inflation, deflation, and set_size commands too. (And add them, in any order, to the metacommand so you can do them)

@name $button=imor;smor;dmor;ipink;dpink;spink

@set $button=_msgmacs/ipink:
{null:{store:{add:{prop:pper,{owner:this}},{abs:{∓arg}}},pper,{owner:this}}
{if:{gt:{prop:pper,{owner:this}},{prop:maxp,this}},{store:{prop:maxp,this},pper,{owner:this}}}{comppink}}
{null:{otell:{eval:inflates Morphy's pink balloon to {prop:psize,{owner:this}} [{prop:pper,{owner:this}}%]...},here,#-1}}

@set $button=_msgmacs/dpink:
{null:{store:{subt:{prop:pper,{owner:this}},{abs:{∓arg}}},pper,{owner:this}}
{if:{lt:{prop:pper,{owner:this}},{prop:minp,this}},{store:{prop:minp,this},pper,{owner:this}}}{comppink}}
{null:{otell:{eval:deflates Morphy's pink balloon to {prop:psize,{owner:this}} [{prop:pper,{owner:this}}%]...},here,#-1}}

@set $button=_msgmacs/spink:
{null:{store:{abs:{∓arg}},pper,{owner:this}}
{if:{lt:{prop:pper,{owner:this}},{prop:minp,this}},{store:{prop:minp,this},pper,{owner:this}}}{comppink}}
{null:{otell:{eval:adjusts something. Suddenly{lit:,} Morphy's balloon is {prop:psize,{owner:this}} [{prop:pper,{owner:this}}%]...},here,#-1}}

And the limiters plus a primer value of 100 (100% or normal size) for the pink balloon.

@set $button=maxp:50000
@set $button=minp:10
@set me=pper:100
@set me=pmod:10

To use this pink balloon prop I place {prop:psize,{owner:this}} into my nude_description where applicable.


I hope this works for you, it should on any muck similar to the OS FurryMuck uses. Just remember to use your name and unique commands. The props themselves can stay the same if you want, tho.

 

Back

(Last edit: 03/11/00 08:46 )