by SanDiego1 » Sat Nov 12, 2005 11:09 pm
Thank you for the help. I finally worked out my problem and thought I would share my solution. I had two actors - player and card. I added multiple animations to the card actor so I could get a random draw. On the player actor, I added a left click event so when the left mouse was clicked the card appeared and the player disappeared. The problem I was having was that I would have to use another event (left click, for example) to get the card to stop on one animation. I wanted random animations (cards) to appear without having to click a mouse, etc. so this didn't work.
Here is how I resolved it.
1. I put the multiple animations in the card actor and set the frame rate at 200 per second.
2. I set an event (left click) to destroy the player and create actor the card.
3. On cards, I created an event - Animation Finish - first animation of card actor) and then added Create Timer as the action. The actor was the card and then I hit new timer.
4. On timer, I set "type" as random and then added 125 for maximum and 10 for minium. I named the timer and then hit OK, add and immediate action.
5. Still in card actor, I went to add events and added Timer. On Timer, I selected the timer I created and hit add action. I then went to Change Animation Direction and selected card and stopped. I then hit add and immediate action.
Now, when I left click player, one of the animations in card comes up at random. I tried using the "animpos=0+(rand(number));" but that didn't seem to work. When I added this code, the method I described didn't work. Having set the animations at a frame rate of 200, it is not necessary to put the random code in.
The only thing I don't like is that there is an extremely brief appearance of other animations when the card is called up with the left click on the player. If I use a lesser max rate on the timer, I found that only a few of the animations appear, for whatever reason. I will play around with the numbers to get it right.
Sorry this is so long. I am new to this software as I'm sure others are. I thought I would explain it in detail if others are trying to do the same thing.