A Few Niggling Issues, Key Pickups, door messages...

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

thelegacyman

FNG / Fresh Meat
Jul 12, 2011
102
25
0
Hi guys, I'm still working on my mission map.

A few problems though.

ISSUE RESOLVED When I link a key to a door, I can only get the door to auto open as the key is picked up, what I'd really like to do is when the key is picked up, for that player to have to actually go to the door and then the door unlocks with the key. ISSUE RESOLVED
-----------------------------------------------------------------------------------------------------------------

Which brings me to another problem, when the player picks up a key, he cannot pick up a 2nd key, which limits creativity to a degree, anyway around that?

I know its all to do with the inventory slots, the key takes up one slot, its like trying to pick up two AA12 shotguns, you can't do it.

My theory behind that problem is, create either a 2nd copied script and alter the inventory number, or if we can solve the key to the door issue, make it so that when the key is used it is discarded.

Any other insight from you guys would be cool.

-----------------------------------------------------------------------------------------------------------------
Another problem i'm having is, I can't get messages to appear, for example, a player approaches a locked door, instead of saying this door is locked it needs a key, it says nothing, can't figure out how to activate the messages to appear.

-----------------------------------------------------------------------------------------------------------------

The final issue, is it possible to use the destroy actor or destroy pawn trigger to destroy an object? Say I want a disk to disappear when its approached, almost like a pickup, the player hits the collision trigger, the disk is destroyed giving the effect it has been picked up.

Any help would be cool, thank you for the welding door status help in the other thread too, worked like a dream.
 
Last edited:

KiCk3R

FNG / Fresh Meat
Mar 20, 2009
390
57
0
Shropshire UK
Hi,

I have never actually used the key function on doors. And I can't think of many maps that use keys.

I am currently making maps with scripted triggers that require a "Key". (Which is actually a "Mover" that moves when you "Pick it up")

So in a simple layout, conciser this;

Create a trigger in-front of a door that is locked; then create a scripted trigger >

Waitforevent > Someone_is_trying_to_open_my_door (event of trigger at door)

DisplayMessage > You must find a key for this door first!

Make a mover, which triggers an event when bumped (a key)

Waitforevent > KeyPickedUp

DisplayMessage > You found a key

Waitforevent > Someone_is_trying_to_open_my_door2 (2 - Because we only want to trigger the first trigger once. This means you will have to create another trigger outside that door which is set to "OtherEventTurnsOn"

Triggerevent > OpenTheLockedDoor


Check out my map which Il be releasing shortly. The above may seem a bit cloudy!


In regards to the destroy actor, I believe you can only do this with placeable actors (and I know static meshes are actors, but this does not work with them)

You can destroy many actors, but Im 99.9% sure statics cannot be destroyed (even with the destroyable true/false value)
 

thelegacyman

FNG / Fresh Meat
Jul 12, 2011
102
25
0
Hi,

I have never actually used the key function on doors. And I can't think of many maps that use keys.

In regards to the destroy actor, I believe you can only do this with placeable actors (and I know static meshes are actors, but this does not work with them)

You can destroy many actors, but Im 99.9% sure statics cannot be destroyed (even with the destroyable true/false value)


Thank you Kick3R, I have solved the key and lock problem.

I saw the key and lock function on the map Offices-Story-Alpha and thought I'd give it a go.

I used the method of actually picking up a key as an item, which works great for the door you want opening, but unfortunately you can't pick more than one key up because the key acts as an inventory item, it can't be duplicated, like you can't pick two AA12 shotguns up, because you already have that item, I'm working to solve that issue.

Thanks for pointing out the destroy object issue.

Thank you for your help.
 
Last edited:

thelegacyman

FNG / Fresh Meat
Jul 12, 2011
102
25
0
This is the code

Code:
[COLOR=#00ffff][COLOR=#00ffff]class[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff] KFKeyPickup [/COLOR][/COLOR][COLOR=#00ffff][COLOR=#00ffff]extends[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff] Pickup;[/COLOR]
[/COLOR][COLOR=#00ffff][COLOR=#00ffff]function[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff] inventory SpawnCopy( pawn Other )[/COLOR]
[COLOR=#ffffff]{[/COLOR]
[/COLOR][COLOR=#00ffff][COLOR=#00ffff]local[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff] inventory Copy;[/COLOR]
[COLOR=#ffffff]Copy = [/COLOR][/COLOR][COLOR=#00ffff][COLOR=#00ffff]Super[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff].SpawnCopy(Other);[/COLOR]
[COLOR=#ffffff]Copy.Tag = Tag;[/COLOR]
[/COLOR][COLOR=#00ffff][COLOR=#00ffff]if[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff]( KFKeyInventory(Copy)!=[/COLOR][/COLOR][COLOR=#00ffff][COLOR=#00ffff]None[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff] )[/COLOR]
[COLOR=#ffffff]KFKeyInventory(Copy).MyPickup = [/COLOR][/COLOR][COLOR=#00ffff][COLOR=#00ffff]self[/COLOR][/COLOR][COLOR=#ffffff][COLOR=#ffffff];[/COLOR]
[/COLOR][COLOR=#00ffff][COLOR=#00ffff]return[/COLOR][/COLOR][SIZE=1][COLOR=#ffffff][SIZE=2][COLOR=#ffffff] Copy;[/COLOR][/SIZE]
[SIZE=2][COLOR=#ffffff]}[/COLOR][/SIZE]
[/COLOR][/SIZE]

if( KFKeyInventory(Copy)!=None )
KFKeyInventory(Copy).MyPickup =
self

That section is telling it If there is no key in your inventory, add key there.

What I need is a slab of code that says:

Upon Key PickUp

If there is no key in inventory slot 1, add this key to inventory slot 1,
else IF there IS a key in inventory slot 1, add this key to inventory slot 2.

Only... I don't know what that code would look like.
 
Last edited: