Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
You don't have to assign it though, I believe.

You can simply do (agent_unequip_item, ":attacker", reg0), no?
 
I don't know I never tried it (I tried reg(0) untill I figured out it was supposed to be reg0 :razz:)

It would seem the script runs before the parry is counted though so i don't know how to check for a successful parry...
 
Theoris said:
You don't have to assign it though, I believe.

You can simply do (agent_unequip_item, ":attacker", reg0), no?
You should be able to, yes.

Billath said:
I don't know I never tried it (I tried reg(0) untill I figured out it was supposed to be reg0 :razz:)
reg(0) = reg0
They are defined as equivalent in header_common

But don't be fooled...the parentheses after reg do not mean you can iterate/loop through them with reg(":i") or even reg(reg60) though I tried hard enough :wink:
 
Theoris said:
(agent_set_ammo, ":agent", ":ammo_item", ":value"), doesn't seem to work when there are 2 different ammo items in inventory, is this happening for anybody else as well?
It works for me with any kind of ammo in the inventory as long as you have the correct ammo type in a weapon slot.
 
Try the command again with two different ammo items of the same type in the inventory.
 
Caba`drin said:
But don't be fooled...the parentheses after reg do not mean you can iterate/loop through them with reg(":i") or even reg(reg60) though I tried hard enough :wink:
With WSE you can loop through the registers using (register_get, ":register_value", "i"),.
 
Theoris said:
Try the command again with two different ammo items of the same type in the inventory.
When I ran it I had 2 auto weapons, bolts(auto ammo placeholder), and a shield in weapon slots. Then in my inventory I had bolts, large bag of steel bolts, bent bolts, kerghit arrows, arrows, and javelins. Using these I can fire and the ammo counter decreases properly. If I replace the bolts with arrows I can't fire, and if I replace the weapon slot bolts with steel bolts I can fire infinitely. With my system ammo items are lost upon complete use.
 
Ok currently I have
Code:
common_disarm = (ti_on_agent_hit, 0, 0, [],
[
	(store_trigger_param_1, ":agent"),
	(store_trigger_param_2, ":attacker"),
	(agent_get_attack_action, ":parried", ":attacker"),
		
	(try_begin),
			(eq, ":parried", 4),
			(store_random_in_range, ":random_no", 1, 100),
		
		(try_begin),
			(gt, ":random_no", 10),
			(agent_unequip_item, ":attacker", reg0),
			(display_message, "@Disarmed"),
		(try_end),
	(try_end),	
])

If I use agent_get_defend_action it works but then I can only get it to fire on shield blocks (Or a unsuccessful parry while parrying) Does parrying not cause the trigger to fire? doesn't it count as a hit?

EDIT: guess I answered my own question...it doesn't.
 
ithilien, I'm sorry I meant that having a setup like this.

weapon_slot_0 = item with itp_type_musket flag
weapon_slot_1 = item with itp_type_bullets flag
weapon_slot_2 = item with itp_type_bullets flag
weapon_slot_3 = empty

Then, try agent_set_ammo on weapon_slot_1 item. Absolutely nothing happens for me, but it might be my scripts (highly doubt that though).

Billath, those actions probably don't trigger it. You can create a more complex trigger for it, though..
 
Theoris said:
Then, try agent_set_ammo on weapon_slot_1 item. Absolutely nothing happens for me, but it might be my scripts (highly doubt that though).
Don't get too overconfident.

Darn, I guess I might as well change my weapons from crossbow to musket type.

EDIT: I tried what you said and mine still works. Except my autofire script doesn't specify what slot to take the item from it just takes whichever cartridges is first. Then it will destroy the item after use and reload with the next.
 
Hey guys me again this time on a slightly different topic

Shields, is there anyway to get the current health of a shield on an agent?
If so how I  been trying to figure it out and it doesn't seem obvious.
 
No. If you set slots client-side, only that client will have that value for that slot. If you set server-side, only server will have that value for that slot. I synchronize them. e.g set them on server-side and then send data to clients and set client-side as well.

Also, confirmed, agent_set_ammo command works perfectly, it was a bad code snippet issue for me.
 
Does anyone know the possibilities for working with the following operation:
(troop_set_face_key_from_current_profile, <troop_id>),

For instance, is there a way to use it to change the appearance of an NPC Lord or Hero...say after they were "killed" and one codes a "new" Lord to be raised in their place by renaming the troop and changing its attributes?
 
Billath said:
Hey guys me again this time on a slightly different topic

Shields, is there anyway to get the current health of a shield on an agent?
If so how I  been trying to figure it out and it doesn't seem obvious.
There is, but it isn't easy. You need to add some Python code to get the item hitpoints and store it in an item slot.
Caba`drin said:
Does anyone know the possibilities for working with the following operation:
(troop_set_face_key_from_current_profile, <troop_id>),

For instance, is there a way to use it to change the appearance of an NPC Lord or Hero...say after they were "killed" and one codes a "new" Lord to be raised in their place by renaming the troop and changing its attributes?
I was thinking of using it to fix the problem with the bodyguards script changing face codes.
 
I got two questions:
1.Is it possible when I upgrade my town (build something) that that changes are visible on strategic map (change town icon or add another icon, such as, for example, another tower or dock)
2.Is it possible to have lods on meshes wich has coilisions, towers, houses...
 
iggorbb said:
1.Is it possible when I upgrade my town (build something) that that changes are visible on strategic map (change town icon or add another icon, such as, for example, another tower or dock)
Absolutely. You can change a party's map icon. See how it is done with the player, depending on whether the player is mounted or on foot, or if he/she is camping. See module_simple_triggers and look for lines with "$g_player_icon_state" or the various pis_* constants, such as pis_normal.

The command is (party_set_icon, <party>, <map icon>)
 
Status
Not open for further replies.
Back
Top Bottom