Disable animation repeat

Non-platform specific questions.

Disable animation repeat

Postby grandeMur87 » Tue Mar 23, 2010 7:57 pm

Hi all,
i need to change dinamically the "animation repeat" variable from script, not from the window displayed when the "Change animation" button is clicked, because the default value is "enable".
How can I resolve the problem?

PS:
I need this because the character can use different weapons, so the animations are designed for each weapon.
grandeMur87
 
Posts: 3
Joined: Tue Mar 23, 2010 7:52 pm
Score: 0 Give a positive score

Re: Disable animation repeat

Postby makslane » Tue Mar 23, 2010 8:11 pm

Try the ChangeAnimationDirection function:

http://game-editor.com/docs/script_refe ... ndirection
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: Disable animation repeat

Postby Bee-Ant » Wed Mar 24, 2010 3:06 am

Weapon->DrawActor :
Code: Select all
ChangeAnimationDirection("Event Actor", STOPPED);
animpos=2; //or which animation number you desire. starts from 0
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Disable animation repeat

Postby grandeMur87 » Wed Mar 24, 2010 10:04 am

I tried the suggested solutions, but the problem is another.
I have a character with two (for now) set of animations for each of weapon (run right, run left, jump right, jump left, down right, down left).
Now:

1. The default weapon variable is on 1. So, the default animations is those for the first weapon.
2. When picked the second weapon, the "weaponTwoEnable" variable is setted to true and when clicked the button 2, I have to set the new animations to the characters. So, for example, when the "right" button is clicked, the code checks the weapon variable and sets the "run right" animation for the selected weapon. But, if I do so, the animation doesn't functions correctly, because the "repeat" variable of the "Change animation" method is setted on "enable" by default. So, I have to set to "disable" this variable from the code, so that the animation can be displayed correctly.

Hope I explained well the problem.

The last chance is to use a different actor for each weapon, so when picked up a new weapon, I destroy the current actor and create the new actor, but this is very boring...
grandeMur87
 
Posts: 3
Joined: Tue Mar 23, 2010 7:52 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron