Solved: Spawning Child Projectile via passed Blueprints

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

Solved: Spawning Child Projectile via passed Blueprints

Postby Resin_Smoker » 12 Feb 2014, 08:34

Pastebin: http://pastebin.com/gp1a5jMb

The above script isn't working yet as I'm having problems passing the projectiles Blueprint location despite the fact it can be found via "GetBlueprint".

My issue is this...

Code: Select all
local projBp = other:GetBlueprint().BlueprintId     
local proj = self:CreateChildProjectile(projBp)


Using...

Code: Select all
WARN(repr(other:GetBlueprint().BlueprintId))


or

Code: Select all
WARN(repr(other:GetBlueprint().Source))


It clearly shows the BP location as : /projectiles/adfdisruptor01/adfdisruptor01_proj.bp
However I'm at a loss as to why this Blueprint data cant be passed as is to create a child projectile.
I know its syntax related but I'm not sure what or why.

Anyone know how this Blueprint can be passed?

Oh in-case anyone hasn't figured it out....
I'm "reflecting" a projectile that hits a shield.
Normally this doesn't work very well with small shields due to the speed of the projectile and the short amount of time it has to register a collision. Hence I'm attempting to come up with a way to destroy the incoming projectile after spawning a clone that's got it's vectors reversed. I believe this should work, that is assuming the Blueprint can be passed from one projectile to another.

Cheers!

Resin
Last edited by Resin_Smoker on 12 Feb 2014, 15:06, edited 1 time in total.
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Spawning Child Projectile via passed Blueprints

Postby Resin_Smoker » 12 Feb 2014, 14:17

Got it working with this change...

Code: Select all
local proj = other:CreateChildProjectile(projBp)
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Solved: Spawning Child Projectile via passed Blueprints

Postby Resin_Smoker » 12 Feb 2014, 15:22

Be warned, that too many projectiles impacting at the same time will make the shields "OnCollisionCheck" unstable and freeze the game.

I 'll have to run this from the projectile side of things the ensure there is only one instance per projectile.

Resin
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times

Re: Solved: Spawning Child Projectile via passed Blueprints

Postby Resin_Smoker » 15 Feb 2014, 02:46

Making great progress with the scripts...

Have the following let to do:

-correct issues with unit damage.

-pull the muzzle velocity of the firing unit and apply it to the new projectile.

-add energy drain each time a project is reflected rather than a fixed Econ amount.
The idea being that having no power may mean not being able to deflect shots. Amount drained per shot could ether be a fixed amount or a % of the incoming damage. (Welcome feed back here)

Note: can't deflect beams yet but will look at this later.

Resin
Resin_Smoker
Evaluator
 
Posts: 858
Joined: 14 Mar 2012, 17:58
Has liked: 54 times
Been liked: 106 times


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest