PYTHON SCRIPT/SCHEME EXCHANGE

Users who are viewing this thread

many people have made NPC's killable, but the problem is, the player can kill all Npc's.
this script will get a troop and change it so that it seems to be another one.
 
Egbert said:
A bug I came across after adding more banners was that the bandit lair map icon got changed to a map flag icon. Apparently, static parties cannot have a map icon with an ID greater than 255. Since the bandit lair icon in Native is ID 188, it doesn't have this bug. But if you add icons before the bandit lair it can push it past 255, which makes the ID wrap around and reuse another icon (usually a map flag). There is a command that is commented out (not sure what it does) "#(party_set_flags, ":new_camp", pf_icon_mask, 1),". This can change which icon is used, but I couldn't make it use one higher than 255.

If you get this bug, just move the bandit_lair icon up in the file near the bridge icon.

Thanks for this. Spent hours to figure out what went wrong. :???:
 
Anyone on here have a script that allows a melee weapon to deliver area damage?
Sort of like a hammer that when you hit the ground it makes an explosion of energy. I can add the psys stuff later though. :grin:
 
Specialist said:
Anyone on here have a script that allows a melee weapon to deliver area damage?
Sort of like a hammer that when you hit the ground it makes an explosion of energy. I can add the psys stuff later though. :grin:

I have this lying around.

Code:
["hammer", "Hammer", [("iron_hammer_new",0)], itp_type_one_handed_wpn|itp_can_knock_down| itp_primary|itp_wooden_parry, itc_scimitar, 
7 , weight(2)|difficulty(0)|spd_rtng(100) | weapon_length(55)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
[(ti_on_weapon_attack, [ 
   (store_trigger_param_1,":agent"),
        (try_for_agents,":target"),
            (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",60,100),
      (val_sub,":hp",":dmg"),
      (agent_set_hit_points,":target",":hp",1),
      (agent_deliver_damage_to_agent,":agent",":target"),
       (try_end),
            (particle_system_burst,"psys_green_ick",pos1,50),
            (particle_system_burst,"psys_game_blood",pos1,50),
        (try_end)
		])]],
 
Crazy-Q said:
Specialist said:
Anyone on here have a script that allows a melee weapon to deliver area damage?
Sort of like a hammer that when you hit the ground it makes an explosion of energy. I can add the psys stuff later though. :grin:

I have this lying around.

Code:
["hammer", "Hammer", [("iron_hammer_new",0)], itp_type_one_handed_wpn|itp_can_knock_down| itp_primary|itp_wooden_parry, itc_scimitar, 
7 , weight(2)|difficulty(0)|spd_rtng(100) | weapon_length(55)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
[(ti_on_weapon_attack, [ 
   (store_trigger_param_1,":agent"),
        (try_for_agents,":target"),
            (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",60,100),
      (val_sub,":hp",":dmg"),
      (agent_set_hit_points,":target",":hp",1),
      (agent_deliver_damage_to_agent,":agent",":target"),
       (try_end),
            (particle_system_burst,"psys_green_ick",pos1,50),
            (particle_system_burst,"psys_game_blood",pos1,50),
        (try_end)
		])]],

Thanks! That is exactly what I need! :grin:
 
Crazy-Q said:
Specialist said:
Anyone on here have a script that allows a melee weapon to deliver area damage?
Sort of like a hammer that when you hit the ground it makes an explosion of energy. I can add the psys stuff later though. :grin:

I have this lying around.

Code:
["hammer", "Hammer", [("iron_hammer_new",0)], itp_type_one_handed_wpn|itp_can_knock_down| itp_primary|itp_wooden_parry, itc_scimitar, 
7 , weight(2)|difficulty(0)|spd_rtng(100) | weapon_length(55)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
[(ti_on_weapon_attack, [ 
   (store_trigger_param_1,":agent"),
        (try_for_agents,":target"),
            (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",60,100),
      (val_sub,":hp",":dmg"),
      (agent_set_hit_points,":target",":hp",1),
      (agent_deliver_damage_to_agent,":agent",":target"),
       (try_end),
            (particle_system_burst,"psys_green_ick",pos1,50),
            (particle_system_burst,"psys_game_blood",pos1,50),
        (try_end)
		])]],
Pretty.
 
Crazy-Q said:
Specialist said:
Anyone on here have a script that allows a melee weapon to deliver area damage?
Sort of like a hammer that when you hit the ground it makes an explosion of energy. I can add the psys stuff later though. :grin:

I have this lying around.

Code:
["hammer", "Hammer", [("iron_hammer_new",0)], itp_type_one_handed_wpn|itp_can_knock_down| itp_primary|itp_wooden_parry, itc_scimitar, 
7 , weight(2)|difficulty(0)|spd_rtng(100) | weapon_length(55)|swing_damage(24 , blunt) | thrust_damage(0 ,  pierce),imodbits_mace ],
[(ti_on_weapon_attack, [ 
   (store_trigger_param_1,":agent"),
        (try_for_agents,":target"),
            (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",60,100),
      (val_sub,":hp",":dmg"),
      (agent_set_hit_points,":target",":hp",1),
      (agent_deliver_damage_to_agent,":agent",":target"),
       (try_end),
            (particle_system_burst,"psys_green_ick",pos1,50),
            (particle_system_burst,"psys_game_blood",pos1,50),
        (try_end)
		])]],

Great idea.Actually,scripting on weapons can make hell alot of good effects,but noone tries to enter this mess.
@Specialist:If you want this code for Thor's Hammer on your mod,then you forgot 2 other specialities of that hammer:Thor's hammer could be thrown and then returned to Thor's hand.Thor's Hammer melee attacks knocked back the foes.Also,when thrown,it dealt area damage anyway.
Anyway,if anyone could attach particles to a flying projectile,I would be very grateful(it's been quite alot time trying to figure this for Lords of Might and Magic mod).
 
Don't credit me, I think someone else made it.  :lol:  It was OSP but now I can't find it.  I'll let you know if I do. 

EDIT:

http://forums.taleworlds.com/index.php/topic,171558.msg4139733.html#msg4139733  :razz:
 
ThaneWulfgharn said:
Great idea.Actually,scripting on weapons can make hell alot of good effects,but noone tries to enter this mess.
@Specialist:If you want this code for Thor's Hammer on your mod,then you forgot 2 other specialities of that hammer:Thor's hammer could be thrown and then returned to Thor's hand.Thor's Hammer melee attacks knocked back the foes.Also,when thrown,it dealt area damage anyway.
Anyway,if anyone could attach particles to a flying projectile,I would be very grateful(it's been quite alot time trying to figure this for Lords of Might and Magic mod).

Yeah, but to make a weapon returnable is a bit out there. Unless I can find a way to make it play the thrown axe animation backwards and come back to your hand, the area damage may just have to work. :lol:

Crazy-Q said:
Don't credit me, I think someone else made it.  :lol:  It was OSP but now I can't find it.  I'll let you know if I do. 

EDIT:

http://forums.taleworlds.com/index.php/topic,171558.msg4139733.html#msg4139733  :razz:

That was my/someone else's Grenade code? :grin:
I wished I knew what I had back then..... :smile:
 
:lol:  That's where I found it the first time and messed around with it (changed to on weapon attack, etc) a while ago. 
 
1 sec guys...can you check what's wrong with this item script(It's for The Lords of Might and Magic Mod):
["mage_shot","Mage Shot", [("invisible_weapon",0),("flying_missile",ixmesh_flying_ammo),("invisible_weapon", ixmesh_carry),("invisible_weapon", ixmesh_carry|imodbit_large_bag)], itp_type_bolts, itcf_carry_quiver_right_vertical, 0,weight(2.25)|abundance(90)|weapon_length(63)|thrust_damage(34,pierce)|max_ammo(555),imodbits_missile,
[(ti_on_init_item, [(set_position_delta,0,0,0),
                    (particle_system_add_new, "psys_bracada_mage_fire"),
                    (particle_system_add_new, "psys_archmage_staff_glow"),
                    (set_current_color,10, 250, 10),
                    (add_point_light, 5, 15),])]],
 
ThaneWulfgharn said:
Anyway,if anyone could attach particles to a flying projectile,I would be very grateful(it's been quite alot time trying to figure this for Lords of Might and Magic mod).

can it be done, by having the projectile emit at high repetitions?  The projectiles in native have their own object/mesh, I'm just not sure where it's referenced in python.

Your hammer script - it's not player-specific is it?  I'm trying to do something similar and I want it to be an AI weapon as well as player or NPC....
 
Amman de Stazia said:
ThaneWulfgharn said:
Anyway,if anyone could attach particles to a flying projectile,I would be very grateful(it's been quite alot time trying to figure this for Lords of Might and Magic mod).

can it be done, by having the projectile emit at high repetitions?  The projectiles in native have their own object/mesh, I'm just not sure where it's referenced in python.
Attached particles can't be done in warband, you could approximate the flight path and burst some particles there, but it will never look good.
However, if you use the Script Enhancer (WSE), it is possible. An option to add particles to the projectile was added there.
 
MaverickJones said:
Updated and better version of my troop recruiting companions script :razz:
You can now choose how many troops you want to recruit

Code:
# Maverick Companion Script Start #EPIC#
  #Gain 20000 gold randomly if cheat mode is on
  [anyone|plyr,"member_question_2", [(eq,"$cheat_mode",1)], "Cheat: Could you give me some cash from that large pot of gold?", "member_moneys",[]],
  #recruit troops for a price
  [anyone|plyr,"member_question_2", [], "Could you draft in some troops for me?", "member_draft_question",[]],



  [anyone, "member_moneys", [
	    (call_script, "script_troop_add_gold", "trp_player", 20000),
		], "Sure why not, there is plenty in here", "do_member_view_char",[]],
		
  [anyone, "member_draft_question", [], "So what kind of troops do you want?", "member_draft_troop",[]],
  
  [anyone|plyr,"member_draft_troop", [], "I would like some Caravan guards.", "member_draft_troop_question2",[ (assign, "$cost_draft", 400),(assign, "$draft_id", "trp_caravan_guard"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Watchmen.", "member_draft_troop_question2",[(assign, "$cost_draft", 200), (assign, "$draft_id", "trp_watchman")]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Huntresses.", "member_draft_troop_question2",[(assign, "$cost_draft", 200), (assign, "$draft_id", "trp_hunter_woman"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Slave Drivers.", "member_draft_troop_question2",[(assign, "$cost_draft", 200), (assign, "$draft_id", "trp_slave_driver"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Swadian recruits.", "member_draft_troop_question2",[(assign, "$cost_draft", 150), (assign, "$draft_id", "trp_swadian_recruit"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Veagir recruits.", "member_draft_troop_question2",[(assign, "$cost_draft", 100), (assign, "$draft_id", "trp_vaegir_recruit"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Khergit tribesmen.", "member_draft_troop_question2",[(assign, "$cost_draft", 100), (assign, "$draft_id", "trp_khergit_tribesman"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Nord recruits.", "member_draft_troop_question2",[(assign, "$cost_draft", 100), (assign, "$draft_id", "trp_nord_recruit"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Rhodok tribesmen.", "member_draft_troop_question2",[(assign, "$cost_draft", 100), (assign, "$draft_id", "trp_rhodok_tribesman"),]],
  [anyone|plyr,"member_draft_troop", [], "I would like some Looters.", "member_draft_troop_question2",[(assign, "$cost_draft", 50), (assign, "$draft_id", "trp_looter"),]],
  [anyone|plyr,"member_draft_troop", [], "Never mind.", "close_window",[]],
    
  [anyone, "member_draft_troop_question2", [], "How many troops do you want?", "member_draft_troop_2",[]],
  
  [anyone|plyr,"member_draft_troop_2", [], "I would like 10.", "member_draft_troop_3",[ (assign, "$draft_num", 10)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 9.", "member_draft_troop_3",[(assign, "$draft_num", 9)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 8.", "member_draft_troop_3",[(assign, "$draft_num", 8)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 7.", "member_draft_troop_3",[(assign, "$draft_num", 7)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 6.", "member_draft_troop_3",[(assign, "$draft_num", 6)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 5.", "member_draft_troop_3",[(assign, "$draft_num", 5)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 4.", "member_draft_troop_3",[(assign, "$draft_num", 4)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 3.", "member_draft_troop_3",[(assign, "$draft_num", 3)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 2.", "member_draft_troop_3",[(assign, "$draft_num", 2)]],
  [anyone|plyr,"member_draft_troop_2", [], "I would like 1.", "member_draft_troop_3",[(assign, "$draft_num", 1)]],
  [anyone|plyr,"member_draft_troop_2", [], "Never mind.", "close_window",[]],
  
  [anyone, "member_draft_troop_3", [
  (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (val_min, "$draft_num", ":free_capacity"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", "$cost_draft"),#denars relevant to the troop you are hiring
	 (val_min, "$draft_num", ":gold_capacity"),
     (party_add_members, "p_main_party", "$draft_id", "$draft_num"),# sets troop to the one you chose
     (store_mul, ":cost", "$draft_num", "$cost_draft"),
     (troop_remove_gold, "trp_player", ":cost"),	
	 ], "It didn't take much to convince them to join you, Hope they serve you well.", "do_member_view_char",[]],
#This new piece of script allows you to recruit from 1 to 10 troops rather than the previous locked 10 :D
 
# Maverick Companion Script End #EPIC#

How do I make so it takes 10 days before I can use this script again? Please help!
 
Look at how native runs the recruiting script. You can modify the number of hours to 240 for yours, but you have to run a script similar.
 
Specialist said:
Look at how native runs the recruiting script. You can modify the number of hours to 240 for yours, but you have to run a script similar.

The recruiting script I found is "script_village_recruit_volunteers_recruit" but I can not understand what part it is that makes you have to wait?!
Game menus
      "Recruit them ({reg6} denars).",
      [
        (call_script, "script_village_recruit_volunteers_recruit"),
        (try_begin),
          (jump_to_menu, "mnu_village"),
        (try_end),
      ]),

Scripts
  #script_village_recruit_volunteers_recruit
  # INPUT: none
  # OUTPUT: none
  ("village_recruit_volunteers_recruit",
    [(party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
    (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
    (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
    (val_min, ":volunteer_amount", ":free_capacity"),
    (store_troop_gold, ":gold", "trp_player"),
    (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
    (val_min, ":volunteer_amount", ":gold_capacity"),
    (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
    (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
    (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
    (troop_remove_gold, "trp_player", ":cost"),
    ]),

And how do I make so when I don't have the money that is needed for the troops the companion does not answer "It didn't take much to convince them to join you, Hope they serve you well"? Even when I received no troops?

Sorry for the bad english...
 
Back
Top Bottom