Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Specialist said:
Okay, jus tested it... for some reason, now it isn't delivering damage to the enemy either. :sad:
You were missing the closing try end, which is likely to mess up the loop, I believe

Code:
mp_slash = (0, 0, 1, [(key_clicked, key_v)], 
    [
	(multiplayer_is_server),
    # (try_begin),             
	(get_player_agent_no, ":player_agent"),
	(agent_play_sound, ":player_agent", "snd_man_grunt"),
	(agent_set_animation, ":player_agent", "anim_slash_attack"),
    # (try_end), #there's no condition in there...so no need for a try block
	(agent_get_position,pos1,":player_agent"),
	(try_for_agents,":target"),
		(neq, ":target", ":player_agent"),        #### here it is  
		(agent_get_position,pos2,":target"),
		(get_distance_between_positions,":dist",pos1,pos2),
		#(try_begin),
		(lt,":dist",250),
		(store_agent_hit_points,":hp",":target",1),
		(store_random_in_range,":dmg",30,50),  
		(val_sub,":hp",":dmg"),
		(agent_set_hit_points,":target",":hp",1),
		(le,":hp",0),
		(agent_deliver_damage_to_agent,":player_agent",":target"),
		#(try_end), #and  since you don't do anything if the above fails, no need for a try block here either
	(try_end), ##this was missing
   ])
 
Thanks. :grin:

Jeez...that code is done. Now to make sure I have all the other checks done (not to be used on horseback, or used in the middle of other animations, etc)
 
Specialist said:
Any ideas what I'm doing wrong?
There is a critical mistake in that code: using key_clicked with multiplayer_is_server ensures the trigger never fires, as key press events are only on clients, not servers (unless it is both, as when hosting a game from your client - I strongly suggest not to test scripts that way, but use the dedicated server executable). You would need to have the key press trigger send a message to the server, which then plays the sound, animation, and deals damage, but only if some checks succeed - you probably want to name a player slot something like slot_player_melee_attack_time and check it is less than the current time by some amount, and if so set the slot to the current time (to enforce a delay between attacks), and then maybe also add an "anti spamming" check on the server or server and client which prevents sending the message or checking agent distances if the player has pressed the key too many times in a short period - I would guess doing that would result in quite a bit of server lag.
 
Is there any other way to go than an event? I have about 8 codes that are very similar to this...

What if I used key_clicked *within* multiplayer_is_server?
 
Dang... Okay then.
So, once I make the event, I would simply call the script for the action and damage?
And then send the event to the server through the trigger?
 
Some smooth-running related questions;

1. If a native helmet is roughly 300 faces, does that mean a new made helmet of significantly more is also significantly worse if you want to run smooth?
2. Some items I have are multimesh. Are multi-part meshes slower to load than if its in one part?
3. I want to reorganize some textures, is it a good idea to combine four 1024x1024 in one 2048x2048 texture or are four faster to load? Same with 512x512 and 1024x1024? I guess one 1024x1024 sheet with four items is more efficient then four sheets with each one 512x512 item, but I'd like to make sure.
 
kuauik said:
guys,i am curious,is there a way to change color of menu text?so the backround doesnt need to be always the same as warband or white?

[quote author=module_game_menus]
#  2) Game-menu flags (int). See header_game_menus.py for a list of available flags.
#    You can also specify menu text color here, with the menu_text_color macro
[/quote]
I believe this applies to all text in the menu, as menu options are not allowed flags.

For instance:
  ("start_game_0",menu_text_color(0xFF000000)|mnf_disable_all_keys,
...etc,
 
Hey everyone,

I had a quick question about damage.

Do bows/crossbows/pistols/muskets do extra damage at close range naturally within the Module System or is that even possible to do? Would that require some kind of looping script or just a tweak of the module.ini variables?

Thanks!

<3

CR
 
FrisianDude said:
1. If a native helmet is roughly 300 faces, does that mean a new made helmet of significantly more is also significantly worse if you want to run smooth?
It can be. If you make good LOD's that are right around Native's LOD polycount, it should be fine, since you only see LOD0 (the main mesh) when you are under 20 feet from the agent
FrisianDude said:
2. Some items I have are multimesh. Are multi-part meshes slower to load than if its in one part?
Yes, but if you notice, even Native uses it. It doesn't significantly slow down loading or drop framerate, but in giant scale, it may.
FrisianDude said:
3. I want to reorganize some textures, is it a good idea to combine four 1024x1024 in one 2048x2048 texture or are four faster to load? Same with 512x512 and 1024x1024? I guess one 1024x1024 sheet with four items is more efficient then four sheets with each one 512x512 item, but I'd like to make sure.

In short, yes. In long:
A 2048X2048 DXT1 DDS file is right around 1.5-2 megs (if I remember correctly). Four 1024x1024 DXT1 DDS files are 683 KB each, multiplied by four equals 2.5-2.6 megs.
Four 512 DXT1 textures are 342 kb each, coming up to 1,366 KB for the four of them (not to mention normals or speculars), while one 1024 is onl 683 kb.
The smaller the size, faster the load


celestialred said:
Hey everyone,

I had a quick question about damage.

Do bows/crossbows/pistols/muskets do extra damage at close range naturally within the Module System or is that even possible to do? Would that require some kind of looping script or just a tweak of the module.ini variables?

Thanks!

<3

CR
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
 
Specialist said:
celestialred said:
Hey everyone,

I had a quick question about damage.

Do bows/crossbows/pistols/muskets do extra damage at close range naturally within the Module System or is that even possible to do? Would that require some kind of looping script or just a tweak of the module.ini variables?

Thanks!

<3

CR
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)

I assumed as much. Frankly I think the cost to the CPU in making such a script would negate it's effectiveness anyway. Thanks for the quick reply :smile: Appreciated.

<3

CR
 
Specialist said:
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
Actually, they may reduce damage at longer distances. It depends if projectile speed is reduced from simulated air-resistance (I'm assuming yes because there's an item flag called itp_ignore_friction). 
 
MadocComadrin said:
Specialist said:
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
Actually, they may reduce damage at longer distances. It depends if projectile speed is reduced from simulated air-resistance (I'm assuming yes because there's an item flag called itp_ignore_friction).

That's a good point, plus there's the variables in the module.ini for handling missile speed and air friction. I've wondered how I could alter those two to create close volleys of musket fire to be far more devastating due to the initial ballistic velocity of the gun on fire. It would also be useful for, say, longbows' penetrative power. Technically, a longbow had a "kill range" of around 20 yards against most plate armor, if modern recreation is accurate. It would be a useful thing for many mods.

These are in module.ini
air_friction_arrow = 0.002
air_friction_bullet = 0.002

# damage below this will not interrupt melee attacks
damage_interrupt_attack_threshold      = 3.0
# Same thing for multiplayer
damage_interrupt_attack_threshold_mp  = 1.0

# No extra penetration flags are set, so keep them ineffective
extra_penetration_factor_soak = 1.0
extra_penetration_factor_reduction = 1.0

# You can modify the damage system by editing the following values:
# The first three values determine the amount which will be directly subtracted from damage due to armor.
# The next three values determine the percentage reduction from the damage.

armor_soak_factor_against_cut      = 0.8
armor_soak_factor_against_pierce    = 0.65
armor_soak_factor_against_blunt    = 0.5

armor_reduction_factor_against_cut      = 1.0
armor_reduction_factor_against_pierce    = 0.5
armor_reduction_factor_against_blunt    = 0.75


horse_charge_damage_multiplier        = 1.0
couched_lance_damage_multiplier      = 0.65
fall_damage_multiplier                = 1.0

#missiles with damage > shield_penetration_offset + shield_penetration_factor * shield
#will penetrate.

shield_penetration_offset = 30.0
shield_penetration_factor = 3.0

#setting speed_power to 2.0 makes damage scale with the square of missile's speed.
# you can set it to 1.0 to make it scale linearly as it was before.
missile_damage_speed_power = 1.9
melee_damage_speed_power = 2.0

Though I don't fully understand the scale. Are these in feet per second? Meters per second? What's the scale of, say, being hit by a projectile with the speed of 1.9 vs 3.0?

No idea.

Any thoughts? :smile:

CR
 
Hey I need some help, I created this shelf and in the brf it is see through at some points but ingameit is not. Can someone tell me why it is like this. I really need to fix this and would appreciate the help.

BRF


Ingame
 
xPearse said:
Hey I need some help, I created this shelf and in the brf it is see through at some points but ingameit is not. Can someone tell me why it is like this. I really need to fix this and would appreciate the help.
BRF


Ingame

From what I understand of things related to in game objects, it might be something you can ask the great people over in Open BRF's forum. There's some extremely talented artists there who'd probably give you a really detailed answer.

It's here : http://forums.taleworlds.com/index.php/board,215.0.html

I hope that helps,

CR
 
MadocComadrin said:
Specialist said:
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
Actually, they may reduce damage at longer distances. It depends if projectile speed is reduced from simulated air-resistance (I'm assuming yes because there's an item flag called itp_ignore_friction).

I tested it myself just now... it does make more friction between the targets, but they always  do the same damage. I set my player HP at 20, and then equipped an enemy troop with a crossbow fit to to 19 damage ranged, plus a bolt damage of +1 (for a total of 20 HP loss), and he was firing on me from over 140 feet away, then right around all the way across the map (I used the itp_ignore_gravity command in order to allow him to do it) and I died every time
 
Specialist said:
MadocComadrin said:
Specialist said:
Not that I know of. A crossbow bolt at 5 feet does the same damage as a bolt from 500 feet, sadly. You would probably need to make your own MT trigger and your own very long script to calculate distances, then reduce the damage delivered accordingly (or add HP back to the player)
Actually, they may reduce damage at longer distances. It depends if projectile speed is reduced from simulated air-resistance (I'm assuming yes because there's an item flag called itp_ignore_friction).

I tested it myself just now... it does make more friction between the targets, but they always  do the same damage. I set my player HP at 20, and then equipped an enemy troop with a crossbow fit to to 19 damage ranged, plus a bolt damage of +1 (for a total of 20 HP loss), and he was firing on me from over 140 feet away, then right around all the way across the map (I used the itp_ignore_gravity command in order to allow him to do it) and I died every time

Do you think adding more friction would cause it to work?

What if you increased the weapon speed, but increased the friction as well. Would a weapon speed of 150 still be absurd in the face of a higher friction? I wonder if it would return a decreased distance for the shot, thus preventing your crossbowmen or musketeers from shooting like snipers from across the map. Lol.

CR
 
Status
Not open for further replies.
Back
Top Bottom