Previous Blog Next Blog
Prev/Next Blog
by date

Plan for Owen Ashcroft

Plan for Owen Ashcroft
Name:Owen "WDA" Ashcroft 
Date Posted:Jul 15, 2002
Rating:Not Rated
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Owen "WDA" Ashcroft

Blog post
Particles, particles and more particles
Unlike others I'm really quite happy with the current particle engine that Torque currently offers, however I have some things I am looking into, I'm sure others can tell me how to do it efficiently but that really isn't the point of this exercise.

Basically what I am looking at doing is prototyping my idea for the spells system I think would fit Realm Wars, it has already been accepted reasonably warmily but the creation of a spell with the various effects will hopefully pursuade James that I am onto a "good thing" here :)

Regardless my current challenge is to combine weapon charging I worked on today and failed with due to the fact the datablock system is bloody annoying, with a modifiable particle effect, the problem is that the datablocks constantly effect the value, so you create a new projectile and then change the datablock back it effects the existing projectiles, what needs to be done is to create distinct datablocks for each projectile, so once created they are unique until they "die", what makes this worse is that I can't even pass a modifier value as each shot fired will modify that value, ARGHH! I am going to have to figure this out as it is frustrating and seems to be impossible to sort out via scripting.

Anyway off to bed it is 4:10 in the morning and I should have been in bed 3 hours ago, perhaps a fresh perspective will prevail.

Oh well

Owen
- Realm Wars is good for you!
----------------------------------------------
A nights sleep has helped I have messed around a bit more and it would appear that modification to damage will have to be made at ShapeBase::damage, which is ok, however it means that a modifier variable will have to be passed in to the source code, which is a pain if ever I knew it. Oh well.

Recent Blog Posts
List:09/14/04 - Plan for Owen "WDA" Ashcroft
12/09/03 - Plan for Owen "WDA" Ashcroft
12/26/02 - Plan for Owen "WDA" Ashcroft
07/15/02 - Plan for Owen Ashcroft
05/26/02 - Plan for Owen Ashcroft

Submit ResourceSubmit your own resources!

Ben -Djaggernaut- Chavigner   (Jul 15, 2002 at 09:38 GMT)
Owen, ask Phil about this, cause I know he had made some particules effects before...

Owen "WDA" Ashcroft   (Jul 15, 2002 at 15:11 GMT)
It's not so much the particle effects more modifying them on the fly which I am trying to figure out.

Eric Forhan   (Jul 15, 2002 at 16:34 GMT)
How do you mean, Owen?

I'm very interested in learning all I can about the particle engine. I've done alot of work with it, but I know there is more.

Owen "WDA" Ashcroft   (Jul 15, 2002 at 16:57 GMT)
basically the engine constantly refers to the datablock with the information, it doesn't, once creating an emitter, make it a datablock of its own to refer to, but constantly checks the original datablock. Try this for example:

Goto to crossbow.cs and do this:
- in datablock ShapeBaseImageData (CrossbowImage)

add the variables:

original_sizes[0] = 0.25;
original_sizes[1] = 0.5;
original_sizes[2] = 1;

scroll down to state[2] (the ready to fire state) and add:
stateSequence[2] = "ResetDataBlock";
then scroll down to the function OnFire and add just below %projectile = %this.projectile:
%this.original_sizes[0] = %projectile.particleEmitter.particles.sizes[0];
%this.original_sizes[1] = %projectile.particleEmitter.particles.sizes[1];
%this.original_sizes[2] = %projectile.particleEmitter.particles.sizes[2];
followed by
%projectile.particleEmitter.particles.sizes[0] = 50;
%projectile.particleEmitter.particles.sizes[1] = 50;
%projectile.particleEmitter.particles.sizes[2] = 50;
Once that is done scroll to the bottom and add:
function ResetDataBlock(%this)
{
projectile.particleEmitter.particles.sizes[0] = this.original_sizes[0];
%projectile.particleEmitter.particles.sizes[1] = this.original_sizes[0];
%projectile.particleEmitter.particles.sizes[2] = this.original_sizes[0];
}

What this will do is give you huge particles until the reload animation has finished, then the crossbow trail will return to original, which is what has frustrated me, because I would have much rathered that Torque create a temporary Data Block for that projectile alone, instead it will require a lot more playing. This problem extends to all datablocks, if you wish to modify the damage it will modify the damage of all projectiles currently in flight, and the next projectile fired will modify yours and other projectiles in the air e.t.c

Instead what now has to be done is modification to the actual code as new value, a modifier, has to be passed into the engine, so when it gets to the area that actually implements that specific projectiles particles the modifier can be applied there, rather than very neatly in one script.
Edited on Jul 15, 2002 17:00 GMT

Eric Forhan   (Jul 15, 2002 at 18:49 GMT)
Hhmmm... I guess I still don't understand. You want it to stay large, right?

I inserted what you have, above, and it seems to be working fine. No matter how many shots I fired, it stayed with the large particle. I even ran out and had to go get more bolts and it still did this.

I re-read your .plan. I'm presuming you are wanting to make a weapon that will increase in power the longer you hold the fire button?

It seems like I've seen a T2 forum with thoughts on something like this. I'll have to check it out and get back to you.

Eric Forhan   (Jul 15, 2002 at 19:33 GMT)
Here's a T2 tutorial: www.mage-tower.com/BadShot/TutorialChargingPlasmaCannon.html
However, it apparently uses several projectiles to cause the charging effect.

Which brings to mind an idea: Have you considered making the weapon shoot more bolts at once--only side by side/clustered?

Owen "WDA" Ashcroft   (Jul 15, 2002 at 21:09 GMT)
That's the sort of system I want to avoid.

Also the multiple bolts I don't want to do. I have the source so I may as well do it properly.

Owen "WDA" Ashcroft   (Jul 15, 2002 at 21:34 GMT)
Figured out the damage bit can go through scripting which is nice.. Particles next (GAH!)

Owen "WDA" Ashcroft   (Jul 16, 2002 at 01:24 GMT)
Ok passed the modifier through to the engine, now all I need to do is rewrite the particle system a little so that I can pass the modifier through to it and let it increase the size of the particles (crazy!)

You must be a member and be logged in to either append comments or rate this resource.