PDA

View Full Version : Stop Staring script


Armin A
01-31-2005, 02:32 PM
I am coding Stop Staring script that will make all reactions that are needed betwin head morphs and interface.
This is how I want reaction to see out when it is finnished.

http://upl.silentwhisper.net/uplfolders/upload6/reactionm.jpg

This is exemple from MaxScript Reference:
----------------------------------------------------------------------
-- Setup a scene

b1 = box name:"box01" pos:[-32.5492,-21.2796,0] -- create two boxes

b2 = box name:"box02" pos:[51.3844,-17.2801,0]

animateonat time 100 b1.pos = [-48.2522,167.132,0] -- animate position of one box

--

-- Assign a reactor, pick the react to object, and create reactions

cont = b2.pos.controller = position_Reactor()

--

-- you can either react to a controller

reactTo cont b1.pos.controller

-- or a node (the World Space position of the box)

-- reactTo cont b1
----------------------------------------------------------------------
I dont know hot to replace "cont=b2.pos.con..." to work witch morphs insted for poistion.

I tryed: cont = head.morpher 4 = position_Reactor()
but get this error "-- No ""="" function for ((prop Morpher $huvud) 1)"

marktsang
01-31-2005, 05:43 PM
dont know hot to replace "cont=b2.pos.con..." to work witch morphs insted for poistion.


hi dylan think you are looking for

$.modifiers[#morpher][i].controller

where i is the morph target index number

mark

Armin A
01-31-2005, 07:49 PM
That didnt work, but I think it is right direction.

I cant get this right:

code: reactTo morph "reactor()"

"reactor()" is one of this:
float_Reactor ...

point3_Reactor ...

position_Reactor ...

rotation_Reactor ...

scale_Reactor ...

marktsang
01-31-2005, 08:16 PM
hi,
i have never used reator controllers at all - not with scripting either but i assume access the controllers in exactly the same way as other controllers -

did you type the line exactly :?

$.modifiers[#morpher][i].controller

you do know that $ is the currently selected object and needs to be replaced by the object pointer of the object containing the morpher modifier

in your case (the example you supplied) this is b2
b2.modifiers[#morpher][i].controller that is assuming there is a morpher modifier on this object.

mark

Armin A
01-31-2005, 08:22 PM
I get this error:

code:
cont = head.modifiers[#morpher][1].controller = float_Reactor()
error:
-- Unknown property: "modifiers" in undefined

code: (witch head slected)
cont = $.modifiers[#morpher][1].value = float_Reactor()
reactTo cont TypeA_point
error:
-- Unable to convert: Controller:Float_Reaction to type: Float
-- Unable to convert: undefined to type: Controller

code:
cont = $head.modifiers[#morpher][2].value = float_Reactor()
error:
-- Unable to convert: Controller:Float_Reaction to type: Float


Thanx for trying to help :thumbsup:

marktsang
01-31-2005, 08:48 PM
hi,
looks like your very new to maxscript - you should read some of the intrductory chapters to understand some basics -

anyway

code: (witch head slected)
cont = $.modifiers[#morpher][1].value = float_Reactor()
reactTo cont TypeA_point
error:
-- Unable to convert: Controller:Float_Reaction to type: Float
-- Unable to convert: undefined to type: Controller


you are trying to convert the value held in the controller to a controller type , this isnt possible - you need -->
cont = $.modifiers[#morpher][1].controller = float_Reactor()

like i said try reading the maxscript reference a bit - its actaully really good when you understand how to understand it :P

good luck with maxscript its very usefull

mark

Martin Andersen
08-09-2005, 09:51 AM
$Box01.modifiers[#morpher][5].controller = float_reactor()

$.modifiers[#PEN_Attribute_Holder_2].Custom_Attributes.Param1.controller = bezier_float ()

cont = $Box01.modifiers[#morpher][5].controller

reactTo cont $box02.modifiers[#PEN_Attribute_Holder_2].Custom_Attributes.param1.controller

CGTalk Moderation
08-09-2005, 09:51 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.