Jump to content

Activating two scripts at the same time


kentreborn
 Share

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

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

Recommended Posts

I have a feeling that I might not be able to achieve what I want with what I am currently working with, but this is the place to ask.

I want to have a set up where if an av touches a prim, two scripts activates. The first to tp the av into the correct position and the second to rez a cage around them. Both scripts work perfectly in individual prims. However if I place both scripts into the same prim only the tp script activates. I have tried to put them both into individual prims and place one prim inside the other (not in the first prims contents inventory, physically inside) and to link them, no matter which prim is the child prim it still will not work.

I have a feeling that maybe code needs to be added to the first script (tp script) to activate the second, but unfortunately the tp script is not modify. Is there some way to achieve my goal, or is it possible to buy a script that will activate the other two.

Thanks

  • Like 1
Link to comment
Share on other sites

Hi kentreborn,

I don't know enough about the two scripts to do more than guess. If each script is touch activated, they should both work when in the same linkset. But, if the scripts try to message each other, that will not work. Scripts in different linksets generally communicate with each other via llSay() in one script sending messages to a listen() handler in another. Scripts cannot send messages to the linkset they are in. If the tp script is sending messages, the cage rezzer won't hear them once they're in the same linkset. The tp script would have to use the llMessageLinked(), which sends messages within a linkset to other scripts using link_message() handlers.

If you can post the cage-rezzer script, we might make better guesses.

Link to comment
Share on other sites

a issue is how to know when the person teleported is on the target location

a way this can be done is:

when the person touches a teleport is offered. The person can ignore this offer. Is a fundamental safety precaution of SL this. Immediate events like these can be ignored/declined (except for Experiences but we dont have them yet)

assume tho that they do accept the teleport

when they land on the target location detect this by placing a prim at the target location. In the target prim have a script that detects collision

on collison then the target prim rezzes the cage

+

a more enhanced (and safe) method is that when the person touches then llRegionSayTo the touchers key to the target prim. This way can know to only rez the cager round the toucher. Like you dont want to cage some other person who might be standing on the location at the time of the touch, and/or collision

a even more enhanced method is to rez the target prim (and move it to target location) from the touch prim when touched. However there are timing/lag issues with this approach. The target prim may not get there before the avatar. The avatar may move off the target location before the cage rezzes, etc.

 

eta: sayto

Link to comment
Share on other sites

Thank you both for your replies, they have both given me food for thought.


With reference to the tp having to be accepted first, The script I am using initiates the transport immediately upon clicking on the prim, there is no request for agreement on behalf of the one clicking on the prim?

Link to comment
Share on other sites

Okay, so it's clearly not a "real" teleport in the sense of llTeleportAgent() and that's fine. It's probably a simple sittarget teleport or something, but anyway, it's apparently working, so the question is what's preventing the cage-rezzer script from behaving as expected. Is there some reason we aren't looking at that code, as Maddy asked?

I have to say, the end objective here is not difficult to script from scratch, so I wouldn't advise spending too much effort on getting these two old scripts to work together when replacing them both with one simple new one may be less work.

[FWIW, my wild guess at this point is that the cage-rezzer is trying to rez beyond the 10m maximum radius for rezzing, perhaps trying to rez at a too-remote location to which the toucher has been teleported. I'm not sure why that should consistently be the case, however, so that hunch may be wrong. Anyway, the first thing I'd do to diagnose the problem would be to report the location where the rezzer is trying to rez.]

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3300 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...