3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Help. Script to play animation frame when you click a sprite  (Read 1437 times)

Mic

« on: November 05, 2009, 10:33:12 PM »
My feeble artist mind can not comprehend this script, yet.... I have come to the aid of our very talented scripters asking for help, and when this is done we should have a great example for everyone else to use.

I would like to be able to have 6 sprites on the screen, and when you click on them they would be tied to a single skin mesh that will go to a single frame and hold. Using the capsule as an example, it has 000_mesh.x, 001, 002 etc... if I click on sprite 1, it should go to frame 000, if I click sprite 3 it should load frame 002.

Thanks everyone!!!
« Last Edit: November 05, 2009, 10:53:28 PM by Mic »
« Reply #1 on: November 05, 2009, 11:31:36 PM »
you find out if the sprite was clicked using iObjectPicked(OBJ_sprite,Vector3)
if is not clicked iObjectPicked = float value -1
if is clicked = float value 0

you change the frames with the OUT_animation_time for the skinmesh.

so,
Code: [Select]
if (iObjectPicked(OBJ_sprite1,Vector3) != -1)OUT_animation_time=1;
see the attached demo.
Crashing Boxes - winner of the 3d games category at the 5th Uruguayan video game contest
get a copy for your iPad/iPhone!

Mic

« Reply #2 on: November 06, 2009, 09:23:27 AM »
Thanks loop, I will check it out tonight :)

Mic

« Reply #3 on: November 06, 2009, 12:29:54 PM »
Had a down moment and I was able to check it out. Works great!!!

Ok, I had a part 2 to this question, but I didn't think my question was so easy to knock out! :)

I would like to keep track each selection with a running total. I assume using a value print object. If the user clicks #1 the running total value would read $80. If they select #2, it would read $120. And #3 would be $160.

When the user makes there final selection, on the bottom of the screen we would have another sprite that is for finalizing the selection. You click on it, and keeps the updated running total value and hides all of the clickable sprites.

We could have a short break between steps, and have a simple "next" sprite. Which I am sure that can be done using simple event on input that would turn on the next set of sprites and script.

So If you selected #2 last time, your value print would read $120. Now we move onto a new set of clickable sprites, and I hope a new script. So if this new selection also had 3 sprites each with more value. So Lets say for this set of sprites I choose #1 and the value of that part is $400. I would need the running total to update to $520.

I hope I explained this well enough to get some help :)

THANK!!!! ;D
Pages: [1]