New Horizon on 13/10/2005 at 23:22
I went back to the very beginning for this.
Quote:
Lockpicks are assigned by typing GarrettLockpickLeft, in the level info default inventory.
Script 1: On the GarrettLockPickLeft.
Condition:
When I am used in a way from the inventory.
Action:
Send Trigger message {playercanlockpick}
Set playercanlockpick to true, expires on map change False, expires on level, -1.
Reset Script Conditions and Actions.
Script 2: On playergarrett
Condition:
Received Trigger Message
Action.
Delay 5 game seconds.
Set playercanlockpick to false, expires on map change False, expires on level, -1.
Reset Script conditions and actions.
Works like a charm and doesn't spew up the "new upgrade" message, because I deleted it from the .sch file. I also changed the name of the filenames for the upgrade sound .ogg and .sch files. This way, the game can not find it but it is still accessible for FM authors to use when they want the sound to play for new objectives. :)
New Horizon on 14/10/2005 at 01:24
Okay, I've finally gotten it to stop crashing...just a stupid mistake on my part that we won't bother going into.
Okay. This is what I have working so far.
Quote:
Script 1: On LockPicksCondition:
When I am used in a way from the inventory.
Action:
Send trigger message [PickableLock]
Reset script conditions and actions.
Script 2: On Lockplate.Conditions:
Received Trigger Message [pickablelock]
Query if [player] is within 140 unreal units of linked objects [myself]
Actions:
Set blslockplate to [true] on linked objects myself.
Reset script conditions and actions.
I have included a third script to set the blslockplate back to False but it doesn't work.
Quote:
Script 3: On Lockplate.Conditions:
Fire this condition every 1 second of gametime.
Query if blslockplate is [equal to] [true] on linked objects [myself].
Actions:
Delay 5 game seconds.
Set [blslockplate] to [False] on linked objects [myself].
Reset Script Conditions and actions.
The reason for the third script is to maintain the illusion of 'selectable lockpicks', since they're really not selectable at all. The only problem, is that the third script is not working at all right now and I don't know why.
I tried including the "set blslockplate to false" in the 2nd script by delaying the gametime by 5 seconds within, but it didn't want to work that way...not that it's working this way either. LOL
Any suggestions would be appreciated. It's almost there.
ascottk on 14/10/2005 at 02:40
This helped me with deleting inventory readables (add PickableLock flag):
Scripts on lockplates:
CONDITIONS:
While linked object(s) [PLAYER] is within [128.00] unreal units from linked object(s) [MYSELF]
ACTIONS:
Set flag [PickableLock] to [TRUE] expires on map change [FALSE] . . .
Reset script conditions and actions
CONDITIONS:
When [PickableLock] is set to [TRUE]
ACTIONS:
Delay [10.00] GAME seconds (or whatever is necessary)
Set flag [PickableLock] to [FALSE] expires on map change [FALSE] . . .
Reset script conditions and actions
Script on lock picks:
CONDITIONS:
When I am used in a way from the inventory
Query if flag [PickableLock] is set to [TRUE]
ACTIONS:
Set [blslockplate] to [TRUE] on linked object(s) [MYSELF]
Reset script conditions and actions
I'm not sure this'll work so keep us posted.
New Horizon on 14/10/2005 at 03:16
I had to make some changes before trying this out.
Quote Posted by ascottk
Scripts on lockplates:
CONDITIONS:
While linked object(s) [PLAYER] is within [140.00] unreal units from linked object(s) [MYSELF]
Query if [pickablelock] is set to true.
ACTIONS:
Set [blslockplate] to [TRUE] on linked object(s) [MYSELF]
Reset script conditions and actions
CONDITIONS:
When [PickableLock] is set to [TRUE]
ACTIONS:
Delay [10.00] GAME seconds (or whatever is necessary)
Set [blslockplate] to [False] on linked object(s) [MYSELF]
Reset script conditions and actions
Script on lock picks:
CONDITIONS:
When I am used in a way from the inventory
ACTIONS:
Set flag [PickableLock] is set to [TRUE]
Reset script conditions and actions
Basically, this is what needs to happen.
Select the lockpicks from your inventory.
Press the 'use' button to arm them. [essentially, this fires the triggerscript on the picks]
When the picks are 'used' from inventory, this sets off the triggerscript on the lockplate on the door and changes blslockplate from False, to True.
The third script should change blslockplate back to False so that if you lock the door again, you have to select your picks from inventory before it will be pickable. If an FM author doesn't put those two scripts on the lock, it will remain unpickable and only be opened by a key. :) However, no matter what I try...I can not get blslockplate to change back to false for some reason. Once that hurdle is overcome, we will have a functioning 'manually' selectable set of lock picks. :)
New Horizon on 14/10/2005 at 03:37
I even tried something more simple.
Two scripts:
Quote:
On LockPicks:
Condition:
When I am used in a way from the inventory.
Action:
Send Trigger Message [PickableLock]
Reset Script conditions and actions.
On LockPlates:
Condition:
Received Trigger Message [PickableLock]
Query if Player is within 140 Unreal Units of linked objects Myself
Action:
Toggle blslockplate on linked object myself.
Reset script conditions and actions.
This is almost exactly the same as the new key system that we have, yet it won't toggle blslockplate back to False. I think there must be some kind of glitch preventing this from working properly as I can see no reason for it not to work with these two scripts. Damn, always so close huh? :)
New Horizon on 14/10/2005 at 12:56
Getting blslockplate to switch back to False or to toggle back to false seems to be a no go.
A different concept but again, likely one that won't work due to hard coding...hopefully I'm wrong.
The whole idea behind this is to give more control to the player as to when they lockpick and the FM author, so they can decide which locks are pickable. If we could do it this way, there would be no need for scripts at all, as I would simply do away with the 'selectable from inventory deal' in favor of this method.
New method:
Frobbing the lock directly, instead of the door.
- I have already gotten this part to work.
All locks are by default blslockplate false, in the gamesys. When placed in the level, the author simply places a blslockplate property on the lock and sets it true.
- Player gets within frobbing distance of the lock (32 for gameplay purposes) and the picking commences.
- Problems. The door is hard coded to picking...this is the only problem. If we can get around this, I think we could have a more concise version of lockpicking because it will allow the player to try a key first...and also, try the door without being sucked into the picking routine.
That's where I'm at right now...basically have to find a way to stop the door from starting pick mode.
Krypt, if you're hanging around....have any ideas on why blslockplate can't be set back to the False setting?
I'll keep you posted.
rujuro on 16/10/2005 at 15:38
I found a really smooth implementation for this, only downside is you'd have to live with the upgrade sound and message. Basically I used the older method, but added the "cause an event to happen as if I had been frobbed by the player" action on the door. The upside is that when you use the lockpicks in the inventory, if you're close enough you go directly into lockpick mode, you don't have to frob the door a second time. The script turns lockpicking back off almost immediately, so there's no danger of accidentally firing the lockpick by frobbing the door again. I can post the specifics if anyone is interested. The downside is you get the sound and message every time.
New Horizon on 16/10/2005 at 18:54
I have a few things to try out on the current method. It keeps the lockpicks on at all times, so you don't get the noise and message but it uses the locks to control the entering of the picking routine.
This is the structure, just have to try implimentation.
Player has lockpicks in inventory.
- Try to open door.
- Locked
- Cycle through inventory to lockpicks.
- Press Use button to theoretically 'arm' the picks, what it really does is change blslockplate - false to true, if the triggerscript has been placed upon the door.
- frob door, pick lock.
- once blslocked = true changes to blslocked = false, the locks on the door are destroyed and a new set are spawned directly from the gamesys.
This had to be done to get around some odd hardcoding that disallowed switching blslockplate back to false after several seconds or when the door was fully picked. So, if the door is locked by the player again...with a key that is later picked up...he can either use the key or use the picks. Their choice.
It sounds a bit complicated but such is the beast T3Ed at times. :)
New Horizon on 3/11/2005 at 04:56
Updated the very first post. Inventory Lockpicks now work.
Bardic on 3/11/2005 at 07:19
Very nice work. Sometimes I'm surprised by how much you have going on at once. Even more now that I have read the Darkmod forums.