Player's face code to troop, invalid player ID

Users who are viewing this thread

Code:
[anyone|plyr,"member_talk", [
      (troop_get_type,":gender","$g_talk_troop"),
      (troop_get_type,":p_gender","trp_player"),
      (get_player_agent_no, ":plyr"),
      (eq, ":gender", 1),(eq, ":p_gender", 0),(str_store_troop_face_keys, s30, "$g_talk_troop", 1),(str_store_player_face_keys, s1, ":plyr"),
   ], "Let's have children", "do_member_trade",[(get_player_agent_no, ":plyr"),(str_store_player_face_keys, s1, ":plyr"),(troop_set_face_keys, "trp_son", s1),(troop_set_face_keys, "trp_daughter", s1),
     (troop_join,"trp_son"),(troop_join,"trp_daughter"),
    ]],

I get errors in the game (not in MS) saying I have an invalid player ID, also I don't see the son and daughter troops resembling the player.
 
Solution
Make it such that the child troop has the tf_randomize_face flag and assign them one parents face into their facecode slot 1 and the other in facecode slot 2 and it will make a random ranged between those two.

Python:
(troop_set_face_keys,  ":childtroop", ":parent1face", 0), # assign slot 1
(troop_set_face_keys,  ":childtroop", ":parent2face", 1), # assign slot 2

I do not know what'll happen if a man and a female face code are set on the opposite gender troop tho.
str_store_player_face_keys needs a multiplayer player_id, and you're feeding in an agent_id.
(str_store_player_face_keys, s1, ":plyr"), to (str_store_troop_face_keys, s1, "trp_player"),
Assuming that the player is always trp_player, and can't change to be a different troop in normal gameplay.
 
Last edited:
Upvote 0
Thanks that helped. How would I set a troop's face keys to randomize between 2 selected stored face codes? I want to make the player have children with companions. Or is it only possible to set to one face code
 
Upvote 0
Make it such that the child troop has the tf_randomize_face flag and assign them one parents face into their facecode slot 1 and the other in facecode slot 2 and it will make a random ranged between those two.

Python:
(troop_set_face_keys,  ":childtroop", ":parent1face", 0), # assign slot 1
(troop_set_face_keys,  ":childtroop", ":parent2face", 1), # assign slot 2

I do not know what'll happen if a man and a female face code are set on the opposite gender troop tho.
 
Upvote 0
Solution
Back
Top Bottom