Coding advice? Anyone?

Users who are viewing this thread

DetektivAro

Regular
So I was thinking of making a magic weapon that will act like a ranged weapon. It would shoot like a bow or crossbow, but instead of a arrow coming out, a meteor would fall out of the sky on the targeted place with it not falling right on the crosshair but in its general vicinity ( like some kind of accuracy thing so it isn't 100% strait on target ). How should I start doing something like this? I would just like to know how and were should I start with scripting Warband.
 
Last edited:
Solution
I actually have done this myself, so I think I can lend some guidance:


So without guiding you too aggressively, I used add_missile to spawn a throwing weapon missile (with a mesh of a boulder) super high in the air and aimed roughly at the target position with a ti_on_missile_hit trigger inside the item entry of the "meteor" weapon to fire an AOE damage script.

I don't think you want to use this exact method, which was taking the hit location of the arrow shot (by using ti_on_missile_hit inside the arrow's item entry) but you can use cast_ray from the agent's look position to determine where it's looking, then use add_missile and some maths to shoot the meteor in the general direction of the...
The absolute beginning steps are normally the Ultimate Introduction to Modding:
https://forums.taleworlds.com/index...ion-to-modding-starting-out-read-this.240255/

Essential to read is then the Module System Syntax and Usage:
https://forums.taleworlds.com/index...ion-to-module-system-syntax-and-usage.142422/

Additionally look up the file headers_operation.py in your module system. It contains all available operations. A more documented version can be downloaded here:
 
Upvote 0
I actually have done this myself, so I think I can lend some guidance:


So without guiding you too aggressively, I used add_missile to spawn a throwing weapon missile (with a mesh of a boulder) super high in the air and aimed roughly at the target position with a ti_on_missile_hit trigger inside the item entry of the "meteor" weapon to fire an AOE damage script.

I don't think you want to use this exact method, which was taking the hit location of the arrow shot (by using ti_on_missile_hit inside the arrow's item entry) but you can use cast_ray from the agent's look position to determine where it's looking, then use add_missile and some maths to shoot the meteor in the general direction of the intended target
 
Upvote 0
Solution
I actually have done this myself, so I think I can lend some guidance:


So without guiding you too aggressively, I used add_missile to spawn a throwing weapon missile (with a mesh of a boulder) super high in the air and aimed roughly at the target position with a ti_on_missile_hit trigger inside the item entry of the "meteor" weapon to fire an AOE damage script.

I don't think you want to use this exact method, which was taking the hit location of the arrow shot (by using ti_on_missile_hit inside the arrow's item entry) but you can use cast_ray from the agent's look position to determine where it's looking, then use add_missile and some maths to shoot the meteor in the general direction of the intended target

Thanks a lot man !!!
 
Upvote 0
Back
Top Bottom