Cacowad
Junior Member

Posts: 229
Registered: 07-12 |
there is! a beta version of the torch, it have a ridiculus ammo usage (each ammo last 1/8 second on a total of 2 minutes duration), i will find out a way to make it work smooth enougth and reduce ammo.
code:
//this is a comment.
//this is a comment too.
Actor torch : weapon 6000
{
Game Doom
Weapon.AmmoGive 960 //is 120*8, this actor use 8 ammo units for second, for a total of 120 seconds usage.
Weapon.AmmoType "torchammo"
Weapon.AmmoUse 32
Weapon.SlotNumber 1
inventory.pickupmessage "a torch"
inventory.pickupsound "optional sound lump name here"
+WEAPON.NOAUTOFIRE
+WEAPON.NOALERT //this weapon will not alert monsters
states
{
Spawn:
TORC A -1
stop
Ready:
TORC A 0 A_WeaponReady
TORC A 4 bright A_spawnitemex ("torchlight", 0, 0,28, 0, 0, 0, 0, SXF_SETMASTER, 0) //spawn a dummy actor that light the area.
TORC A 0 A_jump (256, "burning")
loop
Burning:
TORC A 0 bright A_CheckReload //deselect the torch if there is no more ammo.
TORC A 0 bright A_TakeInventory ("torchammo", 1) //take away 1 unit of ammo.
Goto Ready
Deselect:
TORC A 1 bright A_Lower
TORC A 1 bright
loop
Select:
TORC A 1 bright A_Raise
loop
Fire:
TORC CDEF 3 bright A_spawnitemex ("torchlight", 0, 0,28, 0, 0, 0, 0, SXF_SETMASTER, 0) //a dummy torch attak, just in case you want it.
TORC A 0 bright A_Light2
TORC G 4 bright A_CustomMeleeAttack (7,"optional attack sound here", "optional miss sound here", "fire")
TORC A 1 bright A_Light0
TORC A 0 A_CheckReload
goto Ready
}
}
actor torchammo : Ammo
{
Game Doom
inventory.pickupmessage ""
inventory.amount 960
inventory.maxamount 960
inventory.icon ""
ammo.backpackamount 1920
ammo.backpackmaxamount 1920
states
{
Spawn:
TORG A -1
stop
}
}
ACTOR torchlight //this actor was needed in order to use dynamic ligthing, it seems that can be used only on spawned actors, not on the weapons of the player.
{
Game Doom
Radius 1
Height 1
Speed 0
Damage 0
Projectile
reactiontime 1
States
{
Spawn:
TNT1 A 4 BRIGHT Light ("FLICKER3") A_CountDown //tnt1 is an invisible sprite native in (G)zdoom, this actor will vanish as long as it enter to fake the light of a moving torch.
Loop
Death:
TNT1 A 0 BRIGHT Light ("FLICKER3")
Stop
}
}
i will comment the code later, so you may learn something from it.
no particles added yet.
also i had to modify a bit the gldef. i will try after dinner the other options.
code:
pulselight FLICKER3
{
color 0.30 0.21 0.12
size 800
secondarySize 900
interval 10
}
Last edited by Cacowad on 12-15-12 at 00:26
|