Difference between revisions of "Sim Map Particle Projector"

From Second Life Wiki
Jump to navigation Jump to search
Line 37: Line 37:
default {
default {
state_entry() {
state_entry() {
httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llGetRegionName(),[], "");
httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + key httpRequestId;
float mapSize = 3.0;
float mapHeight = 3.0;
string mapTexture;
string URL = "http://www.subnova.com/secondlife/api/map.php";
 
mapParticle()
{
llParticleSystem([
PSYS_PART_FLAGS, 0,
PSYS_SRC_PATTERN, 4,
PSYS_PART_START_ALPHA, 0.50,
PSYS_PART_END_ALPHA, 0.50,
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.00>,
PSYS_PART_END_SCALE, <mapSize,mapSize,0.00>,
PSYS_PART_MAX_AGE, 1.20,
PSYS_SRC_MAX_AGE, 0.00,
PSYS_SRC_ACCEL, <0.0,0.0,0.0>,
PSYS_SRC_ANGLE_BEGIN, 0.00,
PSYS_SRC_ANGLE_END, 0.00,
PSYS_SRC_BURST_PART_COUNT, 8,
PSYS_SRC_BURST_RADIUS, mapHeight,
PSYS_SRC_BURST_RATE, 0.10,
PSYS_SRC_BURST_SPEED_MIN, 0.00,
PSYS_SRC_BURST_SPEED_MAX, 0.00,
PSYS_SRC_OMEGA, <0.00,0.00,0.00>,
PSYS_SRC_TEXTURE, mapTexture]);
}
 
default {
state_entry() {
httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" +      llEscapeURL(llGetRegionName())),[], "");
}
http_response(key request_id, integer status, list metadata, string body) {
if (request_id == httpRequestId) {
mapTexture = body;
mapParticle();
}
}
}
llGetRegionName(),[], "");
}
}
http_response(key request_id, integer status, list metadata, string body) {
http_response(key request_id, integer status, list metadata, string body) {

Revision as of 18:03, 20 November 2008

Fun little script. Drop it in a prim to see how it works. Demonstrates how to work with the map api.

<lsl> key httpRequestId; float mapSize = 3.0; float mapHeight = 3.0; string mapTexture; string URL = "http://www.subnova.com/secondlife/api/map.php";

mapParticle() { llParticleSystem([ PSYS_PART_FLAGS, 0, PSYS_SRC_PATTERN, 4, PSYS_PART_START_ALPHA, 0.50, PSYS_PART_END_ALPHA, 0.50, 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.00>, PSYS_PART_END_SCALE, <mapSize,mapSize,0.00>, PSYS_PART_MAX_AGE, 1.20, PSYS_SRC_MAX_AGE, 0.00, PSYS_SRC_ACCEL, <0.0,0.0,0.0>, PSYS_SRC_ANGLE_BEGIN, 0.00, PSYS_SRC_ANGLE_END, 0.00, PSYS_SRC_BURST_PART_COUNT, 8, PSYS_SRC_BURST_RADIUS, mapHeight, PSYS_SRC_BURST_RATE, 0.10, PSYS_SRC_BURST_SPEED_MIN, 0.00, PSYS_SRC_BURST_SPEED_MAX, 0.00, PSYS_SRC_OMEGA, <0.00,0.00,0.00>, PSYS_SRC_TEXTURE, mapTexture]); }

default { state_entry() { httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + key httpRequestId; float mapSize = 3.0; float mapHeight = 3.0; string mapTexture; string URL = "http://www.subnova.com/secondlife/api/map.php";

mapParticle() { llParticleSystem([ PSYS_PART_FLAGS, 0, PSYS_SRC_PATTERN, 4, PSYS_PART_START_ALPHA, 0.50, PSYS_PART_END_ALPHA, 0.50, 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.00>, PSYS_PART_END_SCALE, <mapSize,mapSize,0.00>, PSYS_PART_MAX_AGE, 1.20, PSYS_SRC_MAX_AGE, 0.00, PSYS_SRC_ACCEL, <0.0,0.0,0.0>, PSYS_SRC_ANGLE_BEGIN, 0.00, PSYS_SRC_ANGLE_END, 0.00, PSYS_SRC_BURST_PART_COUNT, 8, PSYS_SRC_BURST_RADIUS, mapHeight, PSYS_SRC_BURST_RATE, 0.10, PSYS_SRC_BURST_SPEED_MIN, 0.00, PSYS_SRC_BURST_SPEED_MAX, 0.00, PSYS_SRC_OMEGA, <0.00,0.00,0.00>, PSYS_SRC_TEXTURE, mapTexture]); }

default { state_entry() { httpRequestId = llHTTPRequest(URL + "?" + "sim" + "=" + llEscapeURL(llGetRegionName())),[], ""); } http_response(key request_id, integer status, list metadata, string body) { if (request_id == httpRequestId) { mapTexture = body; mapParticle(); } } } llGetRegionName(),[], ""); } http_response(key request_id, integer status, list metadata, string body) { if (request_id == httpRequestId) { mapTexture = body; mapParticle(); } } } </lsl>