xaliber
Recruit
The_dragon said:@xaliber yes, the knock rider off horse code interferes with the native code.
I think that if you add '(agent_is_human, ":agent_no"),' before '(assign, ":initial_courage_score", 5000),', it should fix the issue.
Native code spawns only troop agents (not horses; actually it does spawn horses, but the trigger ti_on_agent_spawn won't fire for them because they spawn with their rider), and the devs forgot to put additional checks (because 'hey... it works, so let it this way').
The code that you added spawns a horse each time it's rider needs to be thrown off. The horse spawning triggers native code that wasn't designed to support horses agents, so that's why you get those errors.
Interesting (and I don't understand why this happens) is the fact that you should get an error on 'store_character_level' operation, because the horse's troop id is -1, which is an invalid troop id, but as I can see, you got no error regarding the troop id.
Much, much appreciated! After a few testing, it works excellently without errors. Thanks, The_dragon. Learning the Warband's code is curious...
Would you mind if I ask additional question? Would it be possible to count the rider's Riding skill in addition to random chance to check whether they are knockable or not?
I tried using this
Code:
(store_random_in_range,":chance",0,60), ### Decrease this number (60) for higher chances of knocking riders off (and vice-versa).
(agent_get_troop_id,":victim_agent",":victim_agent"), ## Xaliber's edit
(store_skill_level,":riding","skl_riding",":victim_agent"), ## Xaliber's edit
(val_mul,":riding",6), ## Xaliber's edit
(val_add,":chance",":riding"), ## Xaliber's edit
(ge,":chance", ":orig_damage"), ### If damage dealt is over or equal to the ":chance" number, knock-off occurs.
But it always produce these... horrendous errors
Reus said:http://forums.taleworlds.com/index.php?topic=6575.msg96347#msg96347xaliber said:(whew, is there a documentation somewhere I can find what the errors supposed to mean?
Winter posted a couple.
Thanks, Reus! It's bookmarked now.