Attach Event on Login

Creating scripts
Post Reply
User avatar
Aaron Griffiths
Posts: 25
Joined: Thu Aug 01, 2013 7:21 am
Location: New Zealand
Has thanked: 0
Been thanked: 8 times
Contact:

Attach Event on Login

Post by Aaron Griffiths »

In the literacy game project I am scripting players use a HUD that manages the different levels, scores etc. When the user first wears the HUD it uses the attach event to trigger the showing of an info page. Works fine. (See Creating Icons Video at the 1 minute mark)

What I have noticed however is that occasionally when I login (I always using Last Location) I am actually sent to the sim's Landing Point and the info page on the HUD is displayed. This should only be triggered when the HUD is attached so my question is; does this occur because in these instances Kitely has detached the HUD and is reattaching it? Or is there some other explanation?

I don't particularly want this unintended HUD action and would rather move the behaviour from the event if it is not manageable.

Regards
Aaron/Isa
Aaron Griffiths in RL and Kitely
Isa Goodman in Second Life
Current Kitely Development: Occupational Medicine Simulation
F/Xual Education Services
User avatar
Dundridge Dreadlow
Posts: 616
Joined: Mon May 06, 2013 2:23 pm
Location: England
Has thanked: 590 times
Been thanked: 339 times

Re: Attach Event on Login

Post by Dundridge Dreadlow »

tag change - CHANGED_OWNER and attach, (I'm not sure off hand which order they fire) then it will only fire once per user.
ImageImageImageImageImageImage
PS. Kitely is awesome.
User avatar
Ilan Tochner
Posts: 6545
Joined: Sun Dec 23, 2012 8:44 am
Has thanked: 5014 times
Been thanked: 4487 times
Contact:

Re: Attach Event on Login

Post by Ilan Tochner »

Hi Aaron,

OpenSim chooses the starting position within a region according to very complicated logic. If a Telehub exists then it takes precedence over the Landing Point.

The reason the logic is complicated is that the starting position might only be used for some types of teleport, or for some types of users. For example:

- Login always uses the starting position
- Lure always ignores the starting position (i.e., the user appears next to the user that invited him)
- Landmarks work only for the world owner. Non-owners appear at the starting position.
- Teleporting via the Map always uses the starting position
- Teleporting inside the region always ignores the starting position
- Grid Gods always ignore the starting position

The code is even more complicated than what I wrote above. Also, it looks inconsistent in some parts: e.g., we think the logic used during login doesn't check as many things as the logic used during teleport.
These users thanked the author Ilan Tochner for the post:
Dundridge Dreadlow
User avatar
Aaron Griffiths
Posts: 25
Joined: Thu Aug 01, 2013 7:21 am
Location: New Zealand
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Attach Event on Login

Post by Aaron Griffiths »

Had tested CHANGED_OWNER Dundridge but unfortunately seems to be one of the changed values that doesn't work in opensim. Tested the operation of it in SL and worked fine. Exact same operation in OS isn't working.

Thanks for the suggestion though.
Aaron Griffiths in RL and Kitely
Isa Goodman in Second Life
Current Kitely Development: Occupational Medicine Simulation
F/Xual Education Services
User avatar
Aaron Griffiths
Posts: 25
Joined: Thu Aug 01, 2013 7:21 am
Location: New Zealand
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Attach Event on Login

Post by Aaron Griffiths »

Thanks for that info Ilan. Much appreciated.
Aaron Griffiths in RL and Kitely
Isa Goodman in Second Life
Current Kitely Development: Occupational Medicine Simulation
F/Xual Education Services
User avatar
Dundridge Dreadlow
Posts: 616
Joined: Mon May 06, 2013 2:23 pm
Location: England
Has thanked: 590 times
Been thanked: 339 times

Re: Attach Event on Login

Post by Dundridge Dreadlow »

Hmm, interesting.
ok, in that case, set a counter so it only occurs once after reset or on request
or you could detect the owner and store the owner key/name and check that.
ImageImageImageImageImageImage
PS. Kitely is awesome.
User avatar
Aaron Griffiths
Posts: 25
Joined: Thu Aug 01, 2013 7:21 am
Location: New Zealand
Has thanked: 0
Been thanked: 8 times
Contact:

Re: Attach Event on Login

Post by Aaron Griffiths »

Yeah there's a few options to try. Will probably run a two state variable. Thanks for your help.
Aaron Griffiths in RL and Kitely
Isa Goodman in Second Life
Current Kitely Development: Occupational Medicine Simulation
F/Xual Education Services
Post Reply