Code: Select all
Model BlasterRedBolt
{
Path "Models"
Model 0 "RedBolt.md3"
Skin 0 "RedBolt.png"
Scale 0.4 3.0 3.0
// Offset -150.0 0.0 5.0
Offset 0.0 0.0 5.0
PITCHFROMMOMENTUM
FrameIndex PRBT A 0 0
}
Moderator: GZDoom Developers
Code: Select all
Model BlasterRedBolt
{
Path "Models"
Model 0 "RedBolt.md3"
Skin 0 "RedBolt.png"
Scale 0.4 3.0 3.0
// Offset -150.0 0.0 5.0
Offset 0.0 0.0 5.0
PITCHFROMMOMENTUM
FrameIndex PRBT A 0 0
}
The curious thing is, I don't see any reference to projectile sprites in the weapon's definition. Here it is:Enjay wrote:Obvious question: does a correctly centred spite appear in the correct position relative to the weapon?
Code: Select all
ACTOR blaster_rifle : BaseWeapon
{
Weapon.AmmoType "energy_cell"
Weapon.AmmoGive 15
Weapon.AmmoUse 2
Weapon.Kickback 10
Weapon.SelectionOrder 8
Weapon.SlotPriority 0
Inventory.Icon "RIFPA0"
Inventory.PickupMessage "blaster rifle"
+WEAPON.AMMO_OPTIONAL
States
{
Spawn:
RIFP A -1
Stop
Ready:
RIFL A 2 A_WeaponReady
Loop
Select:
RIFL A 1 A_Raise
RIFL AA 0 A_Raise
Loop
Deselect:
RIFL A 1 A_Lower
RIFL AA 0 A_Lower
Loop
Fire:
RIFL A 0 A_JumpIfNoAmmo("NoAmmo")
RIFL A 2
RIFF A 4 BRIGHT A_FireCustomMissile("BlasterRedBolt", Random(-1, 1), 1, 5, 0, 0, Random(-1, 1))
RIFF A 0 A_PlaySound("weapon/blaster/fire",CHAN_WEAPON,1.0,0,ATTN_NORM)
RIFF A 0 A_GunFlash
RIFL A 5 A_Refire
Goto Ready
NoAmmo:
RIFL A 12 A_PlaySound("weapon/blaster/empty",CHAN_WEAPON,1.0,0,ATTN_NORM)
RIFL A 0 A_WeaponReady(WRF_NOFIRE)
Goto Ready
Flash:
TNT1 A 1 A_Light(1.0)
TNT1 A 1 A_Light(0.6)
TNT1 A 1 A_Light(0.2)
TNT1 A 1 A_Light(0.0)
Stop
}
}
Actor BlasterRedBolt : StandardRedBolt { Damage (10) -FORCEPAIN }
Actor StandardRedBolt //: FastProjectile
{
Radius 2
Height 2
Speed 60
Projectile
+NOGRAVITY
+FORCEPAIN
DeathSound "BoltExplode"
States
{
Spawn:
PRBT A 1 Bright
Loop
Death:
LPFF ABCDEF 3 Bright
Stop
}
}
Code: Select all
RIFF A 4 BRIGHT A_FireCustomMissile("BlasterRedBolt", Random(-1, 1), 1, 5, 0, 0, Random(-1, 1))
The source file from which I cobbled the MODELDEF code does not have sprites named PRBTA0, which is curious in light of your explanation.Enjay wrote:.... PRBTA (probably PRBTA0) is the sprite that the model is attached to.
This, indeed, solved the problem. For reference, a value of 1 is ideal for my purposes.Cherno wrote:The fourth parameter (5) is the horizontal offset of the spawned projectile. Positive values makes the projectile emerge to the right of the screen center.
Possibly not. If you look in my Genetech mod (I'm not actually encouraging doing so - it's not a simple example), there are lots of model actors and many of them use a huge number of sprites. However, if you look inside the PK3, you won't find those sprites. That's because I used the TEXTURES lump to define literally hundreds of sprites for use in the models - but there is only one graphics lump used by all of the text-defined sprites.ReX wrote:Enjay wrote:The source file from which I cobbled the MODELDEF code does not have sprites named PRBTA0, which is curious in light of your explanation.