Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I usually test my weapon range and damage by visiting town, then kill my own horse. After I upgraded my WB from 1.134 to 1.143, I found that on my mod, I couldn't hurt my horse anymore. I thought, it's my mod bug as it's written from 1.134 MS. But then I found that I couldn't hurt my horse either on native. Is it a bug, a new feature or there's new setting/code to enabling/disabling own horse hit?
 
Do you have a ti_on_agent_hit trigger? In 1.142/1.143 they added the possibility to change damage by setting the trigger result. Maybe inside the trigger you do something (like getting a troop skill) that has the side effect of setting the trigger result to 0. That wouldn't explain the behavior on Native, though.
 
cmpxchg8b said:
Lumos said:
Could you please be more specific to which three of my questions this "No" applies? :razz:
To the one that was there before you ninja edited the post. :grin:
Lumos said:
Hmm.. Won't the trigger re-fire another instance of itself the next frame and not wait for the first one to finish?
Thanks for the tip. I managed to fix my problem by using several triggers and now everything is running good.
How can I check if an agent is standing still? Maybe by checking his animation, but I don't get the "body part" thing. Should I use it like this:
Code:
(agent_get_animation, ":anim", ":agent_id", 0), #0 = lower body part, 1 = upper body part
(eq, ":anim", "anim_stand"),
I guess that stand would apply to the lower body part and give me the results I need...?

EDIT: Also, one more thing. How can I make the ModSys operate with floating point values? For an example, I need to do (80/215)*100 to calculate a percentage. Unfortunately the ModSys keeps returning 80/215 = 0. I have fixed_point_multiplier to 1000 a few lines above.
 
I tested on native with the same result. I tested again on battle mission template, and then I can hurt my horse again. It's seems that no rider horse will be unharmed on mission type = -1 on 1.143.
 
Checked the code, they did change it. If the mission template doesn't have the flag mtf_battle_mode you won't be able to harm neutral horses. Should be possible to circumvent it by changing agent/team relations, though.
 
cmpxchg8b said:
Checked the code, they did change it. If the mission template doesn't have the flag mtf_battle_mode you won't be able to harm neutral horses. Should be possible to circumvent it by changing agent/team relations, though.

Thank you for the confirmation. Yes, setting the relation between player agent and the horse to enemy will enable us to hurt the horse.
Code:
enable_hurt_own_horse = (ti_on_agent_dismount, 0, 0, [],
  [(store_trigger_param_1, ":agent_no"),
   (store_trigger_param_2, ":agent_horse"),
   (agent_add_relation_with_agent, ":agent_no", ":agent_horse", -1),
  ])
 
could i make any of these into textures? how would i do it?
okapi
34q66m9.jpg
Thomsons gazelle
3469dp3.jpg
Dorcas gazelle
2nc3tyf.jpg
 
Is there any way to set admin rights from module code ?
I tried (player_set_is_admin, ":player_no", 1), but this seems not to work, or do something different.
 
Zbyh said:
Is there any way to set admin rights from module code ?
I tried (player_set_is_admin, ":player_no", 1), but this seems not to work, or do something different.
If I recall correctly, it will update the server but not the clients, so you'd probably need to send a message to that client to run the operation as well. (player_is_admin, ":my_player_id") will only succeed on a client for your own player when connected as an admin: other player ids will always fail that check even if they actually are; only the server knows about all other admins.
 
Zbyh said:
Is there any way to set admin rights from module code ?
I tried (player_set_is_admin, ":player_no", 1), but this seems not to work, or do something different.
That works, but it will not notify clients of the change, if that could be related to your problem.
Edit: ninjaed with a better answer. :sad:
 
Indeed, that was my problem :smile:.
I activated this command both server and client side, and everything seems to work fine now.
Thanks a lot for help !
 
Sorry this is probably a really stupid question, but im new to all this so please dont rip me apart if this is the wrong place :razz:

Im using the module system and python files by the way.

Basically, created a new town on the map, set up all the scenes and added all the people to them etc. But when i start a new game, instead of the town being given to the closest faction  (khergit) its neutral. I had the problem of it being a fight against myself, but solved that one, so now the town is neutral/player owned according to notes. Also, if i go for a walk around the town, i find a clone of myself who appears to just be standing outside the castle, which allows me to control the castle.

To go back to my point, how do i make it be allocated to the correct faction?
Villages i've created automatically go to the khergits, so why doesnt my town?
Edit: Also, are there any tutorials for making towns/factions etc that are for warband 1.143? Ive literally searched everywhere and there are none, only for the older system
Thanks :smile:
 
In module_scripts, client events,

Code:
			(multiplayer_get_my_player, ":my_player"),
			(assign, reg0, ":my_player"),
			(display_message, "@{reg0}"),

my friend's game always displays "Reading Progress: x%" (x changes). while mine always displays (0,1,2...) which is what I expected. However the code still works most of the time, like it seems like the value of ":my_player" is correct.

any ideas why?

Thanks :smile:
 
Status
Not open for further replies.
Back
Top Bottom