Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
I'm in a bit of a trouble here. I wanted to replace the default crossbow ready, release animations so I created new ones, but now, how can I replace the default ones in the anim_human brf file? Or should I make the module_animations read the animations from a different brf file?
 
Alrighty, thanks. GOt it working. Anyways, I encountered a bit a of strange problem. Basically, I wanted to change the location of an item in the animation, so I did the necessary changes, and tried multiple ways on inserting the key frames. But, always when I export, the item is lower than it's suppose to in the animation. What should I do?

Pics below to show what I mean.

What I wanted
defa87ab5d5dc3a8cda9d4cf89be5d059bdfc7057391f247bea1056b33210cf95g.jpg

What I got
2cd44305b14c1faae29033b5130dd3acbcee43c09a091425c4fe45cc3c4eb7c15g.jpg
 
Patta said:
IT_magic_system_2 = (0, 0, 60, #every frame
      [
      (key_clicked, key_j), #could use global var, game_key, or something - see list in header_triggers
      (get_player_agent_no, ":agent"),
      (agent_get_wielded_item, ":item", ":agent", 0),
      (eq, ":item", "itm_heal_staff_1"),
      ],
        [
#Code for the Spell is here, deleted it to make it shorter...     
])

OK, this is my code. Now i just can't figure out how to add other itmes to the check, and then do something, depending on the item... I tried what i thought could be right, but it didn't work...

And: what would be the best way to limit a class in Multiplayer, so that only one player can pick it? (per side, of course)

No one who can help me with this?

the only tip i could give to you mr.master is to just place the gun a bit higher in Blender or whatever program this is you're using.
 
Hello everybody, can someone help me by telling me how to activate recruitement in towns and castle.
i've already tried to copy the volunteer script and replace all "village" by "town" and all "volunteer" by "townman" but nothing is working.
please can someone give me a way to do it.(and not redirect me on an other topic, i have already seen all the topics.)
 
Sayd Ûthman said:
Hello everybody, can someone help me by telling me how to activate recruitement in towns and castle.
i've already tried to copy the volunteer script and replace all "village" by "town" and all "volunteer" by "townman" but nothing is working.
please can someone give me a way to do it.(and not redirect me on an other topic, i have already seen all the topics.)


in module_simple_triggers.py find this trigger

(72,
  [
    (call_script, "script_update_mercenary_units_of_towns"),
    #NPC changes begin
    # removes  (call_script, "script_update_companion_candidates_in_taverns"),
    #NPC changes end
    (call_script, "script_update_ransom_brokers"),
    (call_script, "script_update_tavern_travellers"),
    (call_script, "script_update_tavern_minstrels"),
    (call_script, "script_update_booksellers"),
    (call_script, "script_update_villages_infested_by_bandits"),


    ### change the range in this line
    (try_for_range, ":village_no", centers_begin, centers_end),
   


      (call_script, "script_update_volunteer_troops_in_village", ":village_no"),
      (call_script, "script_update_npc_volunteer_troops_in_village", ":village_no"),
    (try_end),
    ]),


in module_game_menus.py

search for the code at the end of this script which is inside the 'town' menu and throw in the code starting from recruitment begin until recruitment end.

### recruitment begin
("recruit_volunteers",
      [
        (call_script, "script_cf_village_recruit_volunteers_cond"),
      ]
      ,"Recruit Volunteers.",
      [
        (try_begin),
          (call_script, "script_cf_enter_center_location_bandit_check"),
        (else_try),
          (jump_to_menu, "mnu_recruit_volunteers"),
        (try_end),
        ]), 

###recruitment end  

      ("town_tavern",[
          (party_slot_eq,"$current_town",slot_party_type, spt_town),
          (this_or_next|eq,"$entry_to_town_forbidden",0),
          (eq, "$sneaked_into_town",1),
#          (party_get_slot, ":scene", "$current_town", slot_town_tavern),
#          (scene_slot_eq, ":scene", slot_scene_visited, 1), #check if scene has been visited before to allow entry from menu. Otherwise scene will only be accessible from the town center.
          ]
      ,"Visit the tavern.",


I did this quite quick so there might be a mistake but I think this should do the trick already. In theory:
The trigger calls the script 'script_update_volunteer_troops_in_village' and fills the party slots with a random number
Inside the town menu the script 'cf_village_recruit_volunteers_cond' is fired and if it returns true or so the town menu shows the recruit option.

Yeah, like said I might have overseen something. Tell me if it doesn't work out.

 
I think we should create a new script called town_recruit_volunteer_cond because the ville_recruit_volunteer_cond containe some conditions that a town can't have like svs_estate looted, or svs_estate being raided etc...

anyway thank you for help i will try this soon
 
Need some help, game crashes every time I run this script.

if I comment out this line: (agent_set_wielded_item, ":agent_no", ":item"), ; it's fine.

But if not, it crashes. But I can't think of why it's a problem.

Code:
		(0.5, 0, 0, [], [
		(this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),
		(try_for_agents,":agent_no"),
			(agent_is_alive, ":agent_no"),
			(agent_is_non_player, ":agent_no"),
			(agent_get_troop_id, ":troop", ":agent_no"),
			(eq, ":troop", "trp_oriental_lieutenant_multiplayer_ai"), 
			(agent_get_wielded_item,":wielded_item",":agent_no",0),
			(eq, ":wielded_item", -1),
			(troop_get_inventory_capacity, ":cap", ":troop"),
			(try_for_range, ":i", 0, ":cap"),
				(troop_get_inventory_slot, ":item", ":troop", ":i"),
				(ge, ":item", 0), 
				(item_get_type, ":type", ":item"),
				(ge, ":type", itp_type_one_handed_wpn),
				(le, ":type", itp_type_polearm),
				(agent_has_item_equipped, ":agent_no", ":item"),
				(agent_set_wielded_item, ":agent_no", ":item"),
				(assign, ":cap", 0),#loop breaker
			(try_end), #try inventory
		(try_end), # try agent
		]),

Thanks.
 
Sayd Ûthman said:
I think we should create a new script called town_recruit_volunteer_cond because the ville_recruit_volunteer_cond containe some conditions that a town can't have like svs_estate looted, or svs_estate being raided etc...

anyway thank you for help i will try this soon

There is no need to add an extra script. We don't need to care about pc ressources in menues and since a town is never raided and all that the test will not fail.
 
Patta said:
IT_magic_system_2 = (0, 0, 60, #every frame
      [
      (key_clicked, key_j), #could use global var, game_key, or something - see list in header_triggers
      (get_player_agent_no, ":agent"),
      (agent_get_wielded_item, ":item", ":agent", 0),
      (eq, ":item", "itm_heal_staff_1"),
      ],
        [
#Code for the Spell is here, deleted it to make it shorter...     
])

OK, this is my code. Now i just can't figure out how to add other itmes to the check, and then do something, depending on the item... I tried what i thought could be right, but it didn't work...

And: what would be the best way to limit a class in Multiplayer, so that only one player can pick it? (per side, of course)

I wanted to write the same, Dummbatz :wink: well, you were too fast...
So, anyone who can help me with this?
 
SonKidd said:
Need some help, game crashes every time I run this script.
if I comment out this line: (agent_set_wielded_item, ":agent_no", ":item"), ; it's fine.
But if not, it crashes. But I can't think of why it's a problem.
Code:
		(0.5, 0, 0, [], [
		(this_or_next|multiplayer_is_server),
		(neg|game_in_multiplayer_mode),
		(try_for_agents,":agent_no"),
			(agent_is_alive, ":agent_no"),
			(agent_is_non_player, ":agent_no"),
			(agent_get_troop_id, ":troop", ":agent_no"),
			(eq, ":troop", "trp_oriental_lieutenant_multiplayer_ai"), 
			(agent_get_wielded_item,":wielded_item",":agent_no",0),
			(eq, ":wielded_item", -1),

# I am not used to multiplayer stuff but do you actually have more than the usual 4 slots?
# if not than (assign, ":cap", 4),                         
			#(troop_get_inventory_capacity, ":cap", ":troop"),
			
 (try_for_range, ":i", 0, ":cap"),
				(troop_get_inventory_slot, ":item", ":troop", ":i"),
				(ge, ":item", 0), 
				(item_get_type, ":type", ":item"),
				(ge, ":type", itp_type_one_handed_wpn),
				(le, ":type", itp_type_polearm),

				#(agent_has_item_equipped, ":agent_no", ":item"),

				(agent_set_wielded_item, ":agent_no", ":item"),


				(assign, ":cap", ":i" ),#loop breaker


			(try_end), #try inventory
		(try_end), # try agent
		]),

Well, that's all I can think of. It probably doesn't help you out though.  :neutral:

 
Sayd Ûthman said:
Sorry ritter but your code isn't working :sad:

Can you describe it a bit more? Does it not compile? Do you use a clean .py-file ... at least for these parts?
It should work since it is more or less what I use.
 
cmpxchg8b said:
I think that only works for spawned scene props (meta type 10), but still better than nothing.
It works for scene props placed in the editor as well. The missiles just disappear, since othewise when they hit a moving destructable scene prop they would be left in mid air.
 
Status
Not open for further replies.
Back
Top Bottom