Keeping track of a projectile

Users who are viewing this thread

I heard somewhere that the only way to simulate that would be to create a scene prop and give it the same speed as the actual projectile.  You would also need to drop the scene prop at the speed of gravity.
 
Berserker Pride said:
I heard somewhere that the only way to simulate that would be to create a scene prop and give it the same speed as the actual projectile.  You would also need to drop the scene prop at the speed of gravity.
I'll try that.



EDIT: While looking for a specific operation in header_operations.py I found this:

(position_set_z_to_ground_level,<position>),

That should do just fine, because I can then know where any projectile lands by checking the distance between the moved-to-ground pos and the original pos. Pretty obvious that when they're almost the same, the projectile has landed.
 
killkhergit said:
Berserker Pride said:
I heard somewhere that the only way to simulate that would be to create a scene prop and give it the same speed as the actual projectile.  You would also need to drop the scene prop at the speed of gravity.
I'll try that.



EDIT: While looking for a specific operation in header_operations.py I found this:

(position_set_z_to_ground_level,<position>),

That should do just fine, because I can then know where any projectile lands by checking the distance between the moved-to-ground pos and the original pos. Pretty obvious that when they're almost the same, the projectile has landed.

No, wait, that doesn't work.

I'll still need something to replicate any given projectile.
 
Actually the pos_set_z_to_ground_level used by Mirathei checks the original position with the original position.  And then he triggers a fireball explosion when the two position are 10cm away from each other.  It works pretty well.
 
Berserker Pride said:
Actually the pos_set_z_to_ground_level used by Mirathei checks the original position with the original position.  And then he triggers a fireball explosion when the two position are 10cm away from each other.  It works pretty well.

The magic mod right?

I used to have the source code of that one.  Loads of usefull stuff in there. I'll take a look.
 
Highlander has a projectile script for 1866 that simulates gravity for scene props quite nicely. In fact I just spent the last few days fixing it. If you're interested I can try putting in a word with him :smile:

It's kind of a cludge though since it doens't actually track the position of the fired projectile. Instead, the shoot_speed of the weapon is set to 0 and we use a scene prop to stand in for the projectile. The scene prop is given a new position every fraction of second and is told to animate to that position. Our gravity calculations are pretty good but they can't match M&B's exactly (for various reasons, including rounding errors and the fact that scripts have low CPU priority compared to internal game calculations), so it's pretty much impossible to track exactly where a projectile will fall. My advice is to bug the devs for a ti_on_ground_hit trigger that returns the id of the weapon that fired it as well as a position. I put the suggestion in the Warband Module System thread, why don't you add your support  :grin:
 
Back
Top Bottom