Joined: 12 Jan 2005, 10:25 Location: Still signing off after all these years
OK, can someone link me to how you use CEG's? More specificaly, for a muzzle flare? In Lua? Maybe I just sux, but I can't seem to piece together the workings from what I can find here.
In the lua scripts forum I posted a directly converted unit for code review. That unit (iirc) the rgm has a muzzle flare emit in the fire weapon 1 block of code.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
I had this too sometimes, no idea why it happens. Had it happen too if the emit point was an empty piece at the end of a barrel and rotating the empty piece did nothing. I have no idea what is going on but it it involves randomly rotating the emit pieces in both script and upspring, deleting it and adding it again and eventually it will work.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
if you get it almost correct by having a muzzle flash that goes 180┬░ in the wrong direction, you can also edit the effect: length = -35, or size = -2 to flip it around.
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
yes, might be something like this: Spring.GetUnitPiecePosDir:
Returns piece position and direction in world space.[...]The position is defined as the position of the first vertex of the piece and it defines direction as the direction in which the line from the first vertex to the second vertex points.
how that matters for empty pieces, I dont know but seems it somehow does.
Joined: 01 Jun 2005, 10:36 Location: The Netherlands
I think it uses an internal function LocalModelPiece::GetEmitDirPos, which uses a vector in the +z direction in piece space if the piece has no vertices, or the vector from (0, 0, 0) to the vertex if the piece has one vertex, or the vector from vertex 1 to vertex 2 if the piece has two vertices.
In other words, a piece with zero vertices should give the same result as a piece with one vertex (0, 0, z) with z > 0, and as a piece with two vertices (0, 0, 0) and (0, 0, z) with z > 0.
(Or in the last case: two vertices (x, y, z) and (x, y, z2) with z2 > z for the same emit direction, but an emit position of (x, y, z) instead of (0, 0, 0).)
Joined: 12 Jan 2005, 10:25 Location: Still signing off after all these years
After a lot of faf I got it to point in the right direction... (put the flare inside another empty object and rotated that parent... only way it seemed to work!)
Now I'm wondering... anyone have an example of how you use "CExpGenSpawner" to que up several effects
Quote:
# You can animate an explosion flip-book style using delays and several bitmaps.
I think I'm using them wrong... each of the two parts work fin if called, but I don't see how the CExpGenSpawner bit works so thatwas my best guess (IE, they will all be called as they have the same name, and the delays wil cause the other effects to start at stagurd times...)
Joined: 12 Jan 2005, 10:25 Location: Still signing off after all these years
Thats one of the threads I was looking at yes... (I do use the forum search you know... ). I can't spot what I've done differently from anyone elses...
Succses! Not the final effect, but I atleast got it to work as expected! Have to remember that when using CExpGenSpawner you have to pass on things like "dir" into the ceg your calling... or it wont work and will bug you for days...
Users browsing this forum: Bing [Bot] and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum