LlSetTimerEvent/ko
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
설명
함수: llSetTimerEvent( float sec );주의
- timer가 일어나는 사이의 시간 간격이 지정한 만큼 보다 더 늘어날 수 있는데, 그 때의 가능한 원인은 다음과 같다:
- 시간 지연 - 더 많은 정보는 llGetRegionTimeDilation를 참고.
- 사건 지연 기본값 - 일정한 수의 event들만이 매 초마다 수행될 수 있다.
- 실행 자체가 느린 경우 - 작성된 event의 (알고리즘 등의 이유로) 실행이 느린 경우.
- timer 사건은 상태(state)의 변화와 관계없이 지속되며 스크립트가 초기화 될 때 사라진다.
예제
<lsl>float gap = 2.0; integer counter = 0;
default {
state_entry() { // Activate the timer listener every 2 seconds llSetTimerEvent(gap); llResetTime(); }
touch_start(integer total_number) { llSay(0, "The timer stops."); llSetTimerEvent(0); counter = 0; }
timer() { ++counter; llSay(0, (string)counter+" ticks have passed in " + (string)llGetTime() + " script seconds.\nEstimated elapsed time: " + (string)(counter * gap)); }
}</lsl>
함께 보기
이 글이 유용하지 않으세요? LSL Wiki의 관련항목이 도움을 줄 수 있을 지도 모릅니다.