Gamemode help?

Discuss all aspects related to modding Zandronum here.
Post Reply
LanHikariDS
New User
Posts: 16
Joined: Thu Aug 11, 2016 7:52 am
Contact:

Gamemode help?

#1

Post by LanHikariDS » Wed Mar 22, 2017 3:24 am

Trying to work on a gamemode for Zandronum, but I'm having some issues. First off, the Fire thing is spawned by the InfectedPlayer, and in ZDoom, the fire teleports to the player every frame, giving the illusion that the fire is following the player. However, in Zandronum, the fire just sits in place when spawned. Next, when a player touches the fire, they're supposed to transform into an InfectedPlayer, but going up tot he fire as a normal player does nothing. Anyone know what's wrong?

Code: Select all

ACTOR Fire : MorphProjectile
{
  Radius 18
  Height 80
  +Bright
  +IsMonster
  +Invulnerable
  -NoTeleport
  -NoBlockMap
  -Missile
  Damage 1
  MorphProjectile.PlayerClass "InfectedPlayer"
  RenderStyle Add
  States
  {
  Spawn:
    FIRE A 0 A_PlaySound (Crackle, 0, 92, 1)
	FIRE A 0 A_ChangeFlag (IsMonster, 0)
    FIRE AABBCCDDEEFFGGHHIIJJKKLLMMNN 1 A_Warp (AAPTR_MASTER, 0, 0, 0, 0, WARPF_NOCHECKPOSITION)
    Loop
   }
}
ACTOR InfectedPlayer : PlayerPawn
{
  Speed 1
  Health 100
  Radius 16
  Height 38
  Mass 100
  PainChance 255
  Player.DisplayName "Infected"
  Player.Face VIR
  -Pickup
  States
  {
  Spawn:
    TNT1 A 0 A_Jump(256, "See")
	PLAY A -1 A_SpawnItemEx ("Fire", 0, 0, 0, 0, 0, 0, 0, SXF_SetMaster)
  SpawnLoop:
    PLAY A -1
    Loop
  See:
	PLAY A 4 
	PLAY B 4
	PLAY C 4
	PLAY D 4 A_Jump (30, "Scream")
    Loop
  Scream:
    TNT1 A 0 A_PlaySound (SCREAM)
	Goto See
  Pain:
    PLAY G 4 
    PLAY G 4 A_Pain
    Goto Spawn
  Death:
    PLAY H 5
    PLAY I 5 A_PlayerScream
    PLAY J 5 A_NoBlocking
    PLAY N -1
    Stop
  }
}

User avatar
Kaminsky
Developer
Posts: 195
Joined: Sun Apr 14, 2013 7:17 pm
Location: Canada

Re: Gamemode help?

#2

Post by Kaminsky » Wed Mar 22, 2017 4:42 am

Try setting the pointer to APPTR_TARGET so when the fire warps, it follows its target which should be the InfectedPlayer that's spawning it. Alternatively, you could use SXF_ISMASTER instead of SXF_SETMASTER for spawning the fire if you still want it to warp to its master because SXF_SETMASTER actually sets it to become the player's master and not the other way around.

For getting the projectile to morph the players, you can try enabling the +RIPPER flag for the fire actor to see if it will transform the players if they come close.

I don't know if this could make a difference too but remove the +ISMONSTER flag from the actor entirely because it should inherently be treated only as projectile.

LanHikariDS
New User
Posts: 16
Joined: Thu Aug 11, 2016 7:52 am
Contact:

Re: Gamemode help?

#3

Post by LanHikariDS » Wed Mar 22, 2017 10:40 am

Alright, so now it works as it should, but now the player won't stay morphed when infected. The Infected Player is also supposed to lose their weapons, but I don't know how to get rid of them. As is, it swaps them to nothing, but they're allowed to switch back to the weapons they had.

Code: Select all

ACTOR InfectedPlayer : PlayerPawn
{
  Speed 1
  Health 100
  Radius 16
  Height 38
  Mass 100
  PainChance 255
  Player.DisplayName "Infected"
  +StayMorphed
  Player.Face VIR
  -Pickup
  States
  {
  Spawn:
    TNT1 A 0 A_Jump(256, "See")
	PLAY A -1 A_SpawnItemEx ("Fire")
  SpawnLoop:
    PLAY A -1
    Loop
  See:
	PLAY A 4 
	PLAY B 4
	PLAY C 4
	PLAY D 4 A_Jump (20, "Scream")
    Loop
  Scream:
    TNT1 A 0 A_PlaySound (SCREAM)
	Goto See
  Pain:
    PLAY G 4 
    PLAY G 4 A_Pain
    Goto Spawn
  Death:
    PLAY H 5
    PLAY I 5 A_PlayerScream
    PLAY J 5 A_NoBlocking
    PLAY N -1
    Stop
  }
}
ACTOR LivePlayer : PlayerPawn
{
  Speed 1
  Health 100
  Radius 16
  Height 56
  Mass 100
  PainChance 255
  +StayMorphed
  Player.DisplayName "Live"
  Player.CrouchSprite "PLYC"
  Player.StartItem "Pistol"
  Player.StartItem "Fist"
  Player.StartItem "Clip", 50
  Player.WeaponSlot 1, Fist, Chainsaw
  Player.WeaponSlot 2, Pistol
  Player.WeaponSlot 3, Shotgun, SuperShotgun
  Player.WeaponSlot 4, Chaingun
  Player.WeaponSlot 5, RocketLauncher
  Player.WeaponSlot 6, PlasmaRifle
  Player.WeaponSlot 7, BFG9000
  Player.ColorRange 112, 127
  Player.ColorSet 0, "Green",         0x70, 0x7F,  0x72
  Player.ColorSet 1, "Gray",          0x60, 0x6F,  0x62 // Called "Indigo" originally so as to have a unique initial
  Player.ColorSet 2, "Brown",         0x40, 0x4F,  0x42
  Player.ColorSet 3, "Red",           0x20, 0x2F,  0x22
  // Doom Legacy additions
  Player.ColorSet 4, "Light Gray",    0x58, 0x67,  0x5A
  Player.ColorSet 5, "Light Brown",   0x38, 0x47,  0x3A
  Player.ColorSet 6, "Light Red",     0xB0, 0xBF,  0xB2
  Player.ColorSet 7, "Light Blue",    0xC0, 0xCF,  0xC2

  States
  {
  Spawn:
    PLAY A 4
    Loop
  See:
    PLAY A 3
	PLAY A 1
	PLAY B 3
	PLAY B 1
	PLAY C 3
	PLAY C 1
	PLAY D 3
	PLAY D 1
    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
    PLAY I 10 A_PlayerScream
    PLAY J 10 A_NoBlocking
    PLAY KLM 10
    PLAY N -1
    Stop
  }
}

Post Reply