Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Seems like being slain on a horse with full speed influences the way the ragdoll rolls over the battlefield. It is not just falling off and lying there. To know more about that and how this is done codewise would be very interesting for me.
I heard that physics are pretty much hardcoded but that doesn't count for ragdolls physics but my search for the code failed.
So if you can tell me where to find the code for that please tell me.

Thanks in advance!  :razz:
 
Sayd Ûthman said:
Fixed my problem, i've put the helmet in a new brf and now it works... strange thing, no??
Was it saved as a Warband BRF when it should have been a regular, or vice versa?  :wink: 
 
Nope, it's just a simple check that fails if it's not running on a listen or dedicated server.
It might be easier to find the problem if you post a code snippet.

EDIT: wrong trigger, I had ti_on_agent_killed_or_wounded in mind. Not sure about ti_on_agent_hit, it might not work on clients.
 
Code:
(ti_on_agent_killed_or_wounded, 0, 0, [],[
         (store_trigger_param_1, ":daid"),
         (store_trigger_param_2, ":kaid"),
	 (display_message, "@Agent Hit"),
I'm not even getting the message.

Edit: Weird, now I'm getting the messages.

Edit2: Full trigger, modified from before. Now I'm not getting the messages.
Code:
(ti_on_agent_hit, 0, 0, [], [
					(store_trigger_param_1, ":haid"), 
					(store_trigger_param_2, ":daid"), #dealer
					(store_trigger_param_3, ":damage"),
					(assign, ":item", reg0),
					
					(agent_get_player_id,":hpid",":haid"),
					(agent_get_player_id,":dpid",":daid"),
					
					(try_begin),
						#(neg|multiplayer_is_server),
						(display_message, "@Agent Hit!"),
						# (ge, ":dpid", 0),
						# (ge, ":hpid", 0),
						(player_get_team_no, ":dTeam", ":dpid"),
						(player_get_team_no, ":hTeam", ":hpid"),
						#(neq, ":dpid", ":hpid"),
						(eq, ":dTeam", ":hTeam"),
						(display_message, "@Team Damage!"),
						(player_get_slot,":td",":dpid",madmin_pslt_tw),
						(val_add, ":td", ":damage"),
						(player_set_slot,":dpid",madmin_pslt_tw, ":td"),
					(try_end),
									
					(try_begin),
						(multiplayer_is_server),
						(ge, ":dpid", 0),
						(ge, ":hpid", 0),
						(neq, ":dpid", ":hpid"),
						(player_is_admin, ":dpid"),
						(eq, ":item", "itm_bec_de_corbin_a"),
						(particle_system_burst ,"psys_moon_beam_1", pos0, 60),
						(str_store_player_username,s34,":hpid"),
						(str_store_player_username,s35,":dpid"),
						(server_add_message_to_log, "@{s35} struck {s34} with a banhammer."),
						(display_message, "@{s35} raised his glorious banhammer and smashed it upon the head of {s34}."),
						(ban_player, ":hpid", 1, ":dpid"),
					(try_end),
					
					(try_begin),
						(multiplayer_is_server),
						(ge, ":dpid", 0),
						(ge, ":hpid", 0),
						(player_get_team_no, ":dTeam", ":dpid"),
						(player_get_team_no, ":hTeam", ":hpid"),
						(neq, ":dpid", ":hpid"),
						(eq, ":dTeam", ":hTeam"),
						(player_get_slot,":td",":dpid",madmin_pslt_tw),
						(val_add, ":td", ":damage"),
						(player_set_slot,":dpid",madmin_pslt_tw, ":td"),
					(try_end),
					
				]),
 
Lumos said:
Is there a way to check if a party's destination (on the world map) requires passing through water
No way, if you need to check it for arbitrary party in arbitrary situation.
Unless you write a checker yourself, using several conditions for X Y coords. You can make it provide pretty good results, when combined with checking for terrain type, assuming you want it to check stuff when party is on land.
 
Right... I thought it would be something like this.
(How) can I check if a party on position is facing another position? I can get the party's position and the water's position, and then check if the party is facing the water, and set a slot. If it gets even near the water (up to the shore itself) and the slot is set, convert to ship. Else, the party may have just passed by the water, so if it gets further, de-set the slot.
This will be only for the AI, not for the player, btw.

Actually, if I can't get the direction the party is facing (I don't think that's possible :smile:), I might expand the slots stuff to check if a party is getting nearer the water.
 
Is it possible to make spearthrowers smart enough so they wait a bit until they actually have a good chance of hitting their targets?
 
Any way to use "add_visitors_to_current_scene" in the following way:
Let a bot appear at the position of the player who pressed a key. For example i put it onto key "h", so when someone presses it, a bot spawns next to him. Spawning a bot in general is no problem, i made it that the bot is in the right team and so on (multiplayer) but i have a problem with making the bot spawn at the players position. I would like to use "add_visitors_to_current_scene" if posssible, i dont like "spawn_agent" very much.
 
Patta said:
Any way to use "add_visitors_to_current_scene" in the following way:
Let a bot appear at the position of the player who pressed a key. For example i put it onto key "h", so when someone presses it, a bot spawns next to him. Spawning a bot in general is no problem, i made it that the bot is in the right team and so on (multiplayer) but i have a problem with making the bot spawn at the players position. I would like to use "add_visitors_to_current_scene" if posssible, i dont like "spawn_agent" very much.

On the key press trigger, mark that this spawn call has been made with a slot or a global variable, likely storing the player's id or some such. Then, use add_visitors_to_current_scene to spawn new agents. If you do the above in a conditions block, then have a few second delay before the consequences block, where you clear the slot/global.

Then, use a ti_on_agent_spawn trigger with a check for the spawn call variable/slot in the conditions block. In the consequences, do what you need to do to move the agent to the player's position.

 
this topic came up when talk was about mandibles great hoods today:
http://forums.taleworlds.com/index.php/topic,163101.0.html
we thought that it would most probably be possible to make those hoods to appaer as gloves, and rigging them to the head (mounting them to the head bone, only a few clicks involved for that, i think).

The problem is however, they can be selected with any helmet and armor then, leading to weird results and lots of clipping
Does anyone know a way of restricting item choice based on other items selected in the multiplayer buying screen?

I think this would be great for other causes too, mainly balancing. Money wouldn't be the only factor, one could make players to chose between stuff.
(I know thats already doable to some degree by restricting items to one weapon slot)
 
Something like this
Code:
        (try_begin), #selecting helmets to display
          (eq, ":item_classes_begin", multi_item_class_type_heads_begin),
          (multiplayer_get_my_player, ":player_no"),
          (player_get_slot, ":selected", ":player_no", slot_player_selected_item_indices_begin+8),
          #check if hood is selected
          #easiest to do is to lower item_classes_end to exclude head-covering multi_item_class_type_heavy_helm
        (else_try),
          (assign, ":selected", -1),
        (try_end), #otherwise add individual checks below
        (try_for_range, ":item_no", all_items_begin, all_items_end),
          (item_get_slot, ":item_class", ":item_no", slot_item_multiplayer_item_class),
          (is_between, ":item_class", ":item_classes_begin", ":item_classes_end"),
          (this_or_next|eq, ":selected", -1), #hood not selected
          #check for disallowed helmets here
This should prevent the item icon from showing up if a hood is in the selected glove slot (provision for spawned/selected helmets elsewhere). You could always code up a script that unequips invalid helmets at spawn time anyways.
 
Status
Not open for further replies.
Back
Top Bottom