Weapon Projectile Question
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Weapon Projectile Question
I'm currently Making a New DECORATE Weapon and y've got this problem...
I want my Weapon to shoot 3 Missile In same Time, But All that i can do is to make him shoot 1 per 1 in one shoot. I want them to be shoot the three one in same time.
What i need to edit to dot that??
I want my Weapon to shoot 3 Missile In same Time, But All that i can do is to make him shoot 1 per 1 in one shoot. I want them to be shoot the three one in same time.
What i need to edit to dot that??
Re: Weapon Projectile Question
I state like
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall")
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
And it shoot them One After One, If anyone understand what i mean, I want them to be Shoot simultaneously With The Stated Fire Rate I want.
Any Help would be great.
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall")
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
And it shoot them One After One, If anyone understand what i mean, I want them to be Shoot simultaneously With The Stated Fire Rate I want.
Any Help would be great.
- ChronoSeth
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: Weapon Projectile Question
Code: Select all
STPO F 0 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO F 0 bright A_FireCustomMissile("SuperPlasmaBall")
STPO F 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
Re: Weapon Projectile Question
Yeah But when i state 0-Duration Frames, My Weapons is so fast that he Shoot the 600 cell Ammo in one Shot, Rofl,
So i wanted a solution to fix that with.
If there a way..?
So i wanted a solution to fix that with.
If there a way..?
Re: Weapon Projectile Question
Posting your full code for that weapon would definitely help.
Re: Weapon Projectile Question
actor SuperPlasmaGun : DoomWeapon 30303
{
Game Doom
Weapon.SelectionOrder 100
Weapon.AmmoUse 1
Weapon.AmmoGive 80
Weapon.AmmoType "Cell"
Inventory.PickupMessage "You Got The Super Plasma Gun!"
States
{
Ready:
STPO A 0 A_PlaySound("weapons/SuperPlasmaGun")
STPO ABC 4 A_WeaponReady
loop
Deselect:
STPO A 0
STPO E 1 A_Lower
loop
Select:
STPO A 1 A_Raise
loop
Fire:
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall")
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
STPO E 4 A_ReFire
Goto Ready
Flash:
STPO F 4 Bright A_Light1
Goto LightDone
STPO G 4 Bright A_Light1
Goto LightDone
Spawn:
STPP A -1
Stop
}
}
That's it, So with this he's shooting Three Ball In One Shot But Not in Same Time, But with Code 1-Duration Frame It Shoot's really fast, which i want, And if i put 0-Duration Frame it's Shoot ridiculously fast like all Cell in one shot Lol, Then i need to set it up so he can Shoot in same Speed but the 3 Missile in Sametime, Not One By One Per Shot.
{
Game Doom
Weapon.SelectionOrder 100
Weapon.AmmoUse 1
Weapon.AmmoGive 80
Weapon.AmmoType "Cell"
Inventory.PickupMessage "You Got The Super Plasma Gun!"
States
{
Ready:
STPO A 0 A_PlaySound("weapons/SuperPlasmaGun")
STPO ABC 4 A_WeaponReady
loop
Deselect:
STPO A 0
STPO E 1 A_Lower
loop
Select:
STPO A 1 A_Raise
loop
Fire:
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall")
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
STPO E 4 A_ReFire
Goto Ready
Flash:
STPO F 4 Bright A_Light1
Goto LightDone
STPO G 4 Bright A_Light1
Goto LightDone
Spawn:
STPP A -1
Stop
}
}
That's it, So with this he's shooting Three Ball In One Shot But Not in Same Time, But with Code 1-Duration Frame It Shoot's really fast, which i want, And if i put 0-Duration Frame it's Shoot ridiculously fast like all Cell in one shot Lol, Then i need to set it up so he can Shoot in same Speed but the 3 Missile in Sametime, Not One By One Per Shot.
- cypherphage
- Posts: 213
- Joined: Sun Feb 27, 2011 2:54 am
Re: Weapon Projectile Question
The problem is each time you call a_firecustommissile you use a cell. From the wiki:
A_FireCustomMissile (string missiletype [, angle angle [, bool useammo [, int spawnofs_horz [, int spawnheight [, bool aim[, angle pitch]]]]]])
So, try this:
STPO FGH 0 bright A_FireCustomMissile("SuperPlasmaBall", 1.5,0) //setting use ammo to false
STPO FGH 0 bright A_FireCustomMissile("SuperPlasmaBall",0,0) //ditto
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5,1) //set this way, you now use 1 cell per shot
STPO E 6 A_ReFire //since it seemed like you were saying 0 frame duration was too short, lengthen this frame
if you wanted to use more ammo, just switch it back to useammo on each shot
A_FireCustomMissile (string missiletype [, angle angle [, bool useammo [, int spawnofs_horz [, int spawnheight [, bool aim[, angle pitch]]]]]])
So, try this:
STPO FGH 0 bright A_FireCustomMissile("SuperPlasmaBall", 1.5,0) //setting use ammo to false
STPO FGH 0 bright A_FireCustomMissile("SuperPlasmaBall",0,0) //ditto
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5,1) //set this way, you now use 1 cell per shot
STPO E 6 A_ReFire //since it seemed like you were saying 0 frame duration was too short, lengthen this frame
if you wanted to use more ammo, just switch it back to useammo on each shot
-
- Posts: 5043
- Joined: Sun Nov 14, 2010 12:59 am
Re: Weapon Projectile Question
Also, your weapon calls [wiki]A_FireCustomMissile[/wiki] 9 times in total per fire sequence (three times for each of these frames: "F","G" and "H") resulting in firing 9 projectiles and, ultimately, consuming 9 rounds of ammo.
This is how your Fire state looks like, in fact:
This is how your Fire state looks like, in fact:
Code: Select all
Fire:
STPO F 1 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO G 1 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO H 1 bright A_FireCustomMissile("SuperPlasmaBall", 1.5)
STPO F 1 bright A_FireCustomMissile("SuperPlasmaBall")
STPO G 1 bright A_FireCustomMissile("SuperPlasmaBall")
STPO H 1 bright A_FireCustomMissile("SuperPlasmaBall")
STPO F 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
STPO G 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
STPO H 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5)
STPO E 4 A_ReFire
Goto Ready
Re: Weapon Projectile Question
Then It's these code i need for my weapon to work like i want?cypherphage wrote:The problem is each time you call a_firecustommissile you use a cell. From the wiki:
A_FireCustomMissile (string missiletype [, angle angle [, bool useammo [, int spawnofs_horz [, int spawnheight [, bool aim[, angle pitch]]]]]])
So, try this:
STPO FGH 0 bright A_FireCustomMissile("SuperPlasmaBall", 1.5,0) //setting use ammo to false
STPO FGH 0 bright A_FireCustomMissile("SuperPlasmaBall",0,0) //ditto
STPO FGH 1 bright A_FireCustomMissile("SuperPlasmaBall", -1.5,1) //set this way, you now use 1 cell per shot
STPO E 6 A_ReFire //since it seemed like you were saying 0 frame duration was too short, lengthen this frame
if you wanted to use more ammo, just switch it back to useammo on each shot
Does it fix the issue then
- cypherphage
- Posts: 213
- Joined: Sun Feb 27, 2011 2:54 am
Re: Weapon Projectile Question
Try it? I'm guessing at which part is the problem as your description is a bit vague, post what happens and how that differs from what you want.
- Jekyll Grim Payne
- Global Moderator
- Posts: 1118
- Joined: Mon Jul 21, 2008 4:08 am
- Preferred Pronouns: He/Him
- Graphics Processor: nVidia (Modern GZDoom)
- Contact:
Re: Weapon Projectile Question
Basically, if you want several actions to happen at the same time, tie all the commands up until the very last one to frames with zero length. If you want it to happen not so often... Well, kinda like this:
This way it uses 1 ammo, shoots 3 projectiles and does it at showing frame F. Do it like this if you want it at the end of the animation:
I tie all the actions to zero-length empty frames (TNT1* is emtpy), that's kinda my habit.
Notice that if you tie one command to several frames, it'll be executed several times, so in your original code 9 projectiles are launched, not 3.
Code: Select all
TNT1 A 0 A_FireCustomMissile("SuperPlasmaBall", 1.5,0)
TNT1 A 0 A_FireCustomMissile("SuperPlasmaBall",0,0)
TNT1 A 0 A_FireCustomMissile("SuperPlasmaBall", -1.5,1)
STPO FGH 1 bright
Code: Select all
STPO F 1 bright
STPO G 1 bright
TNT1 A 0 A_FireCustomMissile("SuperPlasmaBall", 1.5,0)
TNT1 A 0 A_FireCustomMissile("SuperPlasmaBall",0,0)
TNT1 A 0 A_FireCustomMissile("SuperPlasmaBall", -1.5,1)
STPO H 1 bright
Notice that if you tie one command to several frames, it'll be executed several times, so in your original code 9 projectiles are launched, not 3.