|
WickedTribe Woodget
Registered User
Join date: 12 Apr 2007
Posts: 15
|
05-25-2007 15:49
I am trying to write a script that reads a notecard that is stored in another object.
Specifically I have an access-controlled doorway script that reads a list of permitted avatars from a notecard. Now I want to be able to drop the access-controlled doorway script into many doors throughout a building but keep the list of permitted avatar names in a single instance of a notecard in a master object. This single notecard can then be easily maintained and updated (which would then affect all doors with this script in them).
Attempt 1.
I tried to use llGetNotecardLine(name, line_num) taking into account the following comment on wiki: " string name – a notecard in inventory or UUID ". I thought I may be able to put the UUID of the master object into this command in the access controlled doorway script, but I can't get that to work, it doesnt return anything ???
Attempt 2.
Searching through the forums and websites, I see that there is an approach to do this using llMessageLinked() for one script to call another scirpt in the remote prim to read its local notecard, but seems to be limited to talk between prims within a linked object rather than two totally separate and physically removed objects ???
Are either of these attempts workable? If so, what would the correct coding be? Otherwise any suggestions?
|
|
Resolver Bouchard
Registered User
Join date: 19 Jul 2006
Posts: 89
|
05-25-2007 16:06
Neither will work. There are a variety of ways of doing it but probably the easiest is a central server with the notecard in and when someone tries to use a door the door sends a request to the server to check if they are on the allowed list. llSay() or llRegionSay() to communicate between doors and the server.
|
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
05-25-2007 17:00
You should be able to do what you want. Instead of the UUID of the prim containing the notecard, use the UUID for notecard itself. It's like using a texture/sound UUID to apply a texture or play a sound without need for the texture/sound to exist in contents of the object.
The main problem you'll have to solve is keeping the remote scripts updated with the current notecard UUID. The notecard UUID will change everytime the notecard is saved (updated).
|
|
WickedTribe Woodget
Registered User
Join date: 12 Apr 2007
Posts: 15
|
05-25-2007 17:46
Hmm, also lets not forget the problem of ensuring that all the scripts update themselves with the changes to the notecard. I can't use an on change event as one would normally...
|
|
WickedTribe Woodget
Registered User
Join date: 12 Apr 2007
Posts: 15
|
05-25-2007 20:16
Thanks for the suggestions. I have sorted out this issue. I used llRegionSay() to broadcast the list of permitted avatars and the walk thru walls scripts updated themselves using llListen()
|