HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

Author Topic: [Resolved] Weapon trails?  (Read 2353 times)

Legacy

  • General Accounts
  • *
  • Posts: 117
    • View Profile
[Resolved] Weapon trails?
« on: May 03, 12, 05:11:17 AM »

Hello, my aim is to create trails behind melee weapons (like swords - see this video from Gothic: http://www.youtube.com/watch?feature=player_detailpage&v=rqGbyoz7HvM#t=19s). I checked the particle effects and it is indeed possible to have a trail behind a particle but I am struggling with the very basic setup of this. COuld anyone point me in the right direction?
Thanks

EDIT: I just found the HSL trail functions on the particle effects page. I will try to experiment with that. Was not immediately apparent you can use trails without particles :)
« Last Edit: Oct 31, 12, 04:24:28 PM by HE-Cooper »
Logged

jcsmith562

  • General Accounts
  • *
  • Posts: 190
    • View Profile
Re: Weapon trails?
« Reply #1 on: May 03, 12, 02:26:08 PM »

In Hero's Journey if memory serves correct they had a cage around their weapon meshes and they particles from the cage using an addition to the FX system which would emit particles from the weapon cage.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Weapon trails?
« Reply #2 on: May 03, 12, 06:53:45 PM »

Right, all you really need is to use a surface emitter and specify the MeshFileName to indicate the shape it should take.

The "cages" in HJ Ref are modified versions of models such as weapons which do not have all of the geometry of the normal model.  For example if you want particles on an ax, if you use the ax model for the emitter shape the particles will be all over it.  If you want them only on the blade, you would create a model that is just the blade (its "cage") and use that for the shape of the emitter and then parent the emitter to the actual ax with the proper offset to align it correctly.

So, you can see use of the cages is optional.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

HE-BENNETT

  • HeroEngine
  • *****
  • Posts: 559
    • View Profile
Re: Weapon trails?
« Reply #3 on: May 04, 12, 07:47:02 AM »

The ax in the FPS demo works exactly how you just described :)
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Weapon trails?
« Reply #4 on: May 05, 12, 03:33:48 PM »

We have been trying to get an fx working for the emitter mesh attach.  So far we got to the point of being ready to call

     CustomizeParticleSpec(emitter, "MeshFileName", ourFileNamePath)

where ourFileNamePath is a path to a model asset in our repo.  Just prior to calling it we confirm that the emitter is of type EmitterMeshNode and confirmed the path via println.  The emitter works fine on its own, but when we use the CustomizeParticleSpec line, there is no particle effect visible.

We based our code on how HJFXUTILSClassMethods works in HJ Ref.  Still, I wonder if the tasks in the fx editor are not set properly.

I looked at the list of fx in HJ Ref, but there are so many.  My question is, do you know of one that works and uses the emitter mesh attach task so I can take a look at that?
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Weapon trails?
« Reply #5 on: May 05, 12, 03:55:21 PM »

Update:

Wrote a test function in a client script:

Code: [Select]
public function EmitterSpec(input as String)
  tokens as List of String
  Tokenize(input, tokens)
  CustomizeParticleSpec(tokens[1], "MeshFileName", tokens[2])
.

In an area, I created an instance of a surface emitter.  With it selected, I can see the mesh it uses as a wireframe, and the particles come off it as they should.

I get the ID of it from the properties panel and use that in the above function call via the console to change the meshfilename.  I then see the wireframe change to the new mesh outline, but the particle freeze and no longer update.

It seems the emitter is being stopped, or something.  Any idea how to start it again?
« Last Edit: May 05, 12, 03:57:28 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

HE-Cooper

  • *****
  • Posts: 2221
    • View Profile
Re: Weapon trails?
« Reply #6 on: May 05, 12, 05:55:17 PM »

I migh be misunderstanding, but have you checked how the axe works in fps demo? I think that's what you are trying to do.
Logged

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
Re: Weapon trails?
« Reply #7 on: May 05, 12, 09:53:16 PM »

I hadn't looked at the FPS ref lately, but I see know that it uses blade_effect.prt in the AxePersistent fx, but that particle effect already has the meshfilename for the axe set beforehand.

The one we are trying to work like is specifically called "AdaptMeshEmitter", which is not in the FPS ref, and there appear to be no calls to CustomizeParticleSpec() anywhere in the FPS code.

I did find just now that the Shaman Nature's Hate fx uses the AdaptMeshEmitter task.  I'll try comparing that fx and the emitter to ours, as well as trying ours with different emitters.
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.

FI-ScottZ

  • General Accounts
  • *
  • Posts: 1407
    • View Profile
    • Forever Interactive, Inc.
CustomizeParticleSpec bugged?
« Reply #8 on: May 07, 12, 05:39:59 PM »

I am now wondering if this might be a bug.  I started with a much simpler set up as an experiment.  Perhaps someone from Idea Fabrik can try this and confirm.

After reading the Particle Surface Emitter tutorial, this is what I did:

  • Saved the "Sample Fire 01.jpg" image as a png image and uploaded to our repo.
  • Went to an Edit instance of an empty area.
  • From the Create menu, Particle --> New Particle Spec --> Local
  • Named the emitter explosionMESH_fire, as the tutorial suggested.
  • Made the emitter be type EMITTER_MESH
  • Left the particle as BILLBOARD_POINT and entered the path to the fire image in the repo.
  • Create --> Particle --> explosionmesh_fire.prt
  • I could not find any oil barrel, so I set MeshFileName of the emitter spec to "world\livecontent\Resources\common\furniture\chair_common.gr2".  The wireframe outline of the chair showed and the particles emitted fine.
  • I set the MeshFileName in the properties window to "world\livecontent\Resources\common\furniture\square_table_common_01.gr2" and the wireframe changed and the particles emitted relative to that shape fine.  I switched back and forth via the properties window many times with no problem.
  • With the emitter instance selected, I copied the GUID and created a client function calling CustomizeParticleSpec(9223372069526791527, "MeshFileName", "world\livecontent\Resources\common\furniture\chair_common.gr2")  except, of course, using the actual ID I had copied for that instance.
  • When I ran that function from the Console, the particles froze and no longer updated.  I could not get it going again.

I found the one FX in HJ Ref (Nature's Hate) that uses the attach task which uses CustomizeParticleSpec in a similar way and it seems to play the effect fine when previewed.  However, I know that code is from an older version of the engine; for instance, it is still using the property name "GrannyFileName" instead of MeshFileName.

So I wonder if perhaps due to the changes that happened since, this function no longer works, at least not for MeshFileName.  Just on a lark I tried "GrannyFileName" as well, but no dice.  Furthermore, printing out the return value for that function call showed the first time it returns false, then true every time after that.
« Last Edit: May 07, 12, 05:41:46 PM by ScottZarnke »
Logged
Scott Zarnke
Lead Programmer, Visions of Zosimos
CTO, Forever Interactive, Inc.