[UPDATE] Zombie Plasma Tank
- Xim
- Topic Author
- Demon
Less
More
- Posts: 33
2 years 9 months ago - 2 years 9 months ago #1
by Xim
[UPDATE] Zombie Plasma Tank was created by Xim
Updates:
-New blue paintjob
-Pilot is ChaingunGuy instead of Zombieman (now each zombie has a tank)
-File is now pk3 instead of wad
Info
Name: Zombie Plasma Tank
Difficulty: Medium
Connection: None
Summon: ZombiePlasmaTank
Melee: No
Distance: Projectile
Type: Human, Undead, Mechanic
Credits
Submitted: Xim
Decorate: Xim, Enjay
GLDEFs: Dreadopp, Xim
Sounds: Id Software, 3DRealms
Sprites: Id Software, 3DRealms
Sprite Edit: Xim, Enjay
Idea Base: Pig Tank from Duke Nukem 3D
Image
File
-New blue paintjob
-Pilot is ChaingunGuy instead of Zombieman (now each zombie has a tank)
-File is now pk3 instead of wad
Info
Name: Zombie Plasma Tank
Difficulty: Medium
Connection: None
Summon: ZombiePlasmaTank
Melee: No
Distance: Projectile
Type: Human, Undead, Mechanic
Credits
Submitted: Xim
Decorate: Xim, Enjay
GLDEFs: Dreadopp, Xim
Sounds: Id Software, 3DRealms
Sprites: Id Software, 3DRealms
Sprite Edit: Xim, Enjay
Idea Base: Pig Tank from Duke Nukem 3D
Image
File
Attachment not found
Last edit: 2 years 9 months ago by Xim. Reason: made image visible
Please Log in or Create an account to join the conversation.
- Gothic
- Moderator
Less
More
- Posts: 1259
2 years 9 months ago #2
by Gothic
Replied by Gothic on topic [UPDATE] Zombie Plasma Tank
Please Log in or Create an account to join the conversation.
- inkoalawetrust
- Moderator
Less
More
- Posts: 254
2 years 9 months ago - 2 years 9 months ago #3
by inkoalawetrust
Replied by inkoalawetrust on topic [UPDATE] Zombie Plasma Tank
The one issue I see is that the chaingunner the tank spawns when destroyed is always hostile, even if the tank itself was friendly before being destroyed. I tried figuring out a Zandronum compatible way to make the tank spawn a friendly chaingunner. But there was no proper way to do it in DECORATE, so I made an ACS script that does that instead:
You'll need to fix the indentation to use proper TAB spaces though. Since those don't transfer over pasted code.
You probably know this, but you'll need to compile the script, add a LOADACS lump with the Library name of the script file in it. And then call the script on the DECORATE definition of the tank using ACS_NamedExecute(). The best place to add it is right after the line that spawns the explosion, so the chaingunner isn't harmed.
Also this isn't really an issue, but the explosion sound is from Half-Life, but only 3D Realms and id Software are credited for the sounds.
Code:
#Library "ZPTKFUNC"
#Include "ZCommon.acs"
Script "SpawnTankChaingunner" (Void)
{
Bool WasTankFriendly = CheckFlag (0,"Friendly");
Int ChaingunGuyTID = UniqueTID();
If (WasTankFriendly)
{
SpawnForced ("ChaingunGuy",GetActorX(0),GetActorY(0),GetActorZ(0),ChaingunGuyTID,GetActorAngle(0) >> 8);
SetActorProperty (ChaingunGuyTID,APROP_Friendly,True);
SetActivator (ChaingunGuyTID);
Thing_ChangeTID (0,0); //Remove the temporary TID.
Terminate;
}
SpawnForced ("ChaingunGuy",GetActorX(0),GetActorY(0),GetActorZ(0),ChaingunGuyTID,GetActorAngle(0));
}
You'll need to fix the indentation to use proper TAB spaces though. Since those don't transfer over pasted code.
You probably know this, but you'll need to compile the script, add a LOADACS lump with the Library name of the script file in it. And then call the script on the DECORATE definition of the tank using ACS_NamedExecute(). The best place to add it is right after the line that spawns the explosion, so the chaingunner isn't harmed.
Also this isn't really an issue, but the explosion sound is from Half-Life, but only 3D Realms and id Software are credited for the sounds.
Last edit: 2 years 9 months ago by inkoalawetrust.
Please Log in or Create an account to join the conversation.
- Gothic
- Moderator
Less
More
- Posts: 1259
2 years 9 months ago - 2 years 9 months ago #4
by Gothic
Replied by Gothic on topic [UPDATE] Zombie Plasma Tank
Looks like I didn't pay too much attention to those details. The chaingunner not being friendly is definitely an issue. I'm sure there might be a more simple solution to the ACS alternative.
Also there's a problem with rotations 6 and 7, they look like this in game:
Since the walking frames flip in game instead of being separate lumps, they don't match with the firing frames.
Also there's a problem with rotations 6 and 7, they look like this in game:
Since the walking frames flip in game instead of being separate lumps, they don't match with the firing frames.
Last edit: 2 years 9 months ago by Gothic.
Please Log in or Create an account to join the conversation.
- Xim
- Topic Author
- Demon
Less
More
- Posts: 33
2 years 9 months ago #5
by Xim
Replied by Xim on topic [UPDATE] Zombie Plasma Tank
ACS is the one code I never quite got the hang of, but I'll see what I can do. Maybe I could also make a ZScript version.
Would the non-friendly gunner problem be present in the other two tank enemies as well?
As for the sprites, I was trying to save space by flipping the moving frames but I guess that made the alignments messed up.
Would the non-friendly gunner problem be present in the other two tank enemies as well?
As for the sprites, I was trying to save space by flipping the moving frames but I guess that made the alignments messed up.
Please Log in or Create an account to join the conversation.
- Gothic
- Moderator
Less
More
- Posts: 1259
2 years 9 months ago - 2 years 9 months ago #6
by Gothic
Replied by Gothic on topic [UPDATE] Zombie Plasma Tank
Moving frames D6 & E6 5 pixels to the right and frames D7 & E7 7 pixels should fix that problem.
Last edit: 2 years 9 months ago by Gothic.
Please Log in or Create an account to join the conversation.
- Xim
- Topic Author
- Demon
Less
More
- Posts: 33
2 years 9 months ago #7
by Xim
Replied by Xim on topic [UPDATE] Zombie Plasma Tank
Here's the updated version.
Attachments:
Please Log in or Create an account to join the conversation.
- Gothic
- Moderator
Less
More
- Posts: 1259
2 years 9 months ago - 2 years 9 months ago #8
by Gothic
Replied by Gothic on topic [UPDATE] Zombie Plasma Tank
Is there any difference between using the ACS method and using SpawnItemEx?
This seems to do the exact same thing, and it works on Zandronum as well, but maybe I'm missing something.
Code:
A_SpawnItemEx("ChaingunGuy",0,0,20,0,0,3,0,SXF_TRANSFERPOINTERS)
This seems to do the exact same thing, and it works on Zandronum as well, but maybe I'm missing something.
Last edit: 2 years 9 months ago by Gothic.
Please Log in or Create an account to join the conversation.
- Xim
- Topic Author
- Demon
Less
More
- Posts: 33
2 years 9 months ago #9
by Xim
Replied by Xim on topic [UPDATE] Zombie Plasma Tank
Yes, that does work just as well, if not better. Less files for the user to put in to their project.
Attachments:
Please Log in or Create an account to join the conversation.
- inkoalawetrust
- Moderator
Less
More
- Posts: 254
2 years 9 months ago - 2 years 9 months ago #10
by inkoalawetrust
Replied by inkoalawetrust on topic [UPDATE] Zombie Plasma Tank
Alright, it
turns out that A_SpawnItemEx actually calls CopyFriendliness internally already
, which is why Gothic's fix works, SXF_TRANSFERPOINTERS isn't necessarily needed either, since once the tank enters it's Death state, its' target field changes to point to the actor that destroyed it, as this is standard ZDoom behavior. And that may cause a friendly tank accidentally destroyed by a player, lead to the spawned friendly chaingunner then attacking the player.
As for my ACS function from earlier, I thought A_SpawnItemEx didn't try transfering allegiances by default, or that if it did, that the code for it just wouldn't work in Zandornum netgames, since none of the pointer transfer flags in A_SpawnItemEx even work well most of the time in multiplayer Zandronum.
Oh yeah, I also had a 100% DECORATE method to make the Chaingunner friendly if the tank was as well, using said pointer transfer flags, and an inventory token, but when I showed it to TDRR, the guy who made TDBots and knows way more about Zandronum modding than any of us do here. He reminded me of how dysfunctional the pointer flags like SXF_SETMASTER are. And that the code would probably not actually work in multiplayer, which would leave ACS as the only alternative, as is so often the case in Zandronum, for anything more sophisticated than a 2011 ZDoom actor.
As for my ACS function from earlier, I thought A_SpawnItemEx didn't try transfering allegiances by default, or that if it did, that the code for it just wouldn't work in Zandornum netgames, since none of the pointer transfer flags in A_SpawnItemEx even work well most of the time in multiplayer Zandronum.
Oh yeah, I also had a 100% DECORATE method to make the Chaingunner friendly if the tank was as well, using said pointer transfer flags, and an inventory token, but when I showed it to TDRR, the guy who made TDBots and knows way more about Zandronum modding than any of us do here. He reminded me of how dysfunctional the pointer flags like SXF_SETMASTER are. And that the code would probably not actually work in multiplayer, which would leave ACS as the only alternative, as is so often the case in Zandronum, for anything more sophisticated than a 2011 ZDoom actor.
I don't think removing Zandronum compatibility on a simple NPC like this is needed. Especially since even if A_SpawnItemEx didn't use CopyFriendliness, it would still be possible to fix this without ditching Zandronum. And yes, this also happens to the other two tanks as well, since they use the DropItem property to spawn their drivers, instead of A_SpawnItemEx.ACS is the one code I never quite got the hang of, but I'll see what I can do. Maybe I could also make a ZScript version.
Would the non-friendly gunner problem be present in the other two tank enemies as well?
Last edit: 2 years 9 months ago by inkoalawetrust.
Please Log in or Create an account to join the conversation.