Page 1 of 1

Throwing

Posted: Wed Nov 12, 2014 4:50 pm
by ahn
Trying to implement some puzzles where you throw stuff around. Encountering a couple of issues...

1) Is there an onThrow hook?
From the scripting reference I couldn't find a hook that's triggered when the player throws an item. Is there such hook? Or is there some other nice way to get called when an item is thrown. I'd like to for example get the position where the throwing occurred.

2) Throws are random?
One thing I noticed with some (long) throws is that the objects don't always end up in the same place for the same throw. In the screenshots below I throw blue gems to a hole that's 7 tiles forward and 2 tiles down, some gems go in and some hit the top of the hole and fall to the ground, apparently randomly. Wonder if it's a bug or intentional behavior...

Image
Image

Does anybody know anything that could help?

Re: Throwing

Posted: Wed Nov 12, 2014 5:07 pm
by MrChoke
Take a look at the ThrowAttackComponent. I haven't used this yet but maybe "onPostAttack()" is like onThrow()

Re: Throwing

Posted: Wed Nov 12, 2014 7:06 pm
by sps999
There might be a slight difference in throwing length based on where on the screen you click. I recommend you try some tests where you throw all the gems from the middle of the screen, then all the gems from the top of the screen. I'm not sure if it works like this but it is worth testing out.

Re: Throwing

Posted: Wed Nov 12, 2014 8:01 pm
by ahn
sps999 wrote:There might be a slight difference in throwing length based on where on the screen you click. I recommend you try some tests where you throw all the gems from the middle of the screen, then all the gems from the top of the screen. I'm not sure if it works like this but it is worth testing out.
That's what I suspected too, but based on little testing the clicking position doesn't seem to affect the throw.