actor changes animation at a special score...

Non-platform specific questions.

actor changes animation at a special score...

Postby Diana Kennedy » Tue Jul 25, 2006 12:03 pm

Hi

This is what I want to make:

The actor "reiter2" should change its animation if the score reaches a certain value. What would be the best way to vdo this? I thought in "drawing actor, script editor:



Code: Select all
if (score.textNumber>=-150)
changeAnimation...there I don't know how to continue...


Any idea would be greatly apreciated!
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby makslane » Tue Jul 25, 2006 2:06 pm

Use the 'variables/funciton' list, select the ChangeAnimation and put the values in the panel.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby irblinx » Tue Jul 25, 2006 6:32 pm

I try to keep use of draw actor to a minimum, I've read here of a big performance hit for this.

In any case I think that your code would be better placed wherever you update the score from so that once you update the score use an "if" statement to check if it equals the required amount and then change the anim on your actor.
irblinx
http://www.irblinx.me.uk/Crania.htm
Current projects: Crania deluxe for Mac, iCrania
User avatar
irblinx
 
Posts: 122
Joined: Wed Apr 19, 2006 11:15 am
Location: Manchester, UK
Score: 6 Give a positive score

Postby Diana Kennedy » Mon Oct 16, 2006 9:38 pm

makslane wrote:Use the 'variables/funciton' list, select the ChangeAnimation and put the values in the panel.


Hm, I am afraid, I did not understand quite well. In which actor should I open the script editior? The score, the character who wil have to change its animation or in global code?

Is this code right?:

Code: Select all
if (score.textNumber>=-150);
ChangeAnimation("reiter2", "faint01", FORWARD);


At least, this in the global code doesn't work :(
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby makslane » Mon Oct 16, 2006 10:07 pm

Remove the ; after the if command:


Code: Select all
if (score.textNumber>=-150)
{
  ChangeAnimation("reiter2", "faint01", FORWARD);
}


You can put this code in the actor thats change the score value
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Wed Oct 18, 2006 9:37 pm

You can put this code in the actor thats change the score value


Well, that will be very tricky, because several actors change the score: There are the swords that change the score when colliding with the ghosts and the Ghost change it when collide with the horseman:

Image

Isn't there a global and easy way to make things happen when a certain score is reached?

This would be very helpful in any case.
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby makslane » Wed Oct 18, 2006 9:45 pm

You can put in the 'Draw Actor' event of some actor
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Diana Kennedy » Thu Oct 19, 2006 6:55 pm

I tried several actors, but everytime the same thing happens: The rider (the actor that should change the animation at the certain score) remains "fixed" on he first frame of the said animation, without that the score is reached. :-(
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby makslane » Thu Oct 19, 2006 11:55 pm

Are you updating the 'score.textNumber' variable?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby DilloDude » Fri Oct 20, 2006 12:55 am

This would probably be because you are continually checking the score and changing the animation. You should check another variable (such as an animindex to find the animation) or disable the draw actor event to stop checking.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron