Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
I think that the AI calls that function only when the mob is close enough to do melee damage to the player. So the skeleton would have shoot arrows as soon as it got close to you. You might want to move that code to somewhere where the physics is ticked.
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
I moved the code to Monster.cpp.
I created a little branch so other people can look at the code, but for now it also works if you turn up the AttackRange of the mob.
Posts: 4,628
Threads: 115
Joined: Dec 2011
Thanks: 693
Given 494 thank(s) in 423 post(s)
11-03-2013, 06:05 AM
(This post was last modified: 11-03-2013, 06:19 AM by NiLSPACE.)
I'm now working on your tip, since I put the projectile stuff in the Monster.cpp. I'm now trying to put it into the Tick function for each mob with an projectile.
I can't put it in the Tick function since it wont have physics anymore.
Posts: 952
Threads: 16
Joined: May 2013
Thanks: 66
Given 105 thank(s) in 89 post(s)
Try putting super::Tick(a_Dt) before your overriding code.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Dropping pickups is not that easy, because this function is called by cClientHandle when the player digs a block; but to spawn pickups, you need to know what tool they're using (to prevent digging diamonds with a wooden shovel); on the other hand, you don't want DigBlock() to take an ItemInHand parameter. Give me a usable specification and I'll be happy.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
My weekend dancing has taken its toll. I knew that dancing in the chilly hall was a bad idea. Now I've got a cold and a terrible headache, can't think straight. Luckily the 1.7 packets are more or less a mechanical thing, so at least I can do those.