<?xml version="1.0" encoding="utf-8"?>
<feed
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:at="http://www.sixapart.com/ns/at"
    xmlns:icbm="http://postneo.com/icbm"
    xmlns:rvw="http://purl.org/NET/RVW/0.2/"
    xml:lang="en">
    <title>startslさんのブログ</title>
    <link rel="self" type="application/atom+xml" title="startslさんのブログ (Atom)" href="http://startsl.vox.com/library/posts/page/1/atom.xml" />
    <link rel="alternate" type="text/html" title="startslさんのブログ" href="http://startsl.vox.com/library/posts/page/1/"/> 
    <link rel="service.post" type="application/atom+xml" title="startslさんのブログ" href="http://www.vox.com/services/atom/svc=post/collection_id=6a00d41426bf35685e00cd971f2dfb4cd5" /> 
    <link rel="service.subscribe" type="application/atom+xml" title="startslさんのブログ" href="http://startsl.vox.com/library/posts/atom.xml" />   
    <link rel="last" type="application/atom+xml" title="startslさんのブログ" href="http://startsl.vox.com/library/posts/page/1/atom.xml" />  
    <generator uri="http://www.vox.com/">Vox</generator>
    <updated>2007-04-27T12:11:36Z</updated> 
    <author>
        <name>startsl</name>
        <uri>http://startsl.vox.com/?_c=feed-atom-full</uri>
    </author> 
    <id>tag:vox.com,2006:6p00d41426bf35685e/</id>  
    
    <entry>
        <title>BartubeのLive</title>   
        <link rel="alternate" type="text/html" title="BartubeのLive" href="http://startsl.vox.com/library/post/bartube%E3%81%AElive.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="BartubeのLive" href="http://startsl.vox.com/library/post/bartube%E3%81%AElive.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="BartubeのLive" href="http://www.vox.com/atom/svc=post/asset_id=6a00d41426bf35685e00d41430df386a47" />          <id>tag:vox.com,2007-04-27:asset-6a00d41426bf35685e00d41430df386a47</id>
        <published>2007-04-27T12:11:36Z</published>
        <updated>2007-04-27T12:11:36Z</updated>
    
        <author>
            <name>startsl</name>
            <uri>http://startsl.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://startsl.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p><a href="http://www.stickam.jp">http://www.stickam.jp</a></p>
<p>&#160;</p>   <p style="clear:both;"> 
    <a href="http://startsl.vox.com/library/post/bartube%E3%81%AElive.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00d41426bf35685e00d41430df386a47?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    </entry> 
    
    <entry>
        <title>自動ドア（SIMにやさしい版）</title>   
        <link rel="alternate" type="text/html" title="自動ドア（SIMにやさしい版）" href="http://startsl.vox.com/library/post/%E8%87%AA%E5%8B%95%E3%83%89%E3%82%A2sim%E3%81%AB%E3%82%84%E3%81%95%E3%81%97%E3%81%84%E7%89%88.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="自動ドア（SIMにやさしい版）" href="http://startsl.vox.com/library/post/%E8%87%AA%E5%8B%95%E3%83%89%E3%82%A2sim%E3%81%AB%E3%82%84%E3%81%95%E3%81%97%E3%81%84%E7%89%88.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="自動ドア（SIMにやさしい版）" href="http://www.vox.com/atom/svc=post/asset_id=6a00d41426bf35685e00d4142dc21a3c7f" />          <id>tag:vox.com,2007-04-05:asset-6a00d41426bf35685e00d4142dc21a3c7f</id>
        <published>2007-04-05T19:04:58Z</published>
        <updated>2007-04-05T19:07:06Z</updated>
    
        <author>
            <name>startsl</name>
            <uri>http://startsl.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://startsl.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p>SIMにやさしい版をつくりました。</p>
<p><a href="http://slurl.com/secondlife/Armon%20Gill/185/117/40/">http://slurl.com/secondlife/Armon%20Gill/185/117/40/</a>　に動くものをおいてあります。</p>
<p>&#160;</p>
<p>float ibias = 2; //移動距離<br />vector vbias = &lt;0,0,0&gt;;<br />string sobject_status = &quot;close&quot;;<br />float ftiming = 5;</p>
<p>move_object()<br />{<br />&#160;&#160; vector foo = llGetLocalPos();<br />&#160;&#160; vbias.y = ibias;<br />&#160;&#160; ibias = -ibias; <br />&#160;&#160; llSetPos(foo + vbias);<br />}</p>
<p>default {<br />&#160;<br />&#160;&#160;&#160; collision_end(integer num_detected) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (llDetectedType(0) &amp; AGENT)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (sobject_status == &quot;close&quot;)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; move_object();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sobject_status = &quot;open&quot;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSetTimerEvent(ftiming);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }<br />&#160; <br />&#160;&#160;&#160; timer()<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; if ( sobject_status == &quot;open&quot;)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llOwnerSay(sobject_status);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llOwnerSay(&quot;timer&quot;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; move_object();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sobject_status = &quot;close&quot;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; llOwnerSay(sobject_status);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSetTimerEvent(0);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; }<br />}<br /></p>   <p style="clear:both;"> 
    <a href="http://startsl.vox.com/library/post/%E8%87%AA%E5%8B%95%E3%83%89%E3%82%A2sim%E3%81%AB%E3%82%84%E3%81%95%E3%81%97%E3%81%84%E7%89%88.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00d41426bf35685e00d4142dc21a3c7f?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="secondlife" scheme="http://startsl.vox.com/tags/secondlife/" label="secondlife" /> 
    </entry> 
    
    <entry>
        <title>自動ドアを作るLS(練習版）</title>   
        <link rel="alternate" type="text/html" title="自動ドアを作るLS(練習版）" href="http://startsl.vox.com/library/post/%E8%87%AA%E5%8B%95%E3%83%89%E3%82%A2%E3%82%92%E4%BD%9C%E3%82%8Bls.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="自動ドアを作るLS(練習版）" href="http://startsl.vox.com/library/post/%E8%87%AA%E5%8B%95%E3%83%89%E3%82%A2%E3%82%92%E4%BD%9C%E3%82%8Bls.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="自動ドアを作るLS(練習版）" href="http://www.vox.com/atom/svc=post/asset_id=6a00d41426bf35685e00d09e61782bbe2b" />          <id>tag:vox.com,2007-04-05:asset-6a00d41426bf35685e00d09e61782bbe2b</id>
        <published>2007-04-05T10:54:56Z</published>
        <updated>2007-04-05T18:59:29Z</updated>
    
        <author>
            <name>startsl</name>
            <uri>http://startsl.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://startsl.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p>自動ドアをLSLで作るには、まず自動ドアの仕様（？）を決めなければなりません。</p>
<p>今回はこんな仕様でいきます。</p>
<p>１．自動ドアオブジェクトの前に誰かが立つと</p>
<p>２．自動ドアオブジェクトが移動して</p>
<p>３．一定時間が経つと元に戻る</p>
<p>*作り方</p>
<p>まずオブジェクトが、人がいることを判断しないといけません。それにはllsensorを使います。</p>
<p>llsensorとはある範囲内に何かがあることをチェックするためのものです。流れとしては下記のとおり。</p>
<p>１．オブジェクトが起動したときに呼ばれるdefaultでチェックルーチンを呼ぶ。</p>
<p>２．llsensorでチェックする対象や範囲を指定しておく。</p>
<p>３．その範囲に対象が入ってくるとsensorハンドラが呼ばれるので、そこに処理を書く。</p>
<p><br />=５ｍ以内にアバターがいると、その名前を表示して終了するサンプルプログラム</p>
<p>default<br />{<br />&#160;state_entry(){<br />&#160;&#160;llSay(DEBUG_CHANNEL,&quot;check start!&quot;);<br />&#160;&#160;llSensor(&quot;&quot;,&quot;&quot;,AGENT,5.0,PI); // どんな名前のアバターでもいいので半径５ｍの球に入った場合。<br />&#160;}</p>
<p>// Sensor handler<br />&#160;sensor(integer total_number)<br />&#160;{<br />&#160;&#160;llSay(DEBUG_CHANNEL, (string)total_number + &quot; avatars in 5m around&quot; );<br />&#160;}<br />}</p>
<p>llSensorの詳しい説明はこちら。<br /><a href="http://rpgstats.com/wiki/index.php?title=LlSensor">http://rpgstats.com/wiki/index.php?title=LlSensor</a></p>
<p>これをオブジェクトに張っておくと、誰かがそのオブジェクトの５ｍ以内に近づくと、５ｍ以内にいる人数を表示します。</p>
<p>TIP!!<br />llSay(DEBUG_CHANNEL,&quot;check start!&quot;);<br />のように書いておくとデバックチャンネルだけで表示されるのでテストに便利です。<br />-----------------------------------------------------------</p>
<p>次はオブジェクトを移動してみます。テストのため触るとX軸の方向に３ｍ右移動し、もう一度触ると元に戻るようにしてみます。<br />移動するにはllSetPosを、今の位置を得るにはllGetLocalPos()を使います。</p>
<p>流れは以下になります。</p>
<p>１．オブジェクトを触ると<br />２．今の位置を保存します<br />３．どちらに移動するかをチェックし<br />３．３ｍ移動させます。</p>
<p>=触ると３ｍ移動し、もう一度触ると元の位置に戻るサンプルプログラム</p>
<p>float ibias = 3;<br />vector vbias = &lt;0,0,0&gt;;</p>
<p>default<br />{<br />&#160;touch(integer total_number)<br />&#160;{&#160;//触ったら<br />&#160;&#160;vector foo = llGetLocalPos();　//今の場所<br />&#160;&#160;vbias.x = ibias;&#160;// 移動方向<br />&#160;&#160;ibias = -ibias;&#160; &#160;//元に戻すための処理<br />&#160;&#160;llSetPos(foo + vbias);&#160;//移動<br />&#160;}<br />}</p>
<p>llSetPosの詳しい説明はこちら。<br /><a href="http://wiki.secondlife.com/wiki/LlSetPos">http://wiki.secondlife.com/wiki/LlSetPos</a></p>
<p>-----------------------------------------------------------<br />最後に３秒経過すると何かのアクションをするスクリプトです。これにはllSetTimerEventを使います。<br />llSetTimerEvent(秒数）と指定しておくと、その秒数毎にtimer()という関数が呼ばれます。</p>
<p>=一度触ると５秒おきに&quot;5 seconds counted.&quot;と表示し、もう一度触ると止まるサンプルプログラム</p>
<p>float ftiming = 5;</p>
<p>default<br />{<br />&#160;<br />&#160;touch(integer total_number)<br />&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSetTimerEvent(timing);<br />&#160;&#160;if ( ftiming &gt; 0 )<br />&#160;&#160;{<br />&#160;&#160;&#160;ftiming = 0;<br />&#160;&#160;} else {<br />&#160;&#160;&#160;ftiming = 5;<br />&#160;&#160;}<br />&#160;}</p>
<p>&#160;timer()<br />&#160;&#160;&#160; &#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; llOwnerSay(&quot;5 seconds counted.&quot;);<br />&#160;&#160;&#160; &#160;}<br />}</p>
<p>llSetTimerEventの詳しい説明はこちら。<br /><a href="http://rpgstats.com/wiki/index.php?title=LlSetTimerEvent">http://rpgstats.com/wiki/index.php?title=LlSetTimerEvent</a></p>
<p>-----------------------------------------------------------<br />さて、これら３つを組み合わせれば自動ドアができます。誰かをはさまないようにもなっています。</p>
<p>float ibias = 3; //移動距離<br />vector vbias = &lt;0,0,0&gt;;<br />float ftiming = 3; // 閉じるまでの時間<br />string sobject_status = &quot;close&quot;;</p>
<p>default<br />{<br />&#160;state_entry(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSetTimerEvent(0);&#160; //閉じるタイマーを止めておく。<br />&#160; // どんな名前のアバターでもいいので半径５ｍの球に入った場合<br />&#160; llSensorRepeat(&quot;&quot;,&quot;&quot;,AGENT,5.0,PI,1);<br />&#160;}</p>
<p>&#160;// Sensor handler<br />&#160;sensor(integer total_number)<br />&#160;{<br />&#160; if ( sobject_status == &quot;close&quot;)<br />&#160; {<br />&#160;&#160; llSensorRepeat(&quot;&quot;,&quot;&quot;,AGENT,5.0,PI,0);<br />&#160;&#160;&#160; vector foo = llGetLocalPos();<br />&#160; vbias.x = ibias;<br />&#160; ibias = -ibias; <br />&#160; llSetPos(foo + vbias);<br />&#160;&#160; sobject_status = &quot;open&quot;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSetTimerEvent(ftiming); <br />&#160; }<br />&#160;}</p>
<p>&#160;no_sensor()<br />&#160;{<br />&#160; if ( sobject_status == &quot;open&quot;) <br />&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; llSetTimerEvent(0);&#160;</p>
<p>&#160;&#160;&#160; vector foo = llGetLocalPos();<br />&#160; vbias.x = ibias;<br />&#160; ibias = -ibias; <br />&#160; llSetPos(foo + vbias);<br />&#160;&#160;&#160;&#160; sobject_status = &quot;close&quot;;<br />&#160;&#160; llSensorRepeat(&quot;&quot;,&quot;&quot;,AGENT,5.0,PI,1);<br />&#160; }<br />&#160;}<br />&#160;<br />&#160;timer()<br />&#160;&#160;&#160;&#160; {<br />&#160; // ftimingおきにセンサーを起動し、誰かいないかをチェックする<br />&#160; llSensor(&quot;&quot;,&quot;&quot;,AGENT,5.0,PI); //センサー起動<br />&#160;&#160;&#160;&#160; }<br />}</p>
<p></p>   <p style="clear:both;"> 
    <a href="http://startsl.vox.com/library/post/%E8%87%AA%E5%8B%95%E3%83%89%E3%82%A2%E3%82%92%E4%BD%9C%E3%82%8Bls.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00d41426bf35685e00d09e61782bbe2b?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="secondlife" scheme="http://startsl.vox.com/tags/secondlife/" label="secondlife" /> 
    </entry> 
</feed>


