Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Make [wiki=Creating_new_player_classes]a new player class[/wiki], defining the items the player starts the game with by using [wiki=Player_properties#Player.StartItem]Player.StartItem[/wiki] property.
Script 01 Open or Enter
Clear.Inventory ();
delay (amount);
Give inventory ("fist");
Thus it does not matter which player class you have, ignores difficulties etc. When the map starts, it clears all your items/weapons and sets the first weapon to use as a fist.
The only relevant potentially correct change I see is the use of [wiki]ClearInventory[/wiki]() over [wiki]TakeInventory[/wiki]("Pistol", 1). This change also provides (on its own) the effect Bloodfury describes. You start every level with just a fist, regardless of player class and inventory from previous levels. (And since you cleared inventory a new fist has to be given.)
There may be player classes where this is a problem. For example, a player class where there is an essential weapon that you start with and will not find as a pickup. However, if you play only with compatible player classes, and want to lose everything at the start of every level, ClearInventory is a nice function.
Note though: ClearInventory will not remove "Undroppable" items. But that's probably a good thing. That should potentially increase compatibility with unknown mods. (Where essential items you start with or carry across levels might be marked as undroppable, and thus saved from gamebreaking ClearInventory.)
I notice though, now at long long last, that you ask how to begin level 1 with just fists. Note that the pistol is not a pickup, so it will never be recovered. Presumably, you're going to use the default class (since you're not just making a new starting class). Just removing the pistol exactly as in the opening script is actually ideal for that purpose. It will happen on every level, but since you'll never pick up a new one, the script only matters at level 1.
(A new player class would be a more to-the-point solution, though, and with less potential for side effects. Do you know how to create and use one?)
The delay just came for there.. Cuz my map includes a textbrief and thus there is the delay. Not necessary. And OPEN script so if you would create a hub based map it only runs once. Enter script would always clear your inv and sets the fist when you come back to the same map.
::Bloodfury:: wrote:And OPEN script so if you would create a hub based map it only runs once. Enter script would always clear your inv and sets the fist when you come back to the same map.
This isn't even remotely correct.
Never use an OPEN script to generically setup players, as no player will be the activator of the script. The world is.
ENTER scripts aren’t executed when returning to another map in a HUB. That’s for RETURN to do.