Page 1 of 1

Expose APlayerPawn :: GiveDefaultInventory to ZScript

PostPosted: Mon May 14, 2018 9:26 pm
by m8f
Or, as an alternative, expose some new function APlayerPawn :: ResetInventoryToDefault that calls ClearInventory and then GiveDefaultInventory.

It may have the following use cases:

1. Strip player of all the weapons inside the map.
Map designers will be able to create single-level "get into and escape the prison" scenarios, instead of separating scenario in two levels and using property "ResetInventory" in MAPINFO/Map definition.

2. Force pistol start.
Gameplay mod designers will have straightforward way to reset player inventory at level start.

3. Punishing/replacing pickup.
With GiveDefaultInventory, it will be possible to create a pickup that takes away all player possessions and gives some other thing instead.

Re: Expose APlayerPawn :: GiveDefaultInventory to ZScript

PostPosted: Wed May 16, 2018 6:44 am
by XxMiltenXx
I second this.

Re: Expose APlayerPawn :: GiveDefaultInventory to ZScript

PostPosted: Thu May 17, 2018 10:51 pm
by m8f
First, I just realized that this thread is a duplicate of this: ResetInventory
It's funny because I actually used a solution posted there.

Second, I made some modifications to that solution. Changes are:
1. Armor and health are also reset.
2. Instead of taking all the weapons, all inventory is cleared.
3. After setting weapons, first start weapon is selected.
With these changes I managed to make pistol start script work properly for Trailblazer and DUMP3 weapons.