Making a Rock Weapon
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.
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
Making a Rock Weapon
How do you make a weapon the doesn't auto aim, and thrown at an arc? It's a grenade (even though I said rock) throwing attack.
-
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
Try this for a template:
Code: Select all
Actor Fumbler : Weapon 20012
{
obituary "%o fumbled over %k's grenade."
radius 20
height 16
inventory.pickupmessage "You got the Fumbler Grenade Launcher!"
weapon.selectionorder 9
weapon.kickback 100
weapon.ammotype "FumblerAmmo"
weapon.ammouse 1
weapon.ammogive 8
AttackSound "grenade/fire"
Scale 0.25
states
{
Ready:
FUMB A 1 A_WeaponReady
loop
Deselect:
FUMB A 1 A_Lower
loop
Select:
FUMB A 1 A_Raise
loop
Fire:
FUMB E 3
FUMB F 0 BRIGHT A_PlayWeaponSound("grenade/fire")
FUMB F 3 BRIGHT A_FireCustomMissile("FumblerGrenade",2,1,8,3)
FUMB GH 3
FUMB A 0 A_CheckReload
FUMB ABCDEA 3
FUMB A 2 A_ReFire
goto Ready
Spawn:
FUMP A -1
stop
}
}
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
You can have the grenade spawn with ThrustThingZ to start moving at a vertical angle.
For thrown grenades, you'd basically do the same with graphics for the arm throwing the grenade, and either have all instances of the ammo include the "weapon" or create a new playerclass starting out with the "weapon".
If you want to get fancy, I suspect you could use some combination of A_Refire, A_GiveInventory and A_JumpIfInventory to throw different grenades depending on how long you hold down the fire key, each grenade differing in initial force but otherwise exploding similarly.
For thrown grenades, you'd basically do the same with graphics for the arm throwing the grenade, and either have all instances of the ammo include the "weapon" or create a new playerclass starting out with the "weapon".
If you want to get fancy, I suspect you could use some combination of A_Refire, A_GiveInventory and A_JumpIfInventory to throw different grenades depending on how long you hold down the fire key, each grenade differing in initial force but otherwise exploding similarly.
-
- Posts: 598
- Joined: Fri Jun 24, 2005 3:19 am
- Location: Makin tracks with jetboots
- XutaWoo
- Posts: 4005
- Joined: Sat Dec 30, 2006 4:25 pm
- Location: beautiful hills of those who are friends
- Contact:
@Vaecius: Buh? I mean using my grenade base, adding Sersious Sam 2-type grenades, which don't have animations being thrown, just appear, moving in an arc. Of course, there's no auto-aiming in that game, so they're just thrown in an arc. That's what I mean.
@ant Number-Alot: I said in an arc also. Also, I'll use that for rocket-shooting weapons, (Like Double-Cannon Rocket Launcher, Triple-Cannon Launcher) because of fact they are like grenade launchers.
@ant Number-Alot: I said in an arc also. Also, I'll use that for rocket-shooting weapons, (Like Double-Cannon Rocket Launcher, Triple-Cannon Launcher) because of fact they are like grenade launchers.
Re: Making a Rock Weapon
An obvious response...XutaWoo wrote:Making a Rock Weapon

Sorry.

- David Ferstat
- Posts: 1113
- Joined: Wed Jul 16, 2003 8:53 am
- Location: Perth, Western Australia
- Contact:
Re: Making a Rock Weapon
No you ain't.Enjay wrote: Sorry.
Smart-arse.

Re: Making a Rock Weapon
Damn, you got me.David Ferstat wrote:No you ain't.
Smart-arse.

No, sorry I don't. How is the aim paramter of A_FireCustomMissile supposed to work? The Wiki doesn't seem to explain it. Might that be where the answer lies?XutaWoo wrote:Anyway, do you have any idea how to do this, Enjay?
http://www.zdoom.org/wiki/index.php?tit ... tomMissile
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
From what I understand of this explanation and my own observations, aimmode 0 means that the angle only takes efffect after the projectile is already in front of you.
Last edited by Matt on Thu May 31, 2007 12:54 am, edited 1 time in total.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
EDIT: Right, autoaim.
So, in other words:
Mode 0: A line is drawn from the player to the autoaim target. The projectile's angle is adjusted so that its Z angle matches this new line. Used if all you want is to adjust for a lack of vertical aiming.
Mode 1: The projectile's line is drawn. It is adjusted, if close enough, so that it heads directly towards the target. The projectile then fires at this new angle. Used if you want to adjust for a general inability to aim (e.g., a multishot weapon that needs to affect multiple enemies at once).
So, in other words:
Mode 0: A line is drawn from the player to the autoaim target. The projectile's angle is adjusted so that its Z angle matches this new line. Used if all you want is to adjust for a lack of vertical aiming.
Mode 1: The projectile's line is drawn. It is adjusted, if close enough, so that it heads directly towards the target. The projectile then fires at this new angle. Used if you want to adjust for a general inability to aim (e.g., a multishot weapon that needs to affect multiple enemies at once).