Can I make player start with fists?

Archive of the old editing forum
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.
User avatar
Potnop
Posts: 106
Joined: Tue Dec 19, 2006 7:24 pm

Can I make player start with fists?

Post by Potnop »

OK... So my level starts with the character waking up from a cryogenic sleep. I want to make it so you have to pick up the pistol and not start with it.

Also is it possible to do a fade from black? I made the beginning start with a sector that has zero light level and fades to a brighter light level to make it look like the player just woke up, but as you may know, when standing even in 0 light level sector right against a wall, you can still clearly see the wall at full brightness. So I was thinking if I can just do a fade from black instead.
User avatar
Remmirath
Posts: 2562
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: Can I make player start with fists?

Post by Remmirath »

1) Redefine a playerpawn like this:

Code: Select all

ACTOR DoomPlayer : PlayerPawn
{
  Speed 1
  Health 100
  Radius 16
  Height 56
  Mass 100
  PainChance 255
  Player.ColorRange 112, 127
  Player.DisplayName "Marine"
  Player.CrouchSprite "PLYC"
  Player.StartItem "Fist"
  States
  {
  Spawn:
    PLAY A -1
    Loop
  See:
    PLAY ABCD 4 
    Loop
  Missile:
    PLAY E 12 
    Goto Spawn
  Melee:
    PLAY F 6 BRIGHT
    Goto Missile
  Pain:
    PLAY G 4 
    PLAY G 4 A_Pain
    Goto Spawn
  Death:
    PLAY H 10 A_PlayerSkinCheck("AltSkinDeath")
    PLAY I 10 A_PlayerScream
    PLAY J 10 A_NoBlocking
    PLAY KLM 10
    PLAY N -1
    Stop
  XDeath:
    PLAY O 5 A_PlayerSkinCheck("AltSkinXDeath")
    PLAY P 5 A_XScream
    PLAY Q 5 A_NoBlocking
    PLAY RSTUV 5
    PLAY W -1
    Stop
  AltSkinDeath:
    PLAY H 6
    PLAY I 6 A_PlayerScream
    PLAY JK 6
    PLAY L 6 A_NoBlocking
    PLAY MNO 6
    PLAY P -1
    Stop
  AltSkinXDeath:
    PLAY Q 5 A_PlayerScream
    PLAY R 0 A_NoBlocking
    PLAY R 5 A_SkullPop
    PLAY STUVWX 5
    PLAY Y -1
    Stop
  }
}
As you may have seen, the playerpawn i've put only has "Fist" in player.startitem property.

2) FadeTo should do the trick. It doesn't involve light of the sectors, and gives you the feeling that you want.
User avatar
Medricel
Posts: 1138
Joined: Sat Nov 20, 2004 9:47 am

Re: Can I make player start with fists?

Post by Medricel »

[wiki]ClearInventory[/wiki] is another way to leave the player with only their fists. The script on the page shows how to do just that. Just make sure you set the script to an OPEN type.
User avatar
Potnop
Posts: 106
Joined: Tue Dec 19, 2006 7:24 pm

Re: Can I make player start with fists?

Post by Potnop »

K ty... I'll see how that works out...

I think I'll go with the inventory clear since it seems simpler...
R!V
Posts: 14
Joined: Tue Aug 26, 2008 8:06 pm

Re: Can I make player start with fists?

Post by R!V »

i got the same exact starting method(with fists only) but no fade in.. but my question is, how do you make the pistol an item for pickup???
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: Can I make player start with fists?

Post by Ceeb »

R!V wrote:but my question is, how do you make the pistol an item for pickup???
Your best bet is to make dummy item actor in DECORATE that, when collected, uses Give_Inventory to give the player a pistol.
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: Can I make player start with fists?

Post by Macil »

§-Morpheus-§ wrote:1) Redefine a playerpawn like this:
Spoiler: Decorate code
As you may have seen, the playerpawn i've put only has "Fist" in player.startitem property.
That code won't work since there already is an actor called DoomPlayer, and since it's mostly the same as DoomPlayer, you can use inheritence to shorten it down extremely:

Code: Select all

ACTOR DoomPlayerFist : DoomPlayer
{
  Player.StartItem "Fist"
}
and then put this in [wiki]KEYCONF[/wiki]:

Code: Select all

clearplayerclasses
addplayerclass DoomPlayerFist nomenu
The player will now only start with his fists on all levels when the when the wad is loaded.
User avatar
Potnop
Posts: 106
Joined: Tue Dec 19, 2006 7:24 pm

Re: Can I make player start with fists?

Post by Potnop »

K thanks... I only need the fists thing on level 1 though.

I've never messed with decorate yet. I've practiced some scripting and made a cool test level and I've done some Vanilla Doom mapping... Finally released my first wad which seems to be getting 4/5s so I'm doing soemthing right in the mapping department...
User avatar
Enjay
 
 
Posts: 27214
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Can I make player start with fists?

Post by Enjay »

Potnop wrote:K thanks... I only need the fists thing on level 1 though.
If he leaves level 1 carrying a pistol, he will still have it when he gets to level 2, just like any other weapon. Or is that not what you mean?

Oh, and I think the pistol may already be set up to have a pickup sprite and an edit number in Zdoom. IIRC, the ednum is 5010.
User avatar
Remmirath
Posts: 2562
Joined: Sun Dec 23, 2007 3:53 am
Graphics Processor: nVidia with Vulkan support
Location: My house
Contact:

Re: Can I make player start with fists?

Post by Remmirath »

Agent ME wrote:
§-Morpheus-§ wrote:1) Redefine a playerpawn like this:
Spoiler: Decorate code
As you may have seen, the playerpawn i've put only has "Fist" in player.startitem property.
That code won't work since there already is an actor called DoomPlayer, and since it's mostly the same as DoomPlayer, you can use inheritence to shorten it down extremely:
Obviously he should have changed the name of the actor to make it work. I forgot to point it out. :oops:
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Can I make player start with fists?

Post by randi »

Shinjanji wrote:Just make sure you set the script to an OPEN type.
Enter, not open. Open scripts are run by the world, which has no inventory.

Why is the distinction between open and enter so difficult to grasp? This keeps coming up repeatedly. Would it make a difference if open scripts were called world scripts instead?
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: Can I make player start with fists?

Post by XutaWoo »

For me, it's just my weird logic. ENTER is a larger word than OPEN so I keep thinking it means the world and not a single player.
User avatar
Potnop
Posts: 106
Joined: Tue Dec 19, 2006 7:24 pm

Re: Can I make player start with fists?

Post by Potnop »

OK, so does enter only control the player? And open controls the world?

I never even heard of enter. Heh...

Cuz I need the script at the start to fade from black and open the cryotube door, which works. it's awesome. Coolest map feature I ever made, heh...
User avatar
Enjay
 
 
Posts: 27214
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Can I make player start with fists?

Post by Enjay »

OPEN run by the world when the map OPENs.

ENTER run when a player ENTERs the map.

Does that help?
User avatar
Potnop
Posts: 106
Joined: Tue Dec 19, 2006 7:24 pm

Re: Can I make player start with fists?

Post by Potnop »

K. Will the ENTER script get run every time the player enters the map or only the first time?
Locked

Return to “Editing (Archive)”