how to XP this action


#1

I’m really bad in XP, after all this days of learning, I’m still not sure how it works :cry:, so I decide to ask for help, I’ll start something simple.

    how to XP script an object to follow another object's action?

http://www.youtube.com/watch?v=2ZW-imSR5a8


#2

after I read again my post above, I notice I didn’t made my self clear enough, so sorry about that , I use keyframe offset to achieve the result of the sample movie above, which is quite simple with a just few, but if there is more than 50 or 100 need to do the same thing, thats will take a lot of time,

I know there should be an easier to get the same result with using XP, but how? :shrug:

thanks for helping!


#3

Hey Loon…

The youtube video says its a private video. How do I access that?


#4

opps my mistake, it should be fine now…

http://www.youtube.com/watch?v=2ZW-imSR5a8


#5

Hi Loon,

I’ll knock up an example for you this weekend if someone hasn’t done one before then, but you need to look at Variables page in the XP manual, specifically the “Indexing Custom Values” section.

Here is a code snippet that I’ve edited:

Cube2.Position_X = Cube1.Position_X[ frame - 10 ];

This statement will (in the X axis) make “Cube2” be where “Cube1” was 10 frames ago.

From the manual:
“Note: If you work with indexed channels you need to offset the start frame of Xpressionist in the exectution options in the preferences of Xpressionist. Since Xpressionists start frame is 0 by default a statement as the above will cause Xpressionist to look for a frame previous of frame 0 which is not existent.”

So in this case you would set the start frame to -10.

Hope that at least whets your appetite for XP again :wink:
Ian


#6

Thanks a lot Ian,

I always don’t know where to start when facing the XP scripting, it end up with frustration with no good result, with your clear direction I’ll try something today…:slight_smile:

more question is coming after this…

Loon


#7

it is best not to use the [frame-10] as that will throw an error before frame 10. (there will be no data prior to that frame)

I recommend using a simple equasion:
distance_multiplier = 10;
speed_multiplier = 5;
null.Position.Z = sin(speed_multiplier*frame)*distance_multiplier;


#8

Well, you can make it so XP doesn’t kick in until frame 11. I have to admit I don’t quite understand CJBerg’s formula. How will that result in a follow-the-leader behaviour?


#9

My approach is more about comtrolling the animation you are looking for as opposed to a follow the leader approach. Once you can script the animation, you can repeat it for other objects easily.
Example:
http://homepage.mac.com/bergcj/movs/temp2.mp4
Code:
distance_multiplier = 10;
speed_multiplier = 5;
offset = 10;
nulls = 4;
for (x=0;x<nulls;x=x+1) {
myFrame = x * offset;
if (frame > myFrame) {
time_offset = - offset * x;
$my_object = “null” + x;
$my_object.Position.X = 5 * x + 1;
$my_object.Position.Z = sin(speed_multiplier*(frame+time_offset))*distance_multiplier;
}
}


#10

But I may have misunderstood what you re looking for exactly. If all you want is follow the leader with a frame offset, you can steal the lines that control the offset.

Cj


#11

thanks CJ, the script is a bit complicated for me :eek:, I’ll give it a try, I belive I’ll learn something new :slight_smile:

regards,
Loon


#12

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.