Jump to content

Need help scripting a portal gun


RoamingPandaz
 Share

You are about to reply to a thread that has been inactive for 3457 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Alright--so I'm pretyt new to scripting on second life. I don't need a fully functional portal gun--all i need right now is for the gun to fire a physical portal and once it hits an object for the physical portal to have a script that summons a static portal right where it is and then perform the llDie task. I'm having issues figuring out what trigger to use--as in, collision start or land collision start. 

In the physical portal's contents I have a static portal for summoning, just an fyi.. so yeah. 
I have it right now so i can shoot the portal gun and it does fire the portal its just the portal itself that's not functioning the way I need it to.

Link to comment
Share on other sites

Yeah--But my issue is like, actually writing the script for that. 
Like, I've tried a bunch of different collision- triggers but none actually make anything happen, so i need help figuring out what trigger would actually activate the spawning of the static portal and the death of the physical one D:

Link to comment
Share on other sites

I think you would have to post the script, either here or on some other sharing website, in order for anyone to figure out what's going on. There's a place where you can post code for collaboration. I can't remember what it's called at the moment. In the mean time, not knowing your experience or what you have read so far, I will point you here: http://wiki.secondlife.com/wiki/Category:LSL_Collision , and hope for the best.

Link to comment
Share on other sites

Maybe if I understood your terms better, I could help.  I'm trying to get my head around the concept of a "portal gun" and how it might shoot a portal of any kind.  Then, it sounds like you want it to rez two objects that are your portals, one physical and one "static" (do you mean non-physical?).  I'm not sure whether I understand even that much, much less what you expect these portals to do.  As Ivanova suggests, it might be easier to figure out if you showed us a portion of the script where this action is taking place.

Link to comment
Share on other sites

Thanks to Sirch DeSantis, who pointed me to http://nwn.blogs.com/nwn/2012/05/working-portal-gun-in-second-life.html , where there is some brief explanation of what a portal gun can be.  If I am understanding correctly, the "physical" portal is the one that is fired by your gun and the "static" portal is the distant one that you hope to pop out of.

If that's the case, I would suggest making your physical portal temp_on_rez so that it vanishes by itself after a short while.  That's slightly easier (and maybe more reliable) than starting a timer when you collide with it and then calling llDie from the timer, which is also possible.  For dramatic effect, I think I'd rez both portals at once and at the same spot, leaving the "static" portal 100% alpha.  Then use llSetRegionPos to move the static portal to wherever you want to pop out of.  When you collide with the "physical" portal, send a signal to the static portal that makes it opaque (maybe adding a particle effect for excitement),  Delay your teleport by a second or so, and then pop through.

Use a simple collision_start event to trigger the TP, alpha, and particle effects, and use llTeleportAgent for the TP itself. That function will only work for the owner, of course, so your portal gun will be an owner-only product -- at least until LL makes Experience tools more readily available in SL.

Link to comment
Share on other sites

there is a gun script which fires the physical portal. You got that part

there is a static portal in contents of the physical portal. You got that part

need a script inside the physical portal which will rez the static portal when the physical portal strikes a target. yes?

example:

 

...collision_start(integer num_detected){    // name of the static portal in contents    string nam = "mystaticportal";    // position where collision occured    vector pos = llGetPos();    // intended velocity of static portal (0 none)    vector vel = ZERO_VECTOR;    // rotation of physical portal at time of collision    rotation rot = llGetRot();       // rez (spawn) static portal at pos and rot    llRezObject(nam, pos, vel, rot, 0);    // die self (the physical portal)    llDie();}...

 

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3457 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...