Spawn/Thing_Projectile/Aimed/Gravity/2 extension.

Moderator: GZDoom Developers

User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Spawn/Thing_Projectile/Aimed/Gravity/2 extension.

Post by solarsnowfall »

Like the recent addition to Radius_Quake, I'd like to see Thing_Projectile and it's derivatives have the ability to treat a TID of 0 as the activator. Why? Because of the greater flexibility of being able to set a dynamic speed and vspeed. I am aware of the ability to set a random pitch via A_CustomMissile, but the base speed of the projectile will always be constant. Being able to directly use Thing_Projectile (or one of it's counterparts) directly in DECORATE one could fire off projectiles with far greater trajectory varience.
Example

Code: Select all

actor W_Drop
{
  height 4
  radius 2
  mass 1
  +MISSILE
  renderstyle Translucent
  alpha 0.75
  states
  {
  Spawn:
    DROP A 1
    loop
  Death:
    DROP A 1 A_FadeOut(0.1)
    loop
  }
}

actor W_Fountain : SwitchableDecoration 20000
{
  +NOGRAVITY +NOCLIP +NOBLOCKMAP +NOSECTOR
  states
  {
  Spawn:
  Active:
    TNT1 A 0
    TNT1 A 1 SpawnProjectile(0, "W_Drop", random(0, 255), random(0, 50), random(0, 25), 1, 0)
    loop
  Inactive:
    TNT1 A 1
    loop
  }
}
Otherwise, someone has to resort to something like this.

Code: Select all

actor W_Drop1
{
  height 4
  radius 2
  mass 1
  speed 12
  +MISSILE
  renderstyle Translucent
  alpha 0.75
  states
  {
  Spawn:
    DROP A 1
    loop
  Death:
    DROP A 1 A_FadeOut(0.1)
    loop
  }
}

actor W_Drop2: W_Drop1
{
  speed 11
}

actor W_Drop3: W_Drop1
{
  speed 10
}

actor W_Drop4: W_Drop1
{
  speed 9
}

actor W_Fountain : SwitchableDecoration 20000
{
  +NOGRAVITY +NOCLIP +NOBLOCKMAP +NOSECTOR
  states
  {
  Spawn:
  Active:
    TNT1 A 0
    TNT1 A 0 A_Jump(192, 2)
    TNT1 A 1 A_CustomMissile("W_Drop1", 0, 0, random(0, 359), 2, random(65, 115)    
    loop
    TNT1 A 0 A_Jump(128, 2)
    TNT1 A 1 A_CustomMissile("W_Drop2", 0, 0, random(0, 359), 2, random(65, 115)    
    loop
    TNT1 A 0 A_Jump(128, 2)
    TNT1 A 1 A_CustomMissile("W_Drop3", 0, 0, random(0, 359), 2, random(65, 115)    
    loop
    TNT1 A 1 A_CustomMissile("W_Drop4", 0, 0, random(0, 359), 2, random(65, 115)    
    loop
  Inactive:
    TNT1 A 1
    loop
  }
}
And even then the results are less desirable. It seems to me there have been a lot of requests for custom particle fountains. I think that DECORATE is already very well set up to make these, to some extent, without some new special custom partical features. Being able to use Thing_Projectile ect like this greatly improves the appearance of such effects while reducing the amount of code needed to create it.

[edit]Argh1! Spelling...
Last edited by solarsnowfall on Sun Aug 20, 2006 4:36 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48368
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

... and brings down the performance even further... :(
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Ah, I hadn't thought if Thing_Projectile would be more demanding than A_CustomMissile. Damn.

Oh well. Used conservatively, some nice effects can be achieved without a lot of noticeable impact to performance. Even with the current limitations.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48368
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

It isn't. But your particles are. Even on my rather fast computer it brings down the performance on Enjay's Thief level to a level I no longer consider comfortable to play.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

If this is added, can you say droppable weapons ;) (Though it can be done already, this would reduce the amount of work that would need to be done.)

[EDIT] Grammar.
Last edited by Theshooter7 on Sun Aug 20, 2006 5:06 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48368
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

You are making no sense at all.
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Graf Zahl wrote:Even on my rather fast computer it brings down the performance on Enjay's Thief level to a level I no longer consider comfortable to play.
Each one of those Thief lights had tripple the amount of projectiles being spawned than what I would consider conservative use. That may not be te best example to go by since my goal was to emulate Thief, rather than doing something very simple.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

solarsnowfall wrote:Like the recent addition to Radius_Quake, I'd like to see Thing_Projectile and it's derivatives have the ability to treat a TID of 0 as the activator.
@Graf: I am assuming this could work with players as well. Thus, with a bit of scripting, you could easily have Thing_Projectile fire a weapon from the player's position, and then use TakeInventory() to take it from the player's inventory (duh). (For it to shoot in the right direction, GetActorAngle() would work) Thus, droppable weapons. The way I am doing it now is using Spawn() to drop the weapon, and then checking if it was successful. If so, it would remove the weapon from the player's inventory.

I hope that made a bit more sense. :?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48368
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

No, it doesn't. It sounds like a bad approach to a simple problem. If you want to drop an item from DECORATE, there's a dedicated code pointer for that already.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

Well, I know. But the thing is that I do not want to write a huge code for many diffrent weapons. Unless there is someway to detemine the current weapon, or use arrays or something.
User avatar
Nash
 
 
Posts: 17322
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Post by Nash »

I agree that there needs to be a way to randomize spawned projectiles speeds so any special effects look better. The way things are is just so montonous.
User avatar
randi
Site Admin
Posts: 7731
Joined: Wed Jul 09, 2003 10:30 pm

Post by randi »

Done.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Post by Theshooter7 »

AWESOME! Thanks Randy! :D
User avatar
Nash
 
 
Posts: 17322
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Post by Nash »

Thank you very much, Randy. You'll be sure that once the changes are commited, plus the new A_JumpSet function, I will be compiling the new version right away. ;)
User avatar
solarsnowfall
Posts: 1581
Joined: Thu Jun 30, 2005 1:44 am

Post by solarsnowfall »

Thanks again randy!

Return to “Closed Feature Suggestions [GZDoom]”