char array for change animation?
				
Posted: 
Wed Apr 25, 2012 4:03 amby phyzix5761
				Trying to make an array that stores animation names. Then I want to be able to randomly select an index from the array and put that string as the animation of the change animation parameter. How do I pass the randomly selected index? Do I need to use strcpy? If so, how?
Thanks.
			 
			
				Re: char array for change animation?
				
Posted: 
Wed Apr 25, 2012 4:20 amby skydereign
				You mean something like this?
Global Code
- Code: Select all
- char anim_names[3][30] = {"water",
 "dirt",
 "grass"};
Some event.
- Code: Select all
- ChangeAnimation("Event Actor", anim_names[floor(rand(3)], FORWARD);
 
			
				Re: char array for change animation?
				
Posted: 
Wed Apr 25, 2012 4:46 amby Hblade
				Thats Engenius. I'm going to use this one day maybe.