Difference between revisions of "Sim Map Particle Projector"
Jump to navigation
Jump to search
(Replaced <source> with <syntaxhighlight>; added deprecation warning) |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{LSL Header}} | {{LSL Header}} | ||
*[[User:Jesse_Barnett|Click Here]] To see my page and more of my scripts | |||
{{Warning|Subnova's Map API does not work any longer, so don't rely on this script!}} | |||
Fun little script. Drop it in a prim to see how it works. Demonstrates how to work with the map api. | Fun little script. Drop it in a prim to see how it works. Demonstrates how to work with the map api. | ||
< | <syntaxhighlight lang="lsl2">string URL = "http://www.subnova.com/secondlife/api/map.php?sim="; | ||
key httpRequestId; | key httpRequestId; | ||
float mapSize = 3.0; | float mapSize = 3.0; | ||
mapParticle(key mapTexture) | |||
mapParticle() | |||
{ | { | ||
llParticleSystem([PSYS_PART_FLAGS, 0, | |||
PSYS_SRC_PATTERN, 4, | |||
PSYS_PART_START_ALPHA, 0.5, | |||
PSYS_PART_END_ALPHA, 0.5, | |||
PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>, | |||
PSYS_PART_END_COLOR, <1.0, 1.0, 1.0>, | |||
PSYS_PART_START_SCALE, <mapSize, mapSize, 0.0>, | |||
PSYS_PART_END_SCALE, <mapSize, mapSize, 0.0>, | |||
PSYS_PART_MAX_AGE, 1.2, | |||
PSYS_SRC_MAX_AGE, 0.0, | |||
PSYS_SRC_ACCEL, <0.0, 0.0, 0.0>, | |||
PSYS_SRC_ANGLE_BEGIN, 0.0, | |||
PSYS_SRC_ANGLE_END, 0.0, | |||
PSYS_SRC_BURST_PART_COUNT, 8, | |||
PSYS_SRC_BURST_RADIUS, mapSize, | |||
PSYS_SRC_BURST_RATE, 0.1, | |||
PSYS_SRC_BURST_SPEED_MIN, 0.0, | |||
PSYS_SRC_BURST_SPEED_MAX, 0.0, | |||
PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>, | |||
PSYS_SRC_TEXTURE, mapTexture]); | |||
} | } | ||
default { | default | ||
{ | |||
on_rez(integer param) | |||
{ | |||
llResetScript(); | |||
} | |||
state_entry() | |||
{ | |||
httpRequestId = llHTTPRequest(URL + llEscapeURL(llGetRegionName()), [], ""); | |||
} | |||
} | http_response(key request_id, integer status, list metadata, string body) | ||
</ | { | ||
if((request_id == httpRequestId) && (status == 200)) | |||
mapParticle(body); | |||
} | |||
}</syntaxhighlight> | |||
{{LSLC|Library|Sim Map Particle Projector}} | {{LSLC|Library|Sim Map Particle Projector}} | ||
[[Category:LSL Deprecated]] |
Latest revision as of 17:37, 28 January 2023
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
- Click Here To see my page and more of my scripts
Warning!
Subnova's Map API does not work any longer, so don't rely on this script!
Fun little script. Drop it in a prim to see how it works. Demonstrates how to work with the map api.
string URL = "http://www.subnova.com/secondlife/api/map.php?sim=";
key httpRequestId;
float mapSize = 3.0;
mapParticle(key mapTexture)
{
llParticleSystem([PSYS_PART_FLAGS, 0,
PSYS_SRC_PATTERN, 4,
PSYS_PART_START_ALPHA, 0.5,
PSYS_PART_END_ALPHA, 0.5,
PSYS_PART_START_COLOR, <1.0, 1.0, 1.0>,
PSYS_PART_END_COLOR, <1.0, 1.0, 1.0>,
PSYS_PART_START_SCALE, <mapSize, mapSize, 0.0>,
PSYS_PART_END_SCALE, <mapSize, mapSize, 0.0>,
PSYS_PART_MAX_AGE, 1.2,
PSYS_SRC_MAX_AGE, 0.0,
PSYS_SRC_ACCEL, <0.0, 0.0, 0.0>,
PSYS_SRC_ANGLE_BEGIN, 0.0,
PSYS_SRC_ANGLE_END, 0.0,
PSYS_SRC_BURST_PART_COUNT, 8,
PSYS_SRC_BURST_RADIUS, mapSize,
PSYS_SRC_BURST_RATE, 0.1,
PSYS_SRC_BURST_SPEED_MIN, 0.0,
PSYS_SRC_BURST_SPEED_MAX, 0.0,
PSYS_SRC_OMEGA, <0.0, 0.0, 0.0>,
PSYS_SRC_TEXTURE, mapTexture]);
}
default
{
on_rez(integer param)
{
llResetScript();
}
state_entry()
{
httpRequestId = llHTTPRequest(URL + llEscapeURL(llGetRegionName()), [], "");
}
http_response(key request_id, integer status, list metadata, string body)
{
if((request_id == httpRequestId) && (status == 200))
mapParticle(body);
}
}