CheySecondLife

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, June 19, 2013

Full Erupt Mode: Part IV. The Hard Part

Posted on 3:08 PM by Unknown
Scripting is a bitch!

I mean ONE little typo and...

The scripts I write aren't full of the estoteric database calls the whizbang kids use, but they're complex. My scripts create sounds, particles, and movement, and only when they're supposed to. Before, every prim that needed to act required its own simple script. Since Linden Lab introduced the llSetLinkPrimitiveParams and llSetLinkPrimitivePramsFast commands, I'm using one script per linkset-- and it has to talk to its child prims and to other linksets as well.

It's complicated to, say, script a broom that grabs itself and sweeps the floor or a rocket that blasts you into the stratosphere or a giant electromagnet that grabs a robot, moves 80 meters, and drops that robot into a bin, then moves back to its original position, ready to do it all again.

I do use listens when linksets are far from one another, as in the electromagnet, which is is a couple of dozen meters from its controller. I used quite a few-- twenty, maybe-- at the robot sanatorium, but then it's one of the most highly interactive places in Second Life. I used, I think, four for controlling the volcano Pele.

Pele has four modes-- extinct, inactive, active, and erupt. The rocks and lava have a distinct texture for each mode. The lava is solid when the volcano is inactive or extinct, and phantom when she's active and erupting. Pele creates hissing and rumbling sounds when active (and a huge roar when she's erupting); inactive and extinct modes are silent, with no particles. Active calls little puffs of light gray smoke, and erupt mode makes huge clouds of black smoke.

Above the caldera, five tiki masks hold stones in their mouths, letting onlookers know their function. Touch the tiki, and you change the mode. The mode remains set for three minutes, then Pele becomes active again. I like her best in active mode.

The fifth mask makes Pele throw huge smoking, steaming boulders dozens of meters into the air. It functions only when Pele is in active or erupt modes. The launchers, phantom and invisible, are inside the lava pool and the rocks can't escape when the lava is solid. That's why the rock launcher is turned off in active and erupt modes.

Touching a mask makes a number of things happen. First, the lava in the caldera is set accordingly, and smoke and sound turned on or off, as appropriate. Texture animation is switched on or off. Liquid lava moves; solid lava doesn't. The rocks lining the volcano also change texture-- and as of the other night, the lava flow that falls 60 meters to sea level changes mode accordingly

Scripting all this required a lot of attention to detail, and it was complex, but not all that complicated. By that I mean a lot is going on, but I'm really changing only a few characteristics of the prims-- color, texture, texture movement, transparency, brightness and glow, and switching sound and particles on and off.

When a mask is touched, it chats a command word. A script in a sixth tiki mask hears it and relays the command the three linksets that change the rocks and lava. Then it sets its timer to zero. If it hasn't heard another command by the time the timer reaches 180 seconds, it sets the lava to active mode. Three linksets-- the lava in the caldera, the rocks in the caldera, and the prims in the lava flow, listen and change the prims when they hear the command to change mode.

In Pele's initial erupt mode on Whimsy, I didn't include the relay. Poor Pele grew confused when masks were repeatedly touched. Each mask did its own counting, so if a visitor selected inactive and then, 160 seconds later, extinct, Pele would go active just 20 seconds later. Now the modes last the full three minutes, unless another mask is touched, in which case the mode will change immediately and the newly selected mode will last for three minutes.

I'm happy to say the scripting is all done-- it took perhaps four hours, but then the already existing erupt mode provided much of the code. Barring weirdness like solid rock moving or liquid rock not moving, smoke where there shouldn't be smoke, and silence where there should be sound, Pele has a new and improved erupt mode.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Life 2.0... Finally
    Sweetie and I have been wanting to see Jason Springarn-Koff's 2009 Second Life-based documentary Life 2.0 since forever. Tonight we fou...
  • Glitch and Happenstance: Part II: Problems with Rendering
    Written 25 January, 2011 Glitch and Happenstance Part II: Problems with Rendering Full frontal Sweetie Sweetie arrives at Mouse World in a B...
  • Glitch and Happenstance: Part I: Capturing the Moment
    Written 25 January, 2011 Glitch and Happenstance Part I: Capturing the Moment Here's a collection of photos I've taken over the year...
  • Whimsy Kaboom View
  • Off On a Secret Mission
    Written 15 October, 2010 Off On a Secret Mission I fly out of Atlanta tomorrow on a secret mission (visiting friends, spending a month with ...
  • My This-Is-Not-A-Fashion-Blog Parade of Styles from the 2013 Hair Fair Will Shortly Commence
    The title says it all.
  • Eyelash Shirt
    This was clever.
  • Because Vampire Horses Are Just a Fact of Second Life
  • Chey's Hair Base
    Written 21 November, 2010 Chey's Hair Base I have a long head which is not attractive when I'm not wearing prim hair. Of course, I a...
  • Changing the Mandelbrot Set
    Mac Kanashimi was kind enough to rez several of his fractal sets for me. All span the sim, and all use sim's allotment of prims. You can...

Categories

  • Marnix (1)
  • Second Life (1)

Blog Archive

  • ▼  2013 (74)
    • ►  September (2)
    • ►  August (6)
    • ►  July (7)
    • ▼  June (15)
      • YOU ARE CORDIALLY INVITED to Sweetie's Gala Sevent...
      • Zoom In (and Out!) With Your Second Life Camera!
      • Now You See 'Em, Now You Ah, Kinda Don't See 'Em
      • It's a GOOD Life
      • Farewell, SLB10
      • Meanwhile, Back at the Volcano...
      • Breaking News! Dwarfins Turn to Stone!
      • Full Erupt Mode: Part IV. The Hard Part
      • Full Erupt Mode: Part III. The Volcano Goddess Mov...
      • Full Erupt Mode!: Part II. Whimsy Arrives
      • Full Erupt Mode!: Part I. Pele at Forsaken
      • My Movie Poster
      • I Don't Socialize Much
      • Another Photo from Sweetie's Discerning Eye
      • What's the Story Today?
    • ►  May (7)
    • ►  April (4)
    • ►  March (25)
    • ►  February (3)
    • ►  January (5)
  • ►  2012 (101)
    • ►  December (3)
    • ►  November (14)
    • ►  October (23)
    • ►  September (10)
    • ►  August (17)
    • ►  July (2)
    • ►  June (3)
    • ►  May (7)
    • ►  March (9)
    • ►  February (7)
    • ►  January (6)
  • ►  2011 (198)
    • ►  December (20)
    • ►  November (15)
    • ►  October (9)
    • ►  September (31)
    • ►  August (12)
    • ►  July (15)
    • ►  June (9)
    • ►  May (12)
    • ►  April (20)
    • ►  March (15)
    • ►  February (17)
    • ►  January (23)
  • ►  2010 (127)
    • ►  December (26)
    • ►  November (20)
    • ►  October (50)
    • ►  September (18)
    • ►  August (13)
Powered by Blogger.

About Me

Unknown
View my complete profile