A_CustomPunch making a homing projectile pickup

Archive of the old editing forum
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.
Locked
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

A_CustomPunch making a homing projectile pickup

Post by Ghastly »

I've been trying to solve the final problem with my medic gun by trying to think of a solution for 5 minutes a day.

I eventually decided that A_CustomPunch with a custom bulletpuff that creates a pickup would be the best option, but because of ZDooms pickup behaviour, it wouldn't do anything unless the player being healed is moving.

To increase the chances of it getting picked up, I decided to give the invisible pickup with the properties of a homing projectile. What A_SeekerMissile parameters would be the best for something like this, and is there a way to guarantee that it'll home in on the actor that was hit by the punch? Also, if, say, a monster was hit by the punch, what would be a good amount of time before the projectile 'dies' so a player can't pick it up when the monster dies?
User avatar
DBThanatos
Posts: 3101
Joined: Fri Apr 14, 2006 3:17 pm
Location: in "the darkness that lurks in our mind"

Re: A_CustomPunch making a homing projectile pickup

Post by DBThanatos »

Ghastly_dragon wrote:I've been trying to solve the final problem with my medic gun by trying to think of a solution for 5 minutes a day.

I eventually decided that A_CustomPunch with a custom bulletpuff that creates a pickup would be the best option, but because of ZDooms pickup behaviour, it wouldn't do anything unless the player being healed is moving.

To increase the chances of it getting picked up, I decided to give the invisible pickup with the properties of a homing projectile. What A_SeekerMissile parameters would be the best for something like this, and is there a way to guarantee that it'll home in on the actor that was hit by the punch? Also, if, say, a monster was hit by the punch, what would be a good amount of time before the projectile 'dies' so a player can't pick it up when the monster dies?
If i understand correctly, you are doing something like DE soulleech. The problem in that method is that the projectile (healer) wont "seek" you, because the puff in no way was aiming or targeting you.

however you could give the the weapon a custom damage, and to the monsters a custom pain state (with custom painstatechance) in which the monster itself will fire the healing "seeking" missile at you.

it is all theory


DBT
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

Post by Virtue »

Code: Select all

actor gntpuff : BulletPuff
{
  spawnid 131
  renderstyle Translucent
  alpha 0.5
  +NOBLOCKMAP
  +NOGRAVITY
  +PUFFONACTORS
  +NOBLOOD
  +LOOKALLAROUND
  seesound "weapon/gntpow"
  states
  {
  Spawn:
    PUF1 A 0 Bright A_spawnitem("gauntHealthGiver",0,0)
    PUF1 ABCDE 2 bright
  melee:
    PUF1 A 0 Bright A_spawnitem("gauntHealthGiver",0,0)
    PUF1 ABCDE 2 bright
    stop
  crash:  
    PUF1 ABCDE 2 bright
    stop     
  }
}

ACTOR gauntHealthGiver
{   
   Radius 0
   Height 1
   Speed 0
   PROJECTILE
   RENDERSTYLE NONE
   +LOOKALLAROUND
   States
   {
   Spawn:
      NULL A 0 
      NULL A 1 Bright A_Look
      loop
   See:
      NULL A 0 Bright A_FaceTarget
      NULL A 3 Bright A_GiveToTarget("Health",2)
      NULL A 3 Bright
      stop
   }
}
my Gauntlets code, just change the health value to whatever you want it to give you, and enjoy :)
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

Post by Ghastly »

Ack, I keep forgetting to say this. It's for Skulltag coop. I want it to heal the target (another player, not a monster). Other than that, it's like the soul-leech.
Locked

Return to “Editing (Archive)”