by vAethor » Wed Apr 04, 2018 12:33 pm
I'm going to be making enemies, the player (when viewed in third-person) and other objects composed of multiple actors in order to make animation easier and also to allow realistic damage mechanics when shooting different parts of the enemies or player. To do that I know I need to use A_Warp for all that, but I don't even know where to begin. I read up on it as much as I could on the Zdoom Wiki and was still unable to figure out what to do.
For practice I tried to use it in a project I started where I created a software-friendly brightmaps alternative for sprites, spawning the brightmap as a separate actor with A_SpawnItemEx and placing it right on top of the base sprite with no offsets. It looks pretty good:
Realizing this actor, who will eventually be the player (I have him set as an ExplosiveBarrel replacement just to see him in third person and test stuff out) is going to be moving around a lot I tried to use A_Warp to keep the brightmap on the base actor, but then after shooting the actor to slide it a short distance away, I notice the brightmap stays in place:
Here's my code:
Code: Select all
// Kyrdan knight actor (Simple actor replacement test)
actor KyrdanKnight : ExplosiveBarrel replaces ExplosiveBarrel
{
Radius 20
Height 56
Scale 0.3
States
{
Spawn:
KYRD A 0
TNT1 A 0 A_SpawnItemEx("KyrGlowmap", 0, 0, 0) // Spawn the brightmap
KYRD A -1
Stop
}
}
// The eye glow (software-friendly brightmap!)
Actor KyrGlowmap
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
+NOTONAUTOMAP
renderstyle Add
Scale 0.3 // It was off before because I forgot to set the scale here
States
{
Spawn:
KGLW A -1 Bright
TNT1 A 0 A_Warp(AAPTR_MASTER, 0, 0, 0)
Stop
}
}
I'm guessing it must be something off with the actor pointer, but I really don't know. Any help would be highly appreciated as I eventually want to make this entity and many of the enemies have separate actors for the head, body, arms, legs, etc. which all need to move in unison, along with more software brightmaps for glowing parts, muzzle flash, etc. But for now I'm just worried about this brightmap.
While I wait for replies I can separate this knight into separate actors for the head, body, arms and legs and start a new PK3 that does this.
I'm going to be making enemies, the player (when viewed in third-person) and other objects composed of multiple actors in order to make animation easier and also to allow realistic damage mechanics when shooting different parts of the enemies or player. To do that I know I need to use A_Warp for all that, but I don't even know where to begin. I read up on it as much as I could on the Zdoom Wiki and was still unable to figure out what to do.
For practice I tried to use it in a project I started where I created a software-friendly brightmaps alternative for sprites, spawning the brightmap as a separate actor with A_SpawnItemEx and placing it right on top of the base sprite with no offsets. It looks pretty good:
[img]https://image.ibb.co/dtKtgc/Screenshot_Doom_20180404_111756.png[/img]
Realizing this actor, who will eventually be the player (I have him set as an ExplosiveBarrel replacement just to see him in third person and test stuff out) is going to be moving around a lot I tried to use A_Warp to keep the brightmap on the base actor, but then after shooting the actor to slide it a short distance away, I notice the brightmap stays in place:
[img]https://image.ibb.co/ci6vux/Screenshot_Doom_20180404_111804.png[/img]
Here's my code:
[code]// Kyrdan knight actor (Simple actor replacement test)
actor KyrdanKnight : ExplosiveBarrel replaces ExplosiveBarrel
{
Radius 20
Height 56
Scale 0.3
States
{
Spawn:
KYRD A 0
TNT1 A 0 A_SpawnItemEx("KyrGlowmap", 0, 0, 0) // Spawn the brightmap
KYRD A -1
Stop
}
}
// The eye glow (software-friendly brightmap!)
Actor KyrGlowmap
{
+NOINTERACTION
+NOGRAVITY
+CLIENTSIDEONLY
+NOTONAUTOMAP
renderstyle Add
Scale 0.3 // It was off before because I forgot to set the scale here
States
{
Spawn:
KGLW A -1 Bright
TNT1 A 0 A_Warp(AAPTR_MASTER, 0, 0, 0)
Stop
}
}[/code]
I'm guessing it must be something off with the actor pointer, but I really don't know. Any help would be highly appreciated as I eventually want to make this entity and many of the enemies have separate actors for the head, body, arms, legs, etc. which all need to move in unison, along with more software brightmaps for glowing parts, muzzle flash, etc. But for now I'm just worried about this brightmap.
While I wait for replies I can separate this knight into separate actors for the head, body, arms and legs and start a new PK3 that does this.