Page 1 of 1

[r89]GZDoom crashes when using my custom flashlight

Posted: Sat Apr 19, 2008 15:31
by DoomerMrT
Here's the situation: I've made a flashlight long time ago, it was perfectly compatible with 1.1.0 but when I am using it for several secs in r89, the game crashes with the report sending message.
The flashlight shoots bullets, and the bullet puff has a dynamic light assigned to it what does the flashlight feeling.

DECORATE:

[spoiler]actor Flashlight : DoomWeapon 3119
{
Game Doom
Weapon.SelectionOrder 8000
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.AmmoType "None"
+WEAPON.NOALERT
States
{
Ready:
TNT1 A 1 A_WeaponReady
Loop
Deselect:
TNT1 A 1 A_Lower
Loop
Select:
TNT1 A 1 A_Raise
Loop
Fire:
TNT1 A 1 A_FireBullets(0,0,1,0,"DummyPuff",0,2048)
Goto Ready
Spawn:
MGUN A -1
Stop
}
}[/spoiler]

Posted: Sat Apr 19, 2008 17:28
by Graf Zahl
Please post a WAD that contains everything related to the weapon, i.e. the puff and the dynamic light as well. This is not enough to test it.

Posted: Sat Apr 19, 2008 17:50
by DoomerMrT
Ok, these left only:

DECORATE:

[spoiler]actor Flashlight : DoomWeapon 3119
{
Game Doom
Weapon.SelectionOrder 8000
Weapon.AmmoUse 0
Weapon.AmmoGive 0
Weapon.AmmoType "None"
+WEAPON.NOALERT
States
{
Ready:
TNT1 A 1 A_WeaponReady
Loop
Deselect:
TNT1 A 1 A_Lower
Loop
Select:
TNT1 A 1 A_Raise
Loop
Fire:
TNT1 A 1 A_FireBullets(0,0,1,0,"DummyPuff",0,2048)
Goto Ready
Spawn:
MGUN A -1
Stop
}
}




ACTOR None : Ammo
{
Inventory.MaxAmount 0
}



actor DummyPuff
{
renderstyle Translucent
alpha 0.5
+NOBLOCKMAP
+NOGRAVITY
-ALLOWPARTICLES
+BLOODLESSIMPACT
+PUFFONACTORS
states
{
Spawn:
NULL A 1 bright
Melee:
NULL A 1
stop
}
}[/spoiler]


KEYCONF:


[spoiler]addmenukey "Flashlight" lamp
alias lamp "use Flashlight"
defaultbind f lamp[/spoiler]


GLDEFS:

[spoiler]object DummyPuff
{
frame NULL { light FLSH }
}


pointlight FLSH
{
color 1.0 1.0 1.0
size 32
offset 0 0 0
}[/spoiler]

EDIT:While making the example wad and testing it in Doom2 maps, the crash did not happened.Strange.Perhaps something is wrong in my wad.

Posted: Sun May 11, 2008 16:37
by Whoo
Well it may be the way you are defining the flashlight. Here's a code that seems to work very well as a flashlight.

Decorate
[spoiler]ACTOR Flashlight : Weapon 13370
{
+NOALERT
weapon.selectionorder 3000
States
{
ready:
FLAS B 0 A_FireBullets(0, 0, 1, 0, "LightPuff", 0)
FLAS A 1 A_WeaponReady
loop
deselect:
FLAS A 1 A_Lower
loop
select:
FLAS A 1 A_Raise
loop
fire:
FLAS B 1 A_AlertMonsters
FLAS B 1 A_ReFire
goto ready
}
}

ACTOR LightPuff : BulletPuff
{
+NOBLOCKMAP
+NOGRAVITY
+NOBLOOD
-BLOODSPLATTER
+BLOODLESSIMPACT
alpha 0.5
States
{
spawn:
TNT1 A 4 bright
melee:
TNT1 A 4
goto death
}
}[/spoiler]

Keyconf:
[spoiler]setslot 1 Flashlight[/spoiler]

GLDEFS:
[spoiler]pointlight FLASHLIGHTGL
{
color 0.8 0.9 0.4
size 20
subtractive 0
}

object LightPuff
{
frame TNT1 { light FLASHLIGHTGL }
}[/spoiler]

After that you get a cool looking flashlight:

Image

Posted: Thu May 15, 2008 18:47
by DoomerMrT
Thanks for the code, will check it out

Posted: Thu May 15, 2008 20:42
by Enjay
I wonder if it is the same bug as this one?

http://forum.drdteam.org/viewtopic.php?t=3265

Posted: Thu May 15, 2008 21:27
by Graf Zahl
It is.