Can I make player start with fists?
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.
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.
Can I make player start with fists?
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.
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.
- 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?
1) Redefine a playerpawn like this:
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.
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
}
}2) FadeTo should do the trick. It doesn't involve light of the sectors, and gives you the feeling that you want.
Re: Can I make player start with fists?
[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.
Re: Can I make player start with fists?
K ty... I'll see how that works out...
I think I'll go with the inventory clear since it seems simpler...
I think I'll go with the inventory clear since it seems simpler...
Re: Can I make player start with fists?
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???
Re: Can I make player start with fists?
Your best bet is to make dummy item actor in DECORATE that, when collected, uses Give_Inventory to give the player a pistol.R!V wrote:but my question is, how do you make the pistol an item for pickup???
- 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?
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:§-Morpheus-§ wrote:1) Redefine a playerpawn like this:
Spoiler: Decorate codeAs you may have seen, the playerpawn i've put only has "Fist" in player.startitem property.
Code: Select all
ACTOR DoomPlayerFist : DoomPlayer
{
Player.StartItem "Fist"
}Code: Select all
clearplayerclasses
addplayerclass DoomPlayerFist nomenuRe: Can I make player start with fists?
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...
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...
Re: Can I make player start with fists?
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?Potnop wrote:K thanks... I only need the fists thing on level 1 though.
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.
- 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?
Obviously he should have changed the name of the actor to make it work. I forgot to point it out.Agent ME wrote: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:§-Morpheus-§ wrote:1) Redefine a playerpawn like this:
Spoiler: Decorate codeAs you may have seen, the playerpawn i've put only has "Fist" in player.startitem property.
Re: Can I make player start with fists?
Enter, not open. Open scripts are run by the world, which has no inventory.Shinjanji wrote:Just make sure you set the script to an OPEN type.
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?
- 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?
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.
Re: Can I make player start with fists?
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...
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...
Re: Can I make player start with fists?
OPEN run by the world when the map OPENs.
ENTER run when a player ENTERs the map.
Does that help?
ENTER run when a player ENTERs the map.
Does that help?
Re: Can I make player start with fists?
K. Will the ENTER script get run every time the player enters the map or only the first time?
