Page 1 of 1

3D Tracer Not Appearing

Posted: Sat Aug 15, 2015 12:06 am
by Hornetzero
Hey all,
I'm just getting familiar with 3d tracers and tried to experiment with one that I liked (I'm not going to steal it).

I believe I have coded it correctly, but its not appearing in game visually when I test it, even though the game recognizes its existence. I have uploaded a simple file with all the bare essentials for it to run. Would someone be able to tell me why?

Lightning Experiment

P.S: Its used by a Spider Mastermind replacement.


Thank you

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 12:47 am
by Catastrophe
Post the code please

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 2:01 am
by jwaffe
Do you mean these blue things?

Image

Make sure you:

1. Have models enabled
(options -> display options -> opengl options -> preferences -> "use models" must be on)

2. Are running in opengl mode

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 2:42 am
by Hornetzero
Do you mean these blue things?



Make sure you:

1. Have models enabled
(options -> display options -> opengl options -> preferences -> "use models" must be on)

2. Are running in opengl mode
No. Those blue things are not the tracers. They are puffs created from the Tracers. Its the tracers, which are not appearing.
Post the code please
Ok;

Code: Select all


actor SM_SpiderMasterMind : SpiderMasterMind Replaces SpiderMasterMind
{
  Health 3000
  Radius 100
  Height 100
  Mass 1000
  Speed 12
  PainChance 40
  Monster
  MinMissileChance 160
  +BOSS
  +MISSILEMORE
  +FLOORCLIP
  +NORADIUSDMG
  +DONTMORPH
  +BOSSDEATH
  SeeSound "spider/sight"
  AttackSound "spider/attack"
  PainSound "spider/pain"
  DeathSound "spider/death"
  ActiveSound "spider/active"
  Obituary "$OB_SPIDER"
  States
  {
  Spawn:
    SPID AB 10 A_Look
    Loop
  See:
    SPID A 3 A_Metal
    SPID ABB 3 A_Chase
    SPID C 3 A_Metal
    SPID CDD 3 A_Chase
    SPID E 3 A_Metal
    SPID EFF 3 A_Chase
    Loop
	
   Missile:
			SPID G 6 A_FaceTarget
			SPID H 2 A_CustomBulletAttack(22.5, 0, 1, 3, "FreezeShock")
			SPID G 2 A_FaceTarget
			SPID H 2 A_CustomBulletAttack(22.5, 0, 1, 3, "FreezeShock")
			SPID G 2 A_FaceTarget
			SPID H 2 A_CustomBulletAttack(22.5, 0, 1, 3, "FreezeShock")
			SPID G 2 A_FaceTarget
			Goto See
  Pain:
    SPID I 3
    SPID I 3 A_Pain
    Goto See
  Death:
    SPID J 20 A_Scream
    SPID K 10 A_NoBlocking
    SPID LMNOPQR 10
    SPID S 30
    SPID S -1 A_BossDeath
    Stop
  }
}



ACTOR FreezeShock
{
	Radius 16
	Height 8
	Scale 0.75
	Alpha 0.75
	Renderstyle Add
	obituary "%o suffered from cold shock due to %k's freezebolt!"
	+PUFFONACTORS
	+FIXMAPTHINGPOS
	+BLOODLESSIMPACT
	+PUFFGETSOWNER
	+PIERCEARMOR
	+FIXMAPTHINGPOS
	+NOGRAVITY
	+NOBLOCKMAP
	+FORCEXYBILLBOARD
	+ISMONSTER
	-BLOODSPLATTER
	DamageType "Ice"
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_SpawnItemEx("BoltTracerSpawner", 0, 0, 0, 0, 0, 0, 0,  SXF_SETMASTER | SXF_TRANSFERPOINTERS, 0)
			goto Crash
		Crash:
			BOLT A 0
			BOLT A 0 A_SpawnItemEx("BoltTracerSpawner", 0, 0, 0, 0, 0, 0, 0,  SXF_SETMASTER | SXF_TRANSFERPOINTERS, 0)
			//BOLT A 0 A_Playsound("Freezehit")
			//BOTT AAAA 0 BRIGHT A_SpawnItemEx("ElectricSnowflake", 0, 0, 0, (random(-200,200)/100.0), (random(-200,200)/100.0), (random(-200,200)/100.0), random(-180,180), SXF_CLIENTSIDE, 96)
			BOLT ABCDEFGHIJKL 1 BRIGHT A_SpawnItemEx("FreezeSparks", 0, 0, 0, (random(-400,400)/100.0), (random(-400,400)/100.0), (random(-400,400)/100.0), random(-180,180), SXF_CLIENTSIDE, 128)
			Stop
	}
}


actor FireTracerSpawner
{
	Radius 0
	Height 0
	+DROPOFF
	+NOBLOCKMAP
	+NOINTERACTION
	+NOGRAVITY
	+NOCLIP
	+ISMONSTER
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_RearrangePointers(AAPTR_MASTER, AAPTR_TRACER, AAPTR_TARGET, PTROP_NOSAFEGUARDS)
			TNT1 A 0 A_Fire(32)
			TNT1 A 0 A_FaceTarget
			//TNT1 A 0 A_CustomMissile("FireTracer", 0, 10)
			TNT1 A 1
			stop
	}
}


actor BoltTracerSpawner: FireTracerSpawner
{
	States
	{
		Spawn:
			TNT1 A 0
			TNT1 A 0 A_RearrangePointers(AAPTR_MASTER, AAPTR_TRACER, AAPTR_TARGET, PTROP_NOSAFEGUARDS)
			TNT1 A 0 A_Fire(32)
			TNT1 A 0 A_FaceTarget
			TNT1 A 0 A_CustomMissile("BoltTracer", 0, 12)
			TNT1 A 1
			stop
	}
}



actor BulletTracer : FastProjectile
{
	Projectile
	Radius 2
	Height 2
	Speed 200
	RenderStyle Add
	Alpha 1.0
	+NOGRAVITY
	+THRUGHOST
	+DONTSPLASH
	-ACTIVATEIMPACT
	-ACTIVATEPCROSS
	States
	{
		Spawn:
			PUFF A 1 BRIGHT
			loop
		Crash:
		Death:
			TNT1 A 0
			TNT1 A 1
			stop
	}
}

actor BoltTracer : BulletTracer
{
	States
	{
		Spawn:
			BOLT ABCD 1 BRIGHT
			loop
	}
}

actor FrostTracer : BulletTracer
{
}



actor BaseEffect
{
	Radius 2
	Height 2
	Damage 0
	+CLIENTSIDEONLY
	+ALLOWCLIENTSPAWN
	+NOGRAVITY
	+NOBLOCKMAP
	+NOINTERACTION
	+FORCEXYBILLBOARD
	+DONTSPLASH
	+NOTELEPORT
	+CANNOTPUSH
	+BLOODLESSIMPACT
	+NOBLOCKMONST
	+NOTIMEFREEZE
	+THRUACTORS
	+DONTBLAST
	-SOLID
	-ACTIVATEIMPACT
	-ACTIVATEPCROSS
	States
	{
		Spawn:
			TNT1 AA 1
			stop
		Death:
			TNT1 AA 1
			stop
	}
}

actor FreezeSparks : BaseEffect
{
	Scale 0.5
	RenderStyle Add
	Alpha 1.0
	States
	{
		Spawn:
			BOLT ABCDEFGHIJKL 1 BRIGHT A_FadeOut(0.05)
			stop
	}	
}
and this on the model.def:

Code: Select all


model BoltTracer
{
	Path "models/ModelProjectiles"
	Model 0 "Tracer.md3"
	Skin 0 "BoltTracer1.png"
	Scale 20.0 3.5 3.5
	PITCHFROMMOMENTUM
	
	Rotating
	Rotation-Speed 10
	Rotation-Vector 1 0 0

	FrameIndex BOLT A 0 0
}

model BoltTracer
{
	Path "models/ModelProjectiles"
	Model 0 "Tracer.md3"
	Skin 0 "BoltTracer2.png"
	Scale 20.0 3.5 3.5
	PITCHFROMMOMENTUM
	
	Rotating
	Rotation-Speed 10
	Rotation-Vector 1 0 0

	FrameIndex BOLT B 0 0
}

model BoltTracer
{
	Path "models/ModelProjectiles"
	Model 0 "Tracer.md3"
	Skin 0 "BoltTracer3.png"
	Scale 20.0 3.5 3.5
	PITCHFROMMOMENTUM
	
	Rotating
	Rotation-Speed 10
	Rotation-Vector 1 0 0

	FrameIndex BOLT C 0 0
}

model BoltTracer
{
	Path "models/ModelProjectiles"
	Model 0 "Tracer.md3"
	Skin 0 "BoltTracer4.png"
	Scale 20.0 3.5 3.5
	PITCHFROMMOMENTUM
	
	Rotating
	Rotation-Speed 10
	Rotation-Vector 1 0 0

	FrameIndex BOLT D 0 0
}

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 1:58 pm
by jwaffe
Not sure if this helps narrow it down, but I can see the tracer model if I spawn BoltTracer, so your MODELDEF and model are okay, it must be something in the DECORATE code between FreezeShock and BulletTracer, if I get some time I'll look at it later today

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 4:57 pm
by Zanieon

Code: Select all

Missile:
            SPID G 6 A_FaceTarget
            SPID H 2 A_CustomBulletAttack(22.5, 0, 1, 3, "FreezeShock")
            SPID G 2 A_FaceTarget
            SPID H 2 A_CustomBulletAttack(22.5, 0, 1, 3, "FreezeShock")
            SPID G 2 A_FaceTarget
            SPID H 2 A_CustomBulletAttack(22.5, 0, 1, 3, "FreezeShock")
            SPID G 2 A_FaceTarget
            Goto See
Are you going use Tracer or FastProjectile?

FreezeShock is used with A_CustomBulletAttack, which is a Hitscan attack. You should use A_CustomMissile instead and makes it shots BoltTracer.

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 4:58 pm
by Catastrophe
Remove +ISMONSTER from the bulletpuff.

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 6:13 pm
by Hornetzero
Not sure if this helps narrow it down, but I can see the tracer model if I spawn BoltTracer, so your MODELDEF and model are okay, it must be something in the DECORATE code between FreezeShock and BulletTracer, if I get some time I'll look at it later today
I suspect the same thing, but I'm not able to determine what causes the problem.
Are you going use Tracer or FastProjectile?

FreezeShock is used with A_CustomBulletAttack, which is a Hitscan attack. You should use A_CustomMissile instead and makes it shots BoltTracer.
That's my last resort. I'll have to recode it to be a missile. Which may or may not work like the bullet tracer I had in mind.
Remove +ISMONSTER from the bulletpuff.
Did that. It had unfortunately no effect.

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 7:51 pm
by Zanieon
Hornetzero wrote:That's my last resort. I'll have to recode it to be a missile. Which may or may not work like the bullet tracer I had in mind.
You didn't got my point completely, what you have in mind isn't possible due to engine limitations, you can't give a "beam" to a Hitscan, only A_RailAttack does that, Zandronum still doesn't support it and only works for weapons unfortunately.

I mean, if you want your Bolt to appear, you have to make the spider shoots it as a projectile. Using the Hitscan attack will always result on what you have now.

I can give you a working example in your code.

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 8:45 pm
by jwaffe
Revilution wrote:
Hornetzero wrote:That's my last resort. I'll have to recode it to be a missile. Which may or may not work like the bullet tracer I had in mind.
You didn't got my point completely, what you have in mind isn't possible due to engine limitations, you can't give a "beam" to a Hitscan, only A_RailAttack does that...
Well, actually that's not really true, if I do

ACTOR FreezeShock Replaces BulletPuff
(...)

Instead of just

ACTOR FreezeShock
(...)

suddenly... Star Wars
(All hitscan enemies EXCEPT the spider mastermind start working, and all of the player's bullets have the effect too). Off topic: It's pretty cool looking! Try it!

Image

I can't explain why it doesn't work on the spider mastermind, though.

Taking a guess: I've seen some really odd glitches that happened when inheriting from Demon, maybe this is some sort of bizarre problem that stems from inheriting from Spidermastermind?

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 8:55 pm
by Zanieon
Then probably this is a undefined behavior of the engine, a bug or glitch probably, because i never saw such hacky way to do beams that isn't via Arctangent's ACS tracer or via A_RailAttack.

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 8:57 pm
by jwaffe
Revilution wrote: Then probably this is a undefined behavior of the engine, a bug or glitch probably, because i never saw such hacky way to do beams that isn't via Arctangent's ACS tracer or via A_RailAttack.
While it is a little unusual, Striker's Goldeneye TC uses it extensively

PP7 Code:

Code: Select all

ACTOR PP7 : DoomWeapon Replaces Pistol
{
	Decal BulletChip
	Weapon.SelectionOrder 1900
	Weapon.AmmoUse 1
	Weapon.AmmoGive1 7
	Weapon.AmmoGive2 14
	Weapon.AmmoType "PP7Clip"
	Weapon.AmmoType2 "9mmBullets"
	Weapon.UpSound "misc/w_pkup"
	Weapon.SisterWeapon "PP7Paintball"
	Obituary "%o was capped by %k's PP7."
	+WEAPON.WIMPY_WEAPON
	//+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	+WEAPON.AMMO_OPTIONAL
	+WEAPON.NOAUTOFIRE
	Inventory.Pickupmessage "PP7"
	Radius 20
	Height 16
	Attacksound "weapons/pistol"
	States
	{
	Ready:
	 PP7G A 0 A_WeaponReady
	// goto ReloadCheck
	 PP7G AA 1 A_WeaponReady
	 PP7G A 0 A_TakeInventory("PP7Accuracy", 1)
	 goto Ready+1

	ReloadCheck:
	 PP7G A 0 A_JumpIfInventory("PP7Clip",7,2)
	 PP7G A 0 A_JumpIfInventory("9mmBullets",1,"ReloadStart")
	 PP7G A 0
	 goto Ready+1

	ReloadStart:
	 PP7R A 0 A_PlayWeaponSound("WeaponReload")
	 PP7R A 0 A_TakeInventory("PP7Accuracy", 2)
	 PP7R ABCDEFG 1
	 TNT1 A 5
	 goto ReloadAmmo

	ReloadAmmo:
	 TNT1 A 0 A_TakeInventory("9mmBullets",1)
	 TNT1 A 0 A_GiveInventory("PP7Clip",1)
	 TNT1 A 0 A_JumpIfInventory("PP7Clip",7,"ReloadDone")
	 TNT1 A 0 A_JumpIfInventory("9mmBullets",1,"ReloadAmmo")
	 goto ReloadDone

	ReloadDone:
	 TNT1 A 5
	 PP7R GFEDCBA 1
	 goto Ready+1

	Deselect:
		PP7G A 1 A_Lower
		TNT1 A 0 A_Lower
		Loop
	Select:
		PP7G A 1 A_Raise
		TNT1 A 0 A_Raise
		Loop
	Fire:
		PP7G A 0 A_JumpIfNoAmmo("ReloadCheck")
		PP7G B 0 BRIGHT A_Gunflash
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 8, "FireAccuracy8")
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 7, "FireAccuracy7")
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 6, "FireAccuracy6")
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 5, "FireAccuracy5")
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 4, "FireAccuracy4")
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 3, "FireAccuracy3")
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 2, "FireAccuracy2")
		PP7G B 0 A_JumpIfInventory("PP7Accuracy", 1, "FireAccuracy1")
		goto FireAccuracy0
	FireAccuracy0:
		PP7G B 1 BRIGHT A_FireBullets (0, 0, -1, 6, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

  	FireAccuracy1:
		PP7G B 1 BRIGHT A_FireBullets (1, 0.5, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

  	FireAccuracy2:
		PP7G B 1 BRIGHT A_FireBullets (1, 1, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

	FireAccuracy3:
		PP7G B 1 BRIGHT A_FireBullets (1.5, 1, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

	FireAccuracy4:
		PP7G B 1 BRIGHT A_FireBullets (1.8, 1.5, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

	FireAccuracy5:
		PP7G B 1 BRIGHT A_FireBullets (2, 1.5, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

	FireAccuracy6:
		PP7G B 1 BRIGHT A_FireBullets (2, 2, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

	FireAccuracy7:
		PP7G B 1 BRIGHT A_FireBullets (2.5, 2, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

	FireAccuracy8:
		PP7G B 1 BRIGHT A_FireBullets (3, 3, -1, 5, "BulletPuff")
		PP7G B 0 A_GiveInventory("PP7Accuracy", 1)
		goto FireDone

	FireDone:
		PP7G B 0 BRIGHT A_FireCustomMissile ("BulletCasing", Random(-40, -50), 0, 1, 7, 0)
		PP7G CD 1
		PP7G E 1 A_WeaponReady(WRF_NOBOB)
		PP7G F 2 A_WeaponReady(WRF_NOBOB)
		PP7G G 1 A_WeaponReady(WRF_NOBOB)
		PP7G G 0 A_TakeInventory("PP7Accuracy", 1)
		PP7G G 1 A_WeaponReady(WRF_NOBOB)
		PP7G G 0 A_TakeInventory("PP7Accuracy", 1)
		PP7G A 3 A_WeaponReady
		PP7G A 0 A_ReFire
		Goto Ready+1
	AltFire:
		TNT1 A 0
		goto ReloadCheck
	Flash:
		TNT1 A 2 Bright A_Light1
		TNT1 A 0 Bright A_Light0
		stop
	Spawn:
		PIST A -1
		Stop
	}
}
Bulletpuff Code:

Code: Select all

actor BulletSpark Replaces BulletPuff
{
  spawnid 131
  renderstyle Add
  alpha 0.9
  +NOBLOCKMAP
  +NOGRAVITY
  -ALLOWPARTICLES
  +DONTSPLASH
  +FORCEXYBILLBOARD
  Scale 0.17
  states
  {
  Spawn:
	SPRK A 0
	SPRK A 0 A_SpawnItemEx("BulletSmoke", 0, 0, 0, 0, 0, 0, 0, 128, 0)
	SPRK A 0 A_SpawnItemEx("BulletHeat", 0, 0, 0, 0, 0, 0, 0, 128, 64)
	SPRK A 0 A_SpawnItemEx("Ricochet", 0, 0, 0, 0, 0, 0, 0, 128, 168)
	SPRK AAA 0 A_SpawnItemEx("Debris1", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK AAA 0 A_SpawnItemEx("Debris2", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK AAA 0 A_SpawnItemEx("Debris3", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK AAA 0 A_SpawnItemEx("Debris4", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK A 0 A_SpawnItemEx("Debris5", 0, 0, 0, Random(-1, 1), Random(-1, 1), Random(0, 2), Random(-360, 360), 128, 164)
	SPRK A 0 A_Jump(127, "Spawn2", "Spawn3", "Spawn4")
	SPRK ABCDE 1 bright
	stop
  Spawn2:
  	SPR2 ABCDE 1 bright
	stop
  Spawn3:
  	SPR3 ABCDE 1 bright
	stop
  Spawn4:
  	SPR4 ABCDE 1 bright
	stop
  Melee:
	PUFF CD 4
	stop
  }
}

RE: 3D Tracer Not Appearing

Posted: Sun Aug 16, 2015 10:36 pm
by Chronos Ouroboros
The tracer has nothing to do with the engine. The engine has no function for doing tracers (Other than A_RailAttack).
The bullet puff (It has PUFFGETSOWNER) spawns an actor (Using A_SpawnItemEx with SXF_SETMASTER and SXF_TRANSFERPOINTERS) that uses A_Fire to go to the firer's position. After that, the actor spawns a tracer projectile.
What is happening here is that the tracer projectile is spawned inside the Spider Mastermind because it's too big. The call to A_Fire in the DECORATE code in the PK3 is "A_Fire (32)", which I think moves the actor to 32 mapunits in front of the target's center.

RE: 3D Tracer Not Appearing

Posted: Mon Aug 17, 2015 2:54 am
by Hornetzero
Thanks jwaffe. I didn't realize the problem was because of the Spider Mastermind's size. There is just one additional problem though. The tracers for some reason, don't appear when you aim too high or too low. :(

@Chronos Ouroboros: Thanks for informing about the size issue. Although I didn't quite get what you meant with your last sentence regarding A_fire(32). Is this the segment of the code that's causing the problem, or an engine issue in placing tracers out of the massive body of the Spider Mastermind.

Regardless, I would really appreciate more details.

@Revilution: Thanks for the input. I'm interested in learning about this ACS script ArcTangent wrote for making Laser beams. Would you have a link?

RE: 3D Tracer Not Appearing

Posted: Mon Aug 17, 2015 3:28 am
by Zanieon
NP, but well, i didn't find anything here about, but Arctangent posted this on Zdoom forums.