need a simple script for a mod.

alright so im new to these forums. as a quick introduction, my name is Olli and i am currently working on creating a modification for the game Crysis.

anyways, now to the script.
I have a flag animation on an editable mesh object (which is a plane). i made it with the cloth tool.

now i need a script which places a bone on every single vertex of the flag (it has around 150 vertices) and the script should also align the bones to move according to the vertices for the duration of the animation (a bit less than 500 frames)

so basically, i want to transfer the vertex animation of my flag in to a bone animation, which i can then in turn import in to the engine.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Graph's picture

not possible but still possible :P

well its not possible to create bones via maxScript, even with cheats

but just skin your flag to some boxes, as you might know custom rig are supported so simple geo will do aswell :P

i didnt instruct you to do anything i just "pointed you at some doors" but you decided to have a fit and jump out the window, lol
just because you cant use something doesnt mean its broken, you clearly never worked with the first sandbox :P

heres some code that does the boxMode

(
	boxSize = 1
	frameStepping = 2	
	-------------------------------------------------------
	local obj = selection[1]
	if isValidNode obj do
	(
		local tMesh = obj.mesh
		local boxes = for i=1 to tMesh.numVerts collect box width:boxSize height:boxSize length:boxSize
		with animate true for t=animationRange.start.frame to animationRange.end.frame by frameStepping do at time t for i=1 to tMesh.numVerts do boxes[i].pos=((getVert obj.mesh i)*obj.transform) 
	)
)

Raphael Steves

Olli.'s picture

thanks! that did the trick.

thanks! that did the trick.

Graph's picture

wow dude thats waaay to much

wow dude thats waaay to much even for the CE
you can use rt cloth in the CE by exporting a box (not plane) with vertColors for the influences, then set it up as a cloth entity in the engine

take a look here: http://www.crymod.com/board.php?boardid=85

or you can just use/export vertex animations, wich .. again .. costs too much

Raphael Steves

Olli.'s picture

first of all, the cloth

first of all, the cloth entity in CE is very inaccurate.. the way it waves in the wind doesnt look realistic at all. Im not going to overload the map with these, and because of the bone rig im trying to create, it wont take any more processing power than a standard character.

edit: all i want is the script that bakes the vertex animation in to bones..

edit2: also noticed you instructed me to use the export vertex animations feature in the exporter tool, but ive tested that and done research on it and the whole feature is outdated and broken.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.