Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Caba`drin said:
store_trigger_param_2 should be store_trigger_param_1
Yep this is the reason why I removed my post quickly^^

Edit;
So here is the final code
Code:
#Missile Triggers
missile_trigger	= [
  (ti_on_missile_hit,
  [
    (call_script,"script_shot_distance"),
    #missile type check
    (store_trigger_param_1, ":cur_agent"),
    (agent_get_wielded_item, ":item_id", ":cur_agent"),
    (item_get_type, ":item_type", ":item_id"),
    (try_begin),
      (this_or_next|eq, ":item_type", itp_type_pistol),
      (eq, ":item_type", itp_type_musket),
      (call_script,"script_on_bullet_hit"),
    (try_end),
  ]),
  (ti_on_missile_dive,
  [
    (call_script,"script_on_missile_water_hit"),
  ])]
Thank you guys :wink:
 
Bravo2255 said:
CTCCoco said:
Somebody knows How Can I delete an item from the battlefield?

Are you talking about editing a map?

I had done a Hand Granade so I need to delete it or bypass to a scene prop when it explode, because if you throw it to the Scene battlefield you can pick up it again :s

Sorry for my poor explanation.
 
Hmm...
I get script errors ingame, when throwing weapons hit something: "Invalid Item Kind ID"
Code:
...
...
#Missile Triggers
missile_trigger	= [
  (ti_on_missile_hit,
  [
    #missile type check
    (store_trigger_param_1, ":shooter_agent"),
    (agent_get_wielded_item, ":item_id", ":shooter_agent"),
    (item_get_type, ":item_type", ":item_id"),
    (try_begin),
      (this_or_next|eq, ":item_type", itp_type_pistol),
      (eq, ":item_type", itp_type_musket),
      (call_script,"script_on_bullet_hit"),
    (else_try),
      (eq, ":item_id", "itm_grenade"),
      (call_script,"script_on_grenade_hit"),
    (try_end),
    #shot distance
    #(eq, "$g_report_shot_distance", 1),
    (call_script,"script_shot_distance"),
  ]),
  (ti_on_missile_dive,
  [
    (call_script,"script_on_missile_water_hit"),
  ])]
	
items = [
...
...
["darts", "Darts", [("dart_b",0),("dart_b_bag",ixmesh_carry)], itp_type_thrown|itp_merchandise|itp_primary, itcf_throw_javelin|itcf_carry_quiver_right_vertical|itcf_show_holster_when_drawn, 155, weight(3)|difficulty(1)|spd_rtng(95)|shoot_speed(21)|thrust_damage(22,pierce)|accuracy(100)|max_ammo(6)|weapon_length(32), imodbits_thrown, missile_trigger ],
...
...
Edit:
When I remove the item_type check, then I don't get any script error.
Code:
missile_trigger	= [
  (ti_on_missile_hit,
  [
    #missile type check
    (store_trigger_param_1, ":shooter_agent"),
    (agent_get_wielded_item, ":item_id", ":shooter_agent"),
    (try_begin),
      (eq, ":item_id", "itm_flintlock_pistol"),
      (call_script,"script_on_bullet_hit"),
    (else_try),
      (eq, ":item_id", "itm_grenade"),
      (call_script,"script_on_grenade_hit"),
    (try_end),
    #shot distance
    #(eq, "$g_report_shot_distance", 1),
    (call_script,"script_shot_distance"),
  ]),
  (ti_on_missile_dive,
  [
    (call_script,"script_on_missile_water_hit"),
  ])]
Any ideas why this happens :?:
 
how do i remove the single player button from the menu like mount and musket did and how do i make it so only my mods severs are shown like in crpg
 
By the time the missile hits the agent might be wielding another item, so that's a very bad way to check.
The only proper way to obtain the item is by "hardcoding" it into the trigger, since you know at compile time what item you're giving the trigger. The bad thing about this approach is that you can't just put missile_trigger into each missile item, but you have to add slightly different triggers to each item.
So for example you will add this to arrows:
Code:
(ti_on_missile_hit, [(call_script, "script_missile_hit", "itm_arrows")]),
and this to bolts:
Code:
(ti_on_missile_hit, [(call_script, "script_missile_hit", "itm_bolts")]),
and so on...
If you don't want to copypasta the triggers then you'll have to come up with some Python hackery to do it for you.
 
to show only your mods servers you go into the module.ini file and find ---

hide_other_mod_servers

and change the 0 to a 1 like so

hide_other_mod_servers = 0
to
hide_other_mod_servers = 1

not sure about single player button thing but I know what you mean.
 
Ah ok.
So I add the call_script method to each item and I remove the missile_trigger.
Thank you.

I have one more question.
How do I change this script that the particles wont appear on agents?
Code:
  #script_on_bullet_hit
  ("on_bullet_hit",
  [
    (try_begin),
      (copy_position, pos63, pos1),
      (position_get_z, ":z_pos", pos1),
      (try_begin),#above water level
	(gt, ":z_pos", -10),
	(try_begin),#terrain hit
	  (position_get_distance_to_terrain, ":distance", pos1),
          (le, ":distance", 10),
	  (particle_system_burst, "psys_bullet_hit", pos1, 8),
	  (particle_system_burst, "psys_bullet_hit_particle", pos1, 8),
	(else_try),#else hit
	  (particle_system_burst, "psys_bullet_hit_objects", pos1, 8),
	(try_end),
      (try_end),
    (try_end),
  ]),
 
Erh... somebody can tell me why (agent_get_wielded_item, ":item_no0", ":agent_id", 0), always return Item Kind -1?

Code:
(ti_on_scene_prop_use,
    [
	(multiplayer_is_server),
      (store_trigger_param_1, ":agent_id"),
      (store_trigger_param_2, ":instance_id"),
	  (agent_is_active, ":agent_id"),
			(assign, ":tipodearmaranged", 0),
			(assign, ":tipodearmamunicion", 0),
			(agent_get_wielded_item, ":item_no0", ":agent_id", 0),
                        {{{{{{{MORE STUFF}}}}}}}

Thanks :s
 
Slawtering said:
to show only your mods servers you go into the module.ini file and find ---

hide_other_mod_servers

and change the 0 to a 1 like so

hide_other_mod_servers = 0
to
hide_other_mod_servers = 1

I cant see the hide_other_mod_servers line even when i press ctrl f
 
How might I code a system for multiplayer in which instead of buying items, you select a set class and immedtiatly spawn with those items? Also, would it be possible for me to make these classes have different tiers i.e. sub-classes?

Thanks.
 
mardam said:
Slawtering said:
to show only your mods servers you go into the module.ini file and find ---

hide_other_mod_servers

and change the 0 to a 1 like so

hide_other_mod_servers = 0
to
hide_other_mod_servers = 1

I cant see the hide_other_mod_servers line even when i press ctrl f

You need to add WSE to your mod.
http://forums.taleworlds.com/index.php/topic,151194.0.html
 
Im having a little trouble with a mini mod im working on.

i've added a musket type weapon into multiplayer however when i shoot it there is no smoke..any help?
Ok So i got that working but no shooting sound?  :???:
 
Bennie94v said:
Im having a little trouble with a mini mod im working on.

i've added a musket type weapon into multiplayer however when i shoot it there is no smoke..any help?
Ok So i got that working but no shooting sound?  :???:

Try with play_sound and sending it client-side.


My question:

It's possible to bypass data through the conditions block of a mission template to a consequences block?

In multiplayer, I need to do that but INSIDE the mission template.

I mean, if I want to execute the consequences block for an specific player after exactly 15 seconds, I can't if I can't bypass the player ID who fire up the conditions block before 15 seconds exactly.

Why? Because in multiplayer there'll be many people at the same time firing up the mission template trigger, so when all these people met the same conditions, when I check all players with the same conditions at the consequences block, all players will have these consequences at the same time, no matter when they fire up the trigger before.

I hope you understand me and give me some information. Thanks :smile:

EDIT: Found out a possible solution.
 
Status
Not open for further replies.
Back
Top Bottom