WSE problem

Users who are viewing this thread

Hi,

I'm making a feature that adds a non hero npc's face to a empty hero npc template in order to have things like unique companions/generated companions (companions out of town walkers for example, I already know how to generate names and paste them onto empty template NPCs as well as pasting equipment from an agent onto an empty template NPC). I'm using the agent_get_dna from WSE in order to store the agent's face code into a string. Here's the code

Code:
 [anyone|plyr,"town_dweller_talk", [
                     ], "want to join my party?", "td_join",
                      [
                         (str_clear, s0),
                         (agent_get_dna, s0, "$g_talk_agent"),
                         (troop_set_face_keys, "trp_joinermale1", s0),
                      ]],
 [anyone,"td_join", [
                     ], "ok", "close_window",
                      [
                         (troop_join, "trp_joinermale1"),
                      ]],
error.png

But I keep getting this error (MS says nothing)

I'm sure my WSE is working well? I downloaded WSE from here https://forums.taleworlds.com/index.php?threads/wb-warband-script-enhancer-v4-7-8-for-1-174.324890/
I followed the instructions such as putting the new operations at the very end of my header operations, and applying the process operations patch and adding the new header commons stuff at the very end of my header commons. I didn't do the other stuff like the new MT triggers or script addon stuff because i dont need the stuff that's in it. I even installed mb warband 1168 version (non steam) and put in a 1174 warband exe (non steam) i got off the internet, but i keep getting that error.
 
Solution
So, we had a discussion in the discord about a similar issue, where this guy was trying bring over a player face to a troop and it always ended up wrong, and @Dalion pointed out that the face is randomized between both facekey sets 0 and 1, even if the character is a hero, so you need to may need to the desired face in both!

Python:
(str_store_troop_face_keys, s22, "trp_town_walker_x", 0),
(troop_set_face_keys, "trp_joinermale1", s22, 0),
(troop_set_face_keys, "trp_joinermale1", s22, 1),

And then, of course, you'll need to leave the scene or do the full_helm trick to swap the face within the same mission.
Your issue is: troop_set_face_keys set a string but agent_get_dna doesn't store a string, try to do this:
Python:
 [anyone|plyr,"town_dweller_talk", [
                     ], "want to join my party?", "td_join",
                      [
                         #(str_clear, s0), <- this line is useless because you assign a string to a new value
                         #(agent_get_dna, s0, "$g_talk_agent"), not s0 but a local var but we don't need it
                         (agent_get_troop_id, ":cur_troop", "$g_talk_agent"),# store the agent's troop into a local var
                         (str_store_troop_face_keys, s0, ":cur_troop"),# store the agent's troop face keys into a string
                         (troop_set_face_keys, "trp_joinermale1", s0),# finally sets the face keys
                      ]],
 [anyone,"td_join", [
                     ], "ok", "close_window",
                      [
                         (troop_join, "trp_joinermale1"),
                      ]],

Tell me if it works.
 
Upvote 0
Your issue is: troop_set_face_keys set a string but agent_get_dna doesn't store a string, try to do this:
Python:
 [anyone|plyr,"town_dweller_talk", [
                     ], "want to join my party?", "td_join",
                      [
                         #(str_clear, s0), <- this line is useless because you assign a string to a new value
                         #(agent_get_dna, s0, "$g_talk_agent"), not s0 but a local var but we don't need it
                         (agent_get_troop_id, ":cur_troop", "$g_talk_agent"),# store the agent's troop into a local var
                         (str_store_troop_face_keys, s0, ":cur_troop"),# store the agent's troop face keys into a string
                         (troop_set_face_keys, "trp_joinermale1", s0),# finally sets the face keys
                      ]],
[anyone,"td_join", [
                     ], "ok", "close_window",
                      [
                         (troop_join, "trp_joinermale1"),
                      ]],

Tell me if it works.
I put my WSE files into warbands directory (the loader.exe and stuff) instead of my module so i dont get errors anymore, but it still doesn't work.
Sorry if i'm bothering you with this, I changed the ":dna" to reg1 but like I said it still doesn't work because the troop (trp_joinermale1) isn't the agent's face.
 
Last edited:
Upvote 0
No you don't bother me at all I try to understand too, Have you tried what I sent you before?
And of course happy new year!
What you sent before will get the troop of the walker and get the face code as defined for the troop in module_troops. it still doesn't work, it wont get the agent's unique face keys. Happy new year to you too

EDIT: I've seen that persistent troop identities found some way to store an agent's face key, not sure how. You don't need WSE to play the module either
 
Upvote 0
The game creates npc agents out of the troop template "trp_town_walker_1" and "trp_town_walker_2" for normal town scenes, each agent has a unique random face key. I need the face key of the randomized unique agent that is created from the trp_town_walker_x
 
Upvote 0
Then just do this:
Python:
(str_store_troop_face_keys, s0, "trp_town_walker_x"),# the wanted troop name
(troop_set_face_keys, "trp_joinermale1", s0),
(display_message, s0),#for see if something is stored

This should displays the correct face keys.
 
Upvote 0
So, we had a discussion in the discord about a similar issue, where this guy was trying bring over a player face to a troop and it always ended up wrong, and @Dalion pointed out that the face is randomized between both facekey sets 0 and 1, even if the character is a hero, so you need to may need to the desired face in both!

Python:
(str_store_troop_face_keys, s22, "trp_town_walker_x", 0),
(troop_set_face_keys, "trp_joinermale1", s22, 0),
(troop_set_face_keys, "trp_joinermale1", s22, 1),

And then, of course, you'll need to leave the scene or do the full_helm trick to swap the face within the same mission.
 
Upvote 0
Solution
Back
Top Bottom