I'm pretty sure that the pickup code is being called before the check to see if the inventory item/weapon can actually be picked up is called. The pickup code runs even when we can't actually pick the weapon up.
That's the point of it. It will always be executed. If it succeeds the item will be picked up. If not the real pickup behavior will decide. How else are you supposed to use it to script your own items? This is not meant to be a replacement for using the pickup special that gets executed when an item is picked up. It is meant to script your own pickup items.
+NOAUTOAIM for weapons, so we can make a weapon that doesn't target at an enemy (Like the railgun)
Rather an option to the firing code pointer than as a flag.
How about a flag for an actor as well so that weapons would not auto aim at that actor if the weapon is fired at it (like the green pods in Heretic)?
I'd rather see a general option that makes aiming smarter. It really shouldn't aim at the first shootable object in sight. The way it is now I find autoaim more a problem than help so I normall play with it being switched off.
Bio Hazard wrote:
Graf Zahl wrote:
Too much work for an unofficial build. Sorry.
Um, isin't that what A_Jiggle() does? And you said that was possible...
How about also including the possibility for weapon sprite offsets, such as those used for hexen weapons? For example, the cleric's mace smoothly falls off the screen and is brought up again. For these weapons, there are certain values set in each frame that indicate the offset for that particular frame.
[/quote]
Already in. Use OFFSET(x,y) in the state definition.
A_MeleeChase -> the monster will chase the enemy without the probability of use the "Missile" state (without far attacking). This can be cool if you want some new reaction from the monster.
Btw, the Fail command still "fails"... if you have a weapon with it and full ammo, if you stay on the weapon sprite and fire, it will fire and receive infinite ammo without the weapon to dissappear...
A_MeleeChase -> the monster will chase the enemy without the probability of use the "Missile" state (without far attacking). This can be cool if you want some new reaction from the monster.
Good thing that I did some changes to A_Chase which makes implementing this a matter of minutes.
Btw, the Fail command still "fails"... if you have a weapon with it and full ammo, if you stay on the weapon sprite and fire, it will fire and receive infinite ammo without the weapon to dissappear...
Not surprising considering that I haven't released it yet!
Sorry, if I must extract the weapon from the wad, it will take some time. It's the SubMachineGun and the DoubleSubMachineGun made by Chaoscentral, that uses something like this:
Pickup:
UZI1 A 0 A_JumpIfInventory("Uzi",1,1)
Fail
UZI1 A 0 A_GiveInventory("DoubleUzi",1)
Fail
When you reach full ammo and shot it a few, if the remain ammo is smaller than the total ammo gived by the weapon(for example you have 296 bullets and the weapon gives you 16), the weapon gives you the ammo but doesn't disappear.
Another bug I've noticed: when you spawn a Friendly monster like the ghosts in Weapon 666, and there is no enemy at sight, if they listen to your shot, they'll become agressive to you, losing the Friendly flag. I need this bug to be fixed urgently, because I have a lot of stuff that needs the Friendly flag, such as the AutoDetectionMine, Ajudant (wish it works like the DarkServant) and the Weapon 666.
That's because 'fail' tells the game that you don't want the weapon to be picked up. Since it doesn't get picked up by its own code as well it remains. After the GiveInventory you have to put a 'stop', not a 'fail'!
But Stop makes that evil "weapon stay" bug: the weapon remais on the floor, being infinitely pickable, when you have full ammo for this weapon. Remembering, this bug appears when you use the PICKUP state.
And about the FRIENDLY bug? Could you take a look for me?
I had an idea: A_JumpIfAmmoLower(x,y) -> jumps y distance if the weapon ammo number is lower than x ammo - this will help to improve some weapon features.
Btw, seems that there isn't possible to a weapon get negative ammo values anymore. I appreciate that!
Daniel wrote:But Stop makes that evil "weapon stay" bug: the weapon remais on the floor, being infinitely pickable, when you have full ammo for this weapon. Remembering, this bug appears when you use the PICKUP state.
That's standard weapon behavior. I can't change that. 'Fail' does not force pickup. It prevents it.
And about the FRIENDLY bug? Could you take a look for me?
It doesn't happen to me and in the last few days I tested a lot with friendly monsters. So either it is a phantom bug or it got fixed already.
Daniel wrote:...when you spawn a Friendly monster like the ghosts in Weapon 666, and there is no enemy at sight, if they listen to your shot, they'll become agressive to you, losing the Friendly flag.
That is definitely not true. I've had hundreds of friendly monsters roaming around the same room with a group of Cajun bots(they like to fire at friendly monsters), and the only time where the monsters turned on the bots was an instance when one bot shot another.
Graf, what Daniel is referring to is a strange bug with one of his weapons in ZDGuns - the 666 Gun. It fires off six friendly ghosts(three red ones which attack, and three transparent ones which resurrect the enemies). However, something goes wrong after a while. When all nearby monsters are dead, and possibly if you fire a shot like Daniel said(though I'm not sure of that part), the red ghosts will turn on the player and start to attack him/her.
EDIT: I found a thread about this. HobbsTiger1 thinks it's the DECORATE, but I figure that you can confirm this.
Daniel wrote:But Stop makes that evil "weapon stay" bug: the weapon remais on the floor, being infinitely pickable, when you have full ammo for this weapon. Remembering, this bug appears when you use the PICKUP state.
Uh, Daniel, use this code first, then tell us whether that nasty bug is still around.