Thx alot. I'am in need of tricks like that. My code is very chatoic
.
I figured out the solution because skydereign made me think of the right things:
your comment about event actor vs "bullet" made me think again. I changed ChangeAnimation("bullet".... into ChangeAnimation("Event Actor"... and it works fine!
I thought so far that "Event Actor" and "actorname" is the same thing, which obv. it isn't! It seems that "Event Actor" is some kind of part of "bullet", that is refered to when an event happens to "bullet" (sry about my english...)
Figuring out things like that cost me ours of iteration so far (because again, I have no programming experience, I'am learning on the fly here with many tabs open about C language etc.
).
Another example of me being stuck was the MoveTo action. I thought the X and Y values are some kind of fix coordinates until I realised they are vectors relative to sth. My intention was make the shooter slow down when shooting. So I figured I had to store the moveto action then order a new moveto with slower velocity when the shooting animation began and again one with a normal velocity when it finished. The first time I tried this, the shooter walked too far. After some tests I figured that the additional distance was exactly the same as the distance between the start of the move and last shooting action. Only then I realized iam working with vectors and had to calculate and substract the vector between the start of the move and the last shooting action.
here my finished code so you can imagine it better:
- Code: Select all
MoveTo("player", xwalking-xscreen+xarcher, ywalking-yscreen+yarcher, aspeed, "player", "");
x/ywalking are the stored x/ymouse vectors when issuing the moveto action. x/yarcher are the stored x/yscreen vectors when the last shooting happened.
So if you can think of any similar thing or a tutorial/site I should visit then pls let me know. Thx for reading and helping!