BlamGate script

Creating scripts
Post Reply
User avatar
Sarge Misfit
Posts: 254
Joined: Thu Mar 14, 2013 4:10 pm
Has thanked: 5 times
Been thanked: 223 times

BlamGate script

Post by Sarge Misfit »

Okay, we need a sub-forum as a script library.

I've edited the script a little (kept the creds) and I have used it inworld already, so I know it works.
You can stop by Regio Excelsior to grab a copy of the mesh WarpGate (look for one with green hovertext).
You can use the script in any object that a person can collide with.
Here's the script itself -

Code: Select all

// XEngine

// For more info see http://becunningandfulloftricks.com/2010/10/29/the-metaphor-of-portals
// anti-loop code added by Jag Nishi/The Ham

string  ParcelName     = "to the Ancient Ruins of Al Khaznehek at\n";
string  WorldName   = "Miney's";
string  MessageLine1 = "\nLast Verified: 04/05/2012";
string  MessageLine2      = "";
string  BoilerPlate  = "\nWalk through to teleport.";
vector  LandingPoint = <128,128,23>;
vector  TextColor    = <0,1,0>;
vector  LookAt       = <0,1,0>;

key     AgentToTransfer;
list    LastFewAgents;

string  CONTROLLER_ID       = "A";
integer AUTO_START          = TRUE;
list    particle_parameters = [];
list    target_parameters   = [];

StartEffects()
{
    // llCollisionSound("Magic Chimes", 1.0);
    
    particle_parameters = [
        PSYS_SRC_TEXTURE,          llGetInventoryName(INVENTORY_TEXTURE, 0), 
        PSYS_PART_START_SCALE,     <0.10,0.10, FALSE>,
        PSYS_PART_END_SCALE,       <1.00,1.00, FALSE>, 
        PSYS_PART_START_COLOR,     <1,1,1>,
        PSYS_PART_END_COLOR,       <1,1,1>, 
        PSYS_PART_START_ALPHA,     (float)1.0,
        PSYS_PART_END_ALPHA,       (float)0.0,     
        PSYS_SRC_BURST_PART_COUNT, 500, 
        PSYS_SRC_BURST_RATE,       (float)0.01,   
        PSYS_PART_MAX_AGE,         (float)1.0, 
        PSYS_SRC_MAX_AGE,          (float)0.6,  
        PSYS_SRC_PATTERN,          2,
        PSYS_SRC_ACCEL,            <0.0,0.0,-3.0>,  
        PSYS_SRC_BURST_SPEED_MIN,  (float)1.2,
        PSYS_SRC_BURST_SPEED_MAX,  (float)5.01, 
        PSYS_SRC_ANGLE_BEGIN,      (float)0.25*PI,
        PSYS_SRC_ANGLE_END,        (float)0.00*PI,  
        PSYS_SRC_OMEGA,            <0,0,0>,       
        PSYS_PART_FLAGS, ( 0
                            | PSYS_PART_INTERP_COLOR_MASK   
                            | PSYS_PART_INTERP_SCALE_MASK   
                            | PSYS_PART_EMISSIVE_MASK   
                            | PSYS_PART_FOLLOW_VELOCITY_MASK
                            | PSYS_PART_WIND_MASK            
                         )                   
    ];
        
    if ( AUTO_START ) llParticleSystem( particle_parameters );
}

PerformTeleport( key WhomToTeleport )
{
    integer CurrentTime = llGetUnixTime();
    integer AgentIndex = llListFindList( LastFewAgents, [ WhomToTeleport ] );
    if (AgentIndex != -1)
    {
        integer PreviousTime = llList2Integer ( LastFewAgents, AgentIndex+1 );
        if (PreviousTime >= (CurrentTime -5)) return;
        LastFewAgents = llDeleteSubList( LastFewAgents, AgentIndex, AgentIndex+1);
    }
    LastFewAgents += [ WhomToTeleport, CurrentTime ];
    osTeleportAgent( WhomToTeleport, WorldName, LandingPoint, LookAt );
}

default
{   
    on_rez(integer start_param)
    {
        llResetScript(); 
    }
    
    state_entry()
    {
        //llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 0, 0, 0, 0, .05);
        llSetText(ParcelName + WorldName + BoilerPlate + MessageLine1 + MessageLine2, TextColor, 1);  
    }
    
    collision_start(integer num_detected)
    {
        StartEffects();
    
        if(llDetectedKey(0) != AgentToTransfer)
        {
            AgentToTransfer=llDetectedKey(0);
            PerformTeleport( llDetectedKey(0));
        }
        else
        {
            llSetTimerEvent(3);
        }
    }
    
    timer()
    {
        AgentToTransfer="";
        llSetTimerEvent(0);
    }
    
    touch_start(integer num_detected)
    {
        //llGiveInventory(llDetectedKey(0),llGetInventoryName(INVENTORY_NOTECARD, 0));
    }
    
    link_message( integer sibling, integer num, string mesg, key target_key )
    {
        if ( mesg != CONTROLLER_ID ) { // this MessageLine2 isn't for me.  Bail out.
            return;
        } else if ( num == 0 ) { // MessageLine2 says to turn particles OFF:
            llParticleSystem( [ ] );
        } else if ( num == 1 ) { // MessageLine2 says to turn particles ON:
            llParticleSystem( particle_parameters + target_parameters );
        } else if ( num == 2 ) { // Turn on, and remember and use the key sent us as a target:
            target_parameters = [ PSYS_SRC_TARGET_KEY, target_key ];
            llParticleSystem( particle_parameters + target_parameters );
        } else { // bad instruction number
            // do nothing.
        }            
    }
}

//// "Explosion" PARTICLE TEMPLATE v1 - by Jopsy Pendragon - 4/8/2008
//// You are free to use this script as you please, so long as you include this line:
//** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//

These users thanked the author Sarge Misfit for the post (total 2):
Constance PeregrineDot Macchi
Living life on the wrong side of a one-track mind.

National Security Threat Level: Gnat

My site: Excelsior Station
My Kitely World: Misfit's Folly
User avatar
Constance Peregrine
Posts: 2349
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1482 times

Re: BlamGate script

Post by Constance Peregrine »

the script works fine-)) i got to my own world via yours-))
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
Dot Macchi
Posts: 219
Joined: Sun Dec 23, 2012 12:15 pm
Has thanked: 75 times
Been thanked: 207 times

Re: BlamGate script

Post by Dot Macchi »

That looks a lot neater and easier to keep up to date than the one I've been using. Thanks, Sarge!
Post Reply