Please can any of you make a lock for me?
Moderator: Event DM
- Havoulov
- Team Member; Retired with Honors
- Posts: 3428
- Joined: Sun Mar 21, 2004 9:22 pm
- Location: Just behind you!((Norway)) GMT+2
Please can any of you make a lock for me?
In Avlis there is a system that uses a database entry for Ranks.
I want this rank attribute by itself to act as a key to a placable or door.
This is not such a big script i guess, but as i have heard it does not exist yet.
Sorry but i have no idea how to include database entries in a script.
Thank you for your trouble! If you need more info feel free to PM me..
PLEASE HELP!
*begs*
I want this rank attribute by itself to act as a key to a placable or door.
This is not such a big script i guess, but as i have heard it does not exist yet.
Sorry but i have no idea how to include database entries in a script.
Thank you for your trouble! If you need more info feel free to PM me..
PLEASE HELP!
*begs*
- Jonezie
- Team Member; Retired with Honors
- Posts: 3905
- Joined: Wed Jun 09, 2004 7:05 am
- Location: Melbourne (GMT +10)
I wasn't aware that the ranks were set in the database, but it seems I was mistaken.
Anyways, the script you're looking for needs to be an OnFailToOpen script, something like:
Assuming, for the moment, that the rank is stored as a persistent int on the PC. However, when there's lag about, the OnFailToOpen event WILL NOT FIRE, meaning that this sort of script really isn't viable in a PW. If it's for a single player mod, then there's no problems, but in something like Avlis, an item as the key is really the only option.
You'd also want to have an auto close/lock script on the door to relock it once the person has gone through.
Anyways, the script you're looking for needs to be an OnFailToOpen script, something like:
Code: Select all
void main()
{
object oPC = GetClickingObject();
int iRank = GetPersistentInt(oPC, "Rank");
if (iRank > 5)
SetLocked(OBJECT_SELF, FALSE);
}
You'd also want to have an auto close/lock script on the door to relock it once the person has gone through.
Last edited by Jonezie on Mon Aug 22, 2005 7:39 am, edited 1 time in total.
- Psyco
- Elder Sage
- Posts: 3288
- Joined: Mon Jun 30, 2003 10:05 pm
- Location: New Zealand (NZDT, +12 GMT)
- Contact:
It has been used by both akn and oog in the past.
i know akn has ditched it, and i know oog has issues with it.
The problem is that the onfailtoopen script does not always fire, so often you end up locked out of an area just because.
If you want to go this way, do so at your own risk, i would not recommend it.
i know akn has ditched it, and i know oog has issues with it.
The problem is that the onfailtoopen script does not always fire, so often you end up locked out of an area just because.
If you want to go this way, do so at your own risk, i would not recommend it.
Player Housing info - This answers most questions people have. Read this before asking.
- Mistcaller
- Team Member; Retired with Honors
- Posts: 5477
- Joined: Sun Feb 09, 2003 3:42 pm
- Location: Athens, Greece (GMT +2)
- Havoulov
- Team Member; Retired with Honors
- Posts: 3428
- Joined: Sun Mar 21, 2004 9:22 pm
- Location: Just behind you!((Norway)) GMT+2
You guys really rock my world!!!!
The Avlis Top brains all on it!
I have a question that i just send to Jonesie ,but since i have you all team work can save the day!
I Intended to use it for chests, so that different members would have different material access
The optimal would be so that all can load the chest but only the "key" owners could be able to remove.
But since that would interefere with the p-chest coding i take it as a no already
Propably as bad a s the lag is it doesn't matter since the p-chests suck anyway on lag! and none is left out!
Is that (mechanicly) more viable? (sorry Jonesie if you are currently answering that.... )
The Avlis Top brains all on it!
I have a question that i just send to Jonesie ,but since i have you all team work can save the day!
I Intended to use it for chests, so that different members would have different material access
The optimal would be so that all can load the chest but only the "key" owners could be able to remove.
But since that would interefere with the p-chest coding i take it as a no already
Propably as bad a s the lag is it doesn't matter since the p-chests suck anyway on lag! and none is left out!
Is that (mechanicly) more viable? (sorry Jonesie if you are currently answering that.... )
- Gorgon
- Father of Avlis EE
- Posts: 6637
- Joined: Fri Oct 17, 2003 10:14 pm
- Timezone: PST -8
- Location: Vancouver, BC, Canada
Persistant "display" chests already work this way. Anyone can look at the contents and deposit things, but only key holders can take things out. Places like FF-Trading even have drop boxes set up for this exact purpose.Havoulov wrote:I Intended to use it for chests, so that different members would have different material access
The optimal would be so that all can load the chest but only the "key" owners could be able to remove.
But since that would interefere with the p-chest coding i take it as a no already
The new text based chests can work like this as well according to the housing director here: viewtopic.php?p=538606#538606 (I think the name has been changed from ip-chest to ep-chest though)
"God not only plays dice, he throws them in the corner where you can't see them."
-- Stephen William Hawking (1942-2018) --
Sprucing up ye olde NWN | NWN:EE Wiki | ~Avlis Theme Song~
-- Stephen William Hawking (1942-2018) --
Sprucing up ye olde NWN | NWN:EE Wiki | ~Avlis Theme Song~
- Nighthawk4
- Assist DM
- Posts: 25898
- Joined: Fri Feb 07, 2003 8:32 pm
- Timezone: GMT
- DM Avatar: DruEl
- Location: The Home of the Bard of Avon
- Contact:
Does that explain the issues with the AKN Chests which were evident at the Weekend please? I think Bell Arren's Player (and perhaps someone else) reported these as a Bug.
Life is never as bad as you think it is, although that doesn't help at the time.
Orleron wrote:I think it's a fun idea if you can idiot-proof it. Problem is God always builds a better idiot.
- PlasmaJohn
- CCC / Release Admin
- Posts: 9010
- Joined: Fri Dec 26, 2003 10:37 pm
- Timezone: US/Eastern
- Location: Negaria
- Contact:
- Nighthawk4
- Assist DM
- Posts: 25898
- Joined: Fri Feb 07, 2003 8:32 pm
- Timezone: GMT
- DM Avatar: DruEl
- Location: The Home of the Bard of Avon
- Contact:
OK - thanks PJPlasmaJohn wrote:Completely different issue.Nighthawk4 wrote:Does that explain the issues with the AKN Chests which were evident at the Weekend please? I think Bell Arren's Player (and perhaps someone else) reported these as a Bug.
Life is never as bad as you think it is, although that doesn't help at the time.
Orleron wrote:I think it's a fun idea if you can idiot-proof it. Problem is God always builds a better idiot.
- Havoulov
- Team Member; Retired with Honors
- Posts: 3428
- Joined: Sun Mar 21, 2004 9:22 pm
- Location: Just behind you!((Norway)) GMT+2
Would that be combinable with Jonezies script though? I know that CPU is VERY picky about altering p-chest scripts.... they have to be authorized all anew...Gorgon wrote:Persistant "display" chests already work this way. Anyone can look at the contents and deposit things, but only key holders can take things out. Places like FF-Trading even have drop boxes set up for this exact purpose.Havoulov wrote:I Intended to use it for chests, so that different members would have different material access
The optimal would be so that all can load the chest but only the "key" owners could be able to remove.
But since that would interefere with the p-chest coding i take it as a no already
The new text based chests can work like this as well according to the housing director here: viewtopic.php?p=538606#538606 (I think the name has been changed from ip-chest to ep-chest though)
I would give this whole thing a try definatelly, although Jonezies (PM) idea of having the guild DM distributing keys at need is propably the easiest and more fesible....
- Mistcaller
- Team Member; Retired with Honors
- Posts: 5477
- Joined: Sun Feb 09, 2003 3:42 pm
- Location: Athens, Greece (GMT +2)
- CPU
- Team Member; Retired with Honors
- Posts: 5161
- Joined: Sat Apr 05, 2003 4:27 pm
- Location: NY. USA (-4GMT)
That was a typo on my part. I should go back and fix that to prevent confusion.Havoulov wrote:The new text based chests can work like this as well according to the housing director here: viewtopic.php?p=538606#538606 (I think the name has been changed from ip-chest to ep-chest though)
HEY! I resemble that! I don't like mucking about with established systems because it creates more work for the Team. I'm not a coder, so this requires someone else to review the code. The Team does such incredable stuff, especially when it comes to the coders, that the idea of pushing a single use, one player exception, is alot of work for the low payout. I'd prefer to keep the Team working on what they are (stuff for everyone on Avlis) then to sidetrack them with a player's personal use project. AND often times, most people's idea of what they want can be accomplished with pre-existing scripts.Havoulov wrote:Would that be combinable with Jonezies script though? I know that CPU is VERY picky about altering p-chest scripts.... they have to be authorized all anew...
New scripts in Player Housing = BAD.
Avlis Housing Director
PM: Avlis Player Housing
Player Housing Information - This answers most questions people have. Please read this before asking.
PM: Avlis Player Housing
Player Housing Information - This answers most questions people have. Please read this before asking.