Tutorial: Giving the player upgrades (lockpicks, wall climbing, statue whacking) - by David
David on 30/10/2004 at 09:33
Giving the player lockpicks
The lockpicks are not a regular item, but are an upgrade you receive in the training mission. They cannot be dumped in the inventory, but rather given to the player via a script. This tutorial will show you how to add the lockpicks by frobbing (using) an object. It is likely that you can add the lockpicks when the player spawns, but that is for another day.
#1 Pick an object you wish to use to give the player the lockpicks. I used an inkwell because I had one already.
#2 Right-click the object and choose its properties, this is the first item in the popup menu.
#3 Expand bottom rung of the properties ladder and see if there is a section called "Scripts" and under that "TriggerScripts". If so you can skip onto #4. If not, right-click and choose Add Property. Choose "Script" from the left column and "Trigger Scripts" from the right column.
#4 With "Trigger Scripts" expanded click "Add", a child node will appear with a number in brackets and "None" next to it. Next to the word "None" there is a button with three dots on it. Click it, this will open the Trigger Script Manager.
#5 As the script from the training mission is unsuitable for what we want, we will create a new script from scratch, this is good practice anyway. From the menu of buttons on the left, choose "New". Another window will pop up, this is the Trigger Script Editor.
#6 In the box at the very top enter a name for the script in place of "DefaultName". I suggest "GivePlayerLockpicks"
#7 Click the "Condition" button and choose <em>Frob</em> > <em>When I am frobbed by player</em> and click ok.
#8 Click the "Action" button and choose <em>Flags&Messages</em> > <em>Set flag [Flag] to [Bool] expires on map change [Bool] expires on mission [int]</em> and click ok.
#9 In the script editor click [Flag] and choose <em>PlayerCanLockpick</em>. Note there are also <em>PlayerHasBlackjackUpgrade</em> and <em>PlayerHasWallclimbing</em>. These work in the same way. Click the first [Bool] and change it to <em>True</em> set the second [Bool] to <em>False</em> and set the [Int] to 20.
#10 Click Ok until you get back to your objects property window. Click "use" in the TriggerScript section et voila! Your player will have lockpicks.
#11 Check in game mode.
If all went well, when you frob the object a message will popup at the top of the screen that says "Upgrade Acquired".
Gingerbread Man on 30/10/2004 at 09:34
Wicked
:D
My previously fumbling can now be safely ignored, as it was pretty far off-center, by the looks of things.
David on 31/10/2004 at 08:28
Instead of the inkwell use a marker, I used an Ambient Sound marker near the Player Start.
When creating the script, instead of using <em>Frob</em> > <em>When I am frobbed by player</em>, use <em>Player</em> > <em>When player starts map, arriving from a different map</em>. This means when the map starts, but not if they loaded a save.
The script will give the player the lockpicks as soon as they start the map and has the added bonus of supressing the "Upgrade Acquired" message.
David on 23/2/2005 at 23:48
Bump!
sk2k on 25/2/2005 at 11:35
You can also add the script to PlayerStart.
MfG
sk2k
ProjectX on 27/2/2005 at 10:14
The script editor recommds using -1 for the integer values when you're setting the flags because it means they won't expire unless explicitly told to.
Also for him to blackjack you need to give the player the inventoryobjct GarrettBlackjack - there is also the dagger which would be useful.
ekeko on 28/2/2005 at 00:52
Quote Posted by ProjectX
Also for him to blackjack you need to give the player the inventoryobjct GarrettBlackjack - there is also the dagger which would be useful.
How is this done? I have looked at editing the trigger script and for the ACTION, Add [int] [inventoryclass] objects to the player inventory does not include a blackjack. It does include water crystals and others.