How do you set an actor in motion after having slid it? [SOLVED]

TheeSeaverShow

  • Posts: 471
I have attached a screenshot of the code im using.  I want the enemy to attack ever 1/4 of its health.  So this picture says that when the enemy has 1/4's health, I set the upgrades, then set his x speed to 0.  Then I center it in the screen, charge it forwards, bring it back to its original x/y.  Now I run into a problem. No matter what I do, I cannot get the actor to move again.  I tried setting its X speed to a number.  Tried un-anchoring it from the screen incase somehow it got anchored.  Ive tried setting a variable in its move behavior, setting it to false when he attacks, then true when hes done, Ive tried pushing him gently, pushing him sharply, and tried making a custom event that moved him. (This worked to start the movement, but when called again after the slides, it did not produce a response.) 

If anybody knows what im doing wrong or has a suggestion, please let me know, been about 3 days now working on nothing.


« Last Edit: June 08, 2016, 03:18:20 pm by TheeSeaverShow »

yoplalala

  • *
  • Posts: 1515
edit : solution under this post

« Last Edit: June 08, 2016, 02:19:59 pm by yoplalala »

yoplalala

  • *
  • Posts: 1515
Found the solution !
- you could try after the slide the code block "actor.activePositionTweens=0;"
- or you could try do the second slide after the actorattack +0.2 s  to leave the time for the slide to finish

« Last Edit: June 08, 2016, 02:05:27 pm by yoplalala »

TheeSeaverShow

  • Posts: 471
Hey Yoplalala, thanks for the replies.  I gave both of your solutions a try and neither one is working.  The code one, Stencyl did not like.  It throws an error.  The 2nd solution I have already tried too, but I gave it another shot because of your comment.  It does not produce a response either.  I tried ( .2, 1, 5, 10). 

Any more suggestions?

yoplalala

  • *
  • Posts: 1515
Sorry ...  didn't your code wasn't in the actor but in the scene.
try to view the code of the slide boss code
It should be something.moveBy(200, 0, 10, Linear.easeNone); something like this

instead of "actor" in the code I gave you, put the something.

TheeSeaverShow

  • Posts: 471
 I was putting Boss.activePositionTweens=0; Completely forgot the internal name has the underscore.  It works now using the code: _Boss.activePositionTweens=0;

Thanks a ton!