Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Barabas said:
mr.master said:
cmpxchg8b said:
Still wrong, you can't check if a key is clicked or get the player id on the server (unless it's a listen server and you're the hosting player, but I doubt that's what you want).
Exactly. Right now, the priority is to get it to work on dedicated server. How would I do the check?

You need to do the key press detection on the client side, send a message to the server and then send a message to all players. For general events that is. I heard (read) someone say that you can use (agent_play_sound, ":sound"), and it will automatically get synchronized between all players, but I haven't tested this myself yet.

It gets synchronized, but it works the same way particles are synchronized - it's cut off at a point. It's good for roleplaying mods with big maps, or more quiet sounds, but for gunshots and explosions that should be heard across the map the old way of sending it to all the players is better.
 
Hi all, I'm trying to add Village Faction Recruitment to my Warsword conquest mod using this code below , it compiles with no errors but I get a CTD at loading the mod  saying "Unexpected End of File while reading file: Modules\Warsword Conquest\menus.txt"

I have added it in correctly with module systems but cannot see why its not working  :???:
Can any one help me to get this working please  :grin:

Thanks all
Del

Atamawood said:
Atamawood said:
Well the reason you don't see it is because you have to create a menu that goes to that (sorry I didn't post that little bit!) Now since your using the Module system this shall be easier. I added this

("camp_action_change_troops",0,
  "Which faction?",
  "none",
  [],
    [
      ("Swadian",[],"Swadian.",
      [(faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_1_troop, "trp_swadian_recruit"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_2_troop, "trp_swadian_militia"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_3_troop, "trp_swadian_footman"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_4_troop, "trp_swadian_infantry"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_tier_5_troop, "trp_swadian_knight"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_1_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_1_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_1_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Vaegir",[],"Vaegir.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_vaegir_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_vaegir_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_vaegir_veteran"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_vaegir_infantry"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_vaegir_knight"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_2_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_2_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_2_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Khergit",[],"Khergit.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_khergit_tribesman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_khergit_skirmisher"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_khergit_horseman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_khergit_horse_archer"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_khergit_veteran_horse_archer"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_3_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_3_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_3_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Nord",[],"Nord.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_nord_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_nord_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_nord_trained_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_nord_warrior"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_nord_veteran"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_4_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_4_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_4_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Rhodok",[],"Rhodok.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_rhodok_tribesman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_rhodok_spearman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_rhodok_trained_spearman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_rhodok_veteran_spearman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_rhodok_sergeant"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_5_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_5_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_5_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("Sarranid",[],"Sarranid.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_sarranid_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_sarranid_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_sarranid_archer"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_sarranid_horseman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_sarranid_mamluke"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),
        ]
      ),
     
      ("cancel",[],"Cancel.",
      [(jump_to_menu, "mnu_camp"),
        ]
      ),
      ]
  ),

To the bottom of game_menus along with this

("action_change_troops",[(eq, "$players_kingdom_name_set", 1),],"Change your kingdom's default troops.",
      [(jump_to_menu, "mnu_camp_action_change_troops"),
        ]
      ),

Which I acually added with the rest of the camp actions but you could add it anywhere.

Now assuming you have an unmodded version of the module system (which I'm sure you don't) you have to add these to module_scripts and I'm sure you can mess around with them a bit to get them to work with your modded stuff.

So under module_scripts go to the update_volunteer_troops_in_village and the update_npc_volunteer_troops_in_village scripts and replace:
(party_get_slot, ":center_culture", ":center_no", slot_center_culture),
with
(store_faction_of_party, ":center_culture", ":center_no"),

And the last little part I'll post again,

("cf_reinforce_party",
    [
      (store_script_param_1, ":party_no"),
     
      (store_faction_of_party, ":party_faction", ":party_no"),
      (party_get_slot, ":party_type",":party_no", slot_party_type),

#Rebellion changes begin:
      (try_begin),
        (eq, ":party_type", spt_kingdom_hero_party),
        (party_stack_get_troop_id, ":leader", ":party_no"),
        (troop_get_slot, ":party_faction",  ":leader", slot_troop_original_faction),
      (try_end),

#Rebellion changes end

    (try_begin),
        (eq, ":party_faction", "fac_player_supporters_faction"),
        (party_get_slot, ":town_lord", ":party_no", slot_town_lord),
        (try_begin),
          (gt, ":town_lord", 0),
          (troop_get_slot, ":party_faction", ":town_lord", slot_troop_original_faction),
        (else_try),
          (party_get_slot, ":party_faction", ":party_no", slot_center_original_faction),
        (try_end),
      (try_end),

Just cut out that stuff in the red and your done! yay

Now for everyone just tuning in,
What this does is forces factions to recruit their own troops, it also changes the culture of troops you recruit based on what faction owns it. (Example: Swadians capture a Nordic town, you then recruit Swadians from the once Nordic villages.)
Also the big menu part comes ONLY into play when you make your become a King for your own country. What it does is add a menu to the camp actions which allows for you to set the "culture" you AND your vassals recruit, whether you want Nord troops or Sarranids, or perhaps Rhodoks one day and Vaegirs the next.

For you creating your own troop trees and what not, I'm sure there is a way to make one of these,

("Sarranid",[],"Sarranid.",
      [(faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_1_troop, "trp_sarranid_recruit"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_2_troop, "trp_sarranid_footman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_3_troop, "trp_sarranid_archer"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_4_troop, "trp_sarranid_horseman"),
      (faction_set_slot, "fac_player_supporters_faction", slot_faction_tier_5_troop, "trp_sarranid_mamluke"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_a, "pt_kingdom_6_reinforcements_a"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_b, "pt_kingdom_6_reinforcements_b"),
      (faction_set_slot, "fac_player_supporters_faction",  slot_faction_reinforcements_c, "pt_kingdom_6_reinforcements_c"),
      (jump_to_menu, "mnu_camp"),

For the troops you created and then have both you and your vassals recruit these men from the villages YOU own.

Note: These menus DO NOT appear if YOU are currently not a King of your own country.

So follow those steps and thats what they do, sorry the steps I've posted was never quite clear in the past. I hope this sums it up and it really is a great little tweak imo.


New: These codes are the same thing as the stuff above but only how they appear in the .txt files with the numbers. So this will help you all that don't use the module system which I still recommend you getting into if your going to do any modding.

So first of all locate "cf_reinforce_party -1" in scripts.txt and replace the entire line with

34 21 1 1224979098644774912 2204 2 1224979098644774913 1224979098644774912 521 3 1224979098644774914 1224979098644774912 0 522 3 1224979098644774915 1224979098644774913 77 522 3 1224979098644774916 1224979098644774913 78 522 3 1224979098644774917 1224979098644774913 79 2133 2 1224979098644774918 0 2136 3 1224979098644774919 0 100 4 0 1073741855 2 1224979098644774914 3 31 2 1224979098644774914 2 4 0 2147483678 2 1224979098644774919 65 2133 2 1224979098644774918 1224979098644774915 5 0 2133 2 1224979098644774918 1224979098644774916 3 0 5 0 31 2 1224979098644774914 13 4 0 2147483678 2 1224979098644774919 50 2133 2 1224979098644774918 1224979098644774915 5 0 2147483678 2 1224979098644774919 75 2133 2 1224979098644774918 1224979098644774916 5 0 2133 2 1224979098644774918 1224979098644774917 3 0 5 0 3 0 4 0 32 2 1224979098644774918 0 1675 2 1224979098644774912 1224979098644774918 3 0

Then find "update_volunteer_troops_in_village -1" in scripts.txt and replace the entire line with

35 23 2 1224979098644774912 1 521 3 1224979098644774913 1224979098644774912 26 2204 2 1224979098644774914 1224979098644774912 522 3 1224979098644774915 1224979098644774914 41 2133 2 1224979098644774916 1 2123 3 1224979098644774917 1224979098644774913 10 6 3 1224979098644774918 0 1224979098644774917 2136 3 1224979098644774919 0 100 2147483678 2 1224979098644774919 10 2136 3 1224979098644774919 0 2 1561 3 1224979098644774920 1224979098644774915 1224979098644774919 4 0 2147483680 2 1224979098644774920 0 1561 3 1224979098644774920 1224979098644774915 0 3 0 32 2 1224979098644774920 0 2105 2 1224979098644774916 1 2133 2 1224979098644774915 1224979098644774920 3 0 2133 2 1224979098644774921 12 4 0 30 2 1224979098644774913 5 2133 2 1224979098644774921 1224979098644774913 2108 2 1224979098644774921 2 2105 2 1224979098644774921 10 5 0 2147483678 2 1224979098644774913 0 2133 2 1224979098644774921 0 3 0 2107 2 1224979098644774921 3 2120 3 1224979098644774922 2 1224979098644774916 2108 2 1224979098644774921 1224979098644774922 2136 3 1224979098644774923 0 1224979098644774921 501 3 1224979098644774912 92 1224979098644774915 501 3 1224979098644774912 93 1224979098644774923

Then right below that at "update_npc_volunteer_troops_in_village -1" replace the entire line with

23 23 2 1224979098644774912 1 2204 2 1224979098644774913 1224979098644774912 522 3 1224979098644774914 1224979098644774913 41 2133 2 1224979098644774915 1 6 3 1224979098644774916 0 5 2136 3 1224979098644774917 0 100 2147483678 2 1224979098644774917 10 2136 3 1224979098644774917 0 2 1561 3 1224979098644774918 1224979098644774914 1224979098644774917 4 0 2147483680 2 1224979098644774918 0 1561 3 1224979098644774918 1224979098644774914 0 3 0 32 2 1224979098644774918 0 2105 2 1224979098644774915 1 2133 2 1224979098644774914 1224979098644774918 3 0 2133 2 1224979098644774919 12 2120 3 1224979098644774920 2 1224979098644774915 2108 2 1224979098644774919 1224979098644774920 2136 3 1224979098644774921 0 1224979098644774919 501 3 1224979098644774912 90 1224979098644774914 501 3 1224979098644774912 91 1224979098644774921

Now exit scripts.txt and find menus.txt.

Here you need to add two things. You can add them at the bottom or perhaps with the other camp menu stuff or what ever you want to do.

Here is the camp_action, I added it with the other camp_actions

mno_action_change_troops  1 31 2 144115188075856605 1  Change_your_kingdom's_default_troops.  1 2060 1 864691128455135449  .

and the last part where it selects the faction

menu_camp_action_change_troops 0 Which_faction? none 0 7
mno_Swadian  0  Swadian.  9 502 3 432345564227567630 41 360287970189639715 502 3 432345564227567630 42 360287970189639716 502 3 432345564227567630 43 360287970189639717 502 3 432345564227567630 44 360287970189639718 502 3 432345564227567630 45 360287970189639724 502 3 432345564227567630 77 576460752303423524 502 3 432345564227567630 78 576460752303423525 502 3 432345564227567630 79 576460752303423526 2060 1 864691128455135255  .  mno_Vaegir  0  Vaegir.  9 502 3 432345564227567630 41 360287970189639729 502 3 432345564227567630 42 360287970189639730 502 3 432345564227567630 43 360287970189639734 502 3 432345564227567630 44 360287970189639735 502 3 432345564227567630 45 360287970189639738 502 3 432345564227567630 77 576460752303423527 502 3 432345564227567630 78 576460752303423528 502 3 432345564227567630 79 576460752303423529 2060 1 864691128455135255  .  mno_Khergit  0  Khergit.  9 502 3 432345564227567630 41 360287970189639743 502 3 432345564227567630 42 360287970189639744 502 3 432345564227567630 43 360287970189639745 502 3 432345564227567630 44 360287970189639746 502 3 432345564227567630 45 360287970189639747 502 3 432345564227567630 77 576460752303423530 502 3 432345564227567630 78 576460752303423531 502 3 432345564227567630 79 576460752303423532 2060 1 864691128455135255  .  mno_Nord  0  Nord.  9 502 3 432345564227567630 41 360287970189639753 502 3 432345564227567630 42 360287970189639754 502 3 432345564227567630 43 360287970189639755 502 3 432345564227567630 44 360287970189639756 502 3 432345564227567630 45 360287970189639757 502 3 432345564227567630 77 576460752303423533 502 3 432345564227567630 78 576460752303423534 502 3 432345564227567630 79 576460752303423535 2060 1 864691128455135255  .  mno_Rhodok  0  Rhodok.  9 502 3 432345564227567630 41 360287970189639766 502 3 432345564227567630 42 360287970189639767 502 3 432345564227567630 43 360287970189639768 502 3 432345564227567630 44 360287970189639769 502 3 432345564227567630 45 360287970189639770 502 3 432345564227567630 77 576460752303423536 502 3 432345564227567630 78 576460752303423537 502 3 432345564227567630 79 576460752303423538 2060 1 864691128455135255  .  mno_Sarranid  0  Sarranid.  9 502 3 432345564227567630 41 360287970189639779 502 3 432345564227567630 42 360287970189639780 502 3 432345564227567630 43 360287970189639785 502 3 432345564227567630 44 360287970189639787 502 3 432345564227567630 45 360287970189639788 502 3 432345564227567630 77 576460752303423539 502 3 432345564227567630 78 576460752303423540 502 3 432345564227567630 79 576460752303423541 2060 1 864691128455135255  .  mno_cancel  0  Cancel.  1 2060 1 864691128455135255  .


Just follow the steps at the bottom with the codes if your not using the module system and you will get what you want  :wink: Be sure to create a new folder which you want this stuff to be in don't use your Native folder.
 
CutContent said:
Could someone send me a script that makes people fight you when you use a certain dialog option?
I have tried this for 2 weeks! so I'm not 'lazy'

Code:
[trp_cut_content,"start", [], "Could someone send me a script that makes people fight you when you use a certain dialog option? I have tried this for 2 weeks! so I'm not 'lazy'", "ur_lazy",[]],

[trp_cut_content|plyr,"ur_lazy", [], "You got all the help you needed, yet failed? You suck, dude.", "lazy_sod_fights_back",[]],

[trp_cut_content,"lazy_sod_fights_back", [], "NO U!", "close_window",
   [(set_party_battle_mode),
    (get_player_agent_no, ":player_agent"),
    (try_for_agents, ":cur_agent"),
      (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
      (try_begin),
        (eq, ":cur_agent_troop", "$g_talk_troop"),
        (agent_set_team, ":cur_agent", 3),
      (else_try),
        (eq, ":cur_agent", ":player_agent"),
        (agent_set_team, ":cur_agent", 2),
      (try_end),
    (try_end),
    (team_set_relation, 2, 3, -1),
    (team_set_relation, 2, 0, 0),
    (team_set_relation, 3, 0, 0)]],
 
Hey everyone,

After reviewing some of the reinforcement templates, one of the things I'm wanting to do for our mod is to make AI Lord parties be constituted by only certain types of soldiers, instead of the mishmash that often appears.

Specifically, I'm looking to find a way to for some AI lord parties to be purely cavalry, with a chance of other types of units, some AI lord parties to be purely infantry, with a small change of other units. I would also like to alter the way castles and towns are garrisoned.

My question(s):

What are the specific scripts that deal with this? Has anyone else attempted to do this? Are there pitfalls or things I should avoid and not do? Tips? I know most of the scripts, but I want to make sure I know the entire scope of it before I begin to dismantle how these things are made up.

I greatly appreciate it.

<3

CR
 
You would probably want to expand script_cf_reinforce_party to work with individual lords, and not just factions and party types.
That means you can define reinf templates at lord level if you wish, create those templates and put them in lord's slots (e.g. slot_troop_lord_reinf) at game init; use them in script_cf_reinforce_party later. You want to make this work for only particular lords, so you don't bother with templates for EVERY lord in the game (e.g. check if their slot_troop_lord_reinf is non-zero) - for the rest, the faction templates should be good enough.
 
MadVader said:
You would probably want to expand script_cf_reinforce_party to work with individual lords, and not just factions and party types.
That means you can define reinf templates at lord level if you wish, create those templates and put them in lord's slots (e.g. slot_troop_lord_reinf) at game init; use them in script_cf_reinforce_party later. You want to make this work for only particular lords, so you don't bother with templates for EVERY lord in the game (e.g. check if their slot_troop_lord_reinf is non-zero) - for the rest, the faction templates should be good enough.

Thank you muchly :smile:

I shall check out those scripts. Appreciated :smile:

<3

CR
 
Code:
[quote="MadVader"]

[trp_cut_content|plyr,"ur_lazy", [], "You got all the help you needed, yet failed? You suck, dude.", "lazy_sod_fights_back",[]],

[trp_cut_content,"lazy_sod_fights_back", [], "NO U!", "close_window",
   [(set_party_battle_mode),
    (get_player_agent_no, ":player_agent"),
    (try_for_agents, ":cur_agent"),
      (agent_get_troop_id, ":cur_agent_troop", ":cur_agent"),
      (try_begin),
        (eq, ":cur_agent_troop", "$g_talk_troop"),
        (agent_set_team, ":cur_agent", 3),
      (else_try),
        (eq, ":cur_agent", ":player_agent"),
        (agent_set_team, ":cur_agent", 2),
      (try_end),
    (try_end),
    (team_set_relation, 2, 3, -1),
    (team_set_relation, 2, 0, 0),
    (team_set_relation, 3, 0, 0)]],
[/quote]

lol, thanks
 
CutContent said:
Actually I got no errors in the previous MS (the one with the trp_swag thing), but the character trp_swag wouldn't spawn, so yeah
Then try to make it spawn. How to do this depends on where your troop spawns (tavern, castle etc.).
Example for spawning in tavern, find this in game menus (line 9184 in Native) and insert the code marked with #NEW CODE:
Code:
...
	(try_begin),
		(eq, ":randomize_attacker_placement", 3),
		(call_script, "script_setup_tavern_attacker", ":cur_entry"),
		(val_add, ":cur_entry", 1),
	(try_end),

	#NEW CODE 
	(try_begin),
		(eq, "$current_town", "p_only_town_where_we_spawn"),
		(set_visitor, ":cur_entry", "trp_cut_content"),					(val_add, ":cur_entry", 1),
	(try_end),
			 			 
             (try_begin),
               (neg|check_quest_active, "qst_eliminate_bandits_infesting_village"),
...

Replace p_only_town_where_we_spawn with the real town where you want to spawn, like p_town_6 for Praven.
 
Bad Idea said:
Poison script I've been working on. (borrowing animation from a dismemberment mod) It works except that it doesn't go away like it's supposed to.
The slots 'poisoned' and 'poison_wear_off' become the same value and I don't know why.

All of the code goes into mission_templates:
poison1 = (
    ti_on_agent_spawn, 0, 0, [],
    [
        (store_trigger_param_1,":victim"),
(agent_set_slot,":victim",agent_poisoned,0),
(agent_set_slot,":victim",agent_poison_damage,0),
(agent_set_slot,":victim",agent_poison_wear_off,0),       
        ])

poison2 = (
    ti_on_agent_hit, 0, 0, [],
    [
        (store_trigger_param_1,":victim"),
        (store_trigger_param_2,":attacker"),
        (assign, ":attacker_item", reg0),
        (agent_get_team, ":enemy_team", ":attacker"),
        (agent_get_team, ":team", ":victim"),
        (neq,":team", ":enemy_team"),
        (is_between, ":attacker_item", "itm_assassin_bow_weakest", "itm_assassin_archer_basic_armor"),
##        (store_random_in_range, ":poison_timing", 2, 3),
##        (agent_set_slot,":victim",agent_poisoned,":poison_timing"),
        (agent_set_slot,":victim",agent_poisoned,3),
       
        (store_random_in_range, ":poison_wear_off", 12, 15),
        (agent_set_slot,":victim",agent_poison_wear_off,":poison_wear_off"),
        (agent_get_slot, ":poison_damage", ":victim", agent_poison_damage),
        (val_add, ":poison_damage", 3),
        (val_max, ":poison_damage", 12),
        (agent_set_slot,":victim",agent_poison_damage,":poison_damage"),   
        ])

poison3 = (

0.25, 0, 0, [],
[
  (try_for_agents, ":cur_agent"),
      (agent_is_human, ":cur_agent"),
      (agent_is_alive, ":cur_agent"),
 
        (agent_get_slot, ":poisoned", ":cur_agent", agent_poisoned),
      (agent_get_slot, ":poison_duration", ":cur_agent", agent_poison_wear_off), 

  (try_begin),
  (gt, ":poison_duration", 0),
    (val_sub, ":poisoned", 1),
    (agent_set_slot,":cur_agent",agent_poisoned,":poisoned"), 
    (val_sub, ":poison_duration", 1),
    (agent_set_slot,":cur_agent",agent_poison_wear_off,":poison_duration"), 
  (else_try),
        (agent_set_slot,":cur_agent",agent_poisoned,0),
        (agent_set_slot,":cur_agent",agent_poison_wear_off,0),
        (agent_set_slot,":cur_agent",agent_poison_damage,0), 
  (try_end),


  (gt, ":poison_duration", 0),
 
    (assign, reg1, ":poison_duration"),
      (display_message, "@poison_wear_off: {reg1}"),
    (assign, reg2, ":poisoned"),
      (display_message, "@poison_timer: {reg2}"),

      (try_begin),   
      (eq, ":poisoned", 1), 
      #begin to damage troop
      (store_agent_hit_points, ":hp", ":cur_agent", 0), #percent
      (agent_get_slot, ":poison_damage", ":cur_agent", agent_poison_damage), 
      (val_sub, ":hp", ":poison_damage"),
      (agent_set_hit_points, ":cur_agent", ":hp", 0), #again, 0 param = relative 
 
      (try_begin),
      (lt, ":hp", 2),
      (agent_deliver_damage_to_agent,":cur_agent",":cur_agent"),
      (try_end),
         
      (agent_get_position, pos1, ":cur_agent"),
      (position_move_z, pos1, 85), #makes the blood higher, otherwise it's on ground level
        (position_move_x, pos1, -32), #makes the blood out from the torso towards the arm stump
        (position_move_y, pos1, 16), #makes the blood come out severed stump
        (position_rotate_x, pos1, -70), #makes the blood spurt downwards
        (particle_system_burst, "psys_game_blood_2", pos1, 80), #100 as power.
 
          (store_random_in_range, ":poison_timing", 4, 6),
        (agent_set_slot,":cur_agent",agent_poisoned,":poison_timing"),   
          (display_message, "@poison deals damage"), 
 
      (agent_get_horse, ":horse", ":cur_agent"),
      (eq, ":horse", -1), #No horse.
      (agent_set_animation, ":cur_agent", "anim_handchop"),

  (try_end),
  (try_end), 
 
  ])

animation
  ["handchop", 0, amf_priority_striked|amf_play,
  [1.5, "strikes", 55, 71, arf_blend_in_3],
],

Here's a testing item to poison yourself with:
["poison_self", "TEST_Poison_Self", [("throwing_stone",0)], itp_type_thrown|itp_no_pick_up_from_ground |itp_primary ,itcf_throw_stone, 1 , weight(4)|difficulty(0)|spd_rtng(97) | shoot_speed(30) | thrust_damage(11 ,  blunt)|max_ammo(15)|weapon_length(:cool:,imodbit_large_bag,
  [(ti_on_missile_hit,
    [

(store_trigger_param_1,":victim"),
##        (store_random_in_range, ":poison_timing", 2, 3),
##        (agent_set_slot,":victim",agent_poisoned,":poison_timing"),
        (agent_set_slot,":victim",agent_poisoned,3),                       
        (store_random_in_range, ":poison_wear_off", 12, 15),
        (agent_set_slot,":victim",agent_poison_wear_off,":poison_wear_off"),
        (agent_get_slot, ":poison_damage", ":victim", agent_poison_damage),
        (val_add, ":poison_damage", 3),
        (val_max, ":poison_damage", 12),
        (agent_set_slot,":victim",agent_poison_damage,":poison_damage"),
        ],)]],
You assigned the slots different values in module constants?
 
Does someone know the name of .dds where I can find this?

4012812012031900002.jpg
 
Caba`drin said:
Bad Idea said:
Poison script I've been working on. (borrowing animation from a dismemberment mod) It works except that it doesn't go away like it's supposed to.
The slots 'poisoned' and 'poison_wear_off' become the same value and I don't know why.

All of the code goes into mission_templates:
poison1 = (
    ti_on_agent_spawn, 0, 0, [],
    [
        (store_trigger_param_1,":victim"),
(agent_set_slot,":victim",agent_poisoned,0),
(agent_set_slot,":victim",agent_poison_damage,0),
(agent_set_slot,":victim",agent_poison_wear_off,0),       
        ])

poison2 = (
    ti_on_agent_hit, 0, 0, [],
    [
        (store_trigger_param_1,":victim"),
        (store_trigger_param_2,":attacker"),
        (assign, ":attacker_item", reg0),
        (agent_get_team, ":enemy_team", ":attacker"),
        (agent_get_team, ":team", ":victim"),
        (neq,":team", ":enemy_team"),
        (is_between, ":attacker_item", "itm_assassin_bow_weakest", "itm_assassin_archer_basic_armor"),
##        (store_random_in_range, ":poison_timing", 2, 3),
##        (agent_set_slot,":victim",agent_poisoned,":poison_timing"),
        (agent_set_slot,":victim",agent_poisoned,3),
       
        (store_random_in_range, ":poison_wear_off", 12, 15),
        (agent_set_slot,":victim",agent_poison_wear_off,":poison_wear_off"),
        (agent_get_slot, ":poison_damage", ":victim", agent_poison_damage),
        (val_add, ":poison_damage", 3),
        (val_max, ":poison_damage", 12),
        (agent_set_slot,":victim",agent_poison_damage,":poison_damage"),   
        ])

poison3 = (

0.25, 0, 0, [],
[
  (try_for_agents, ":cur_agent"),
      (agent_is_human, ":cur_agent"),
      (agent_is_alive, ":cur_agent"),
 
        (agent_get_slot, ":poisoned", ":cur_agent", agent_poisoned),
      (agent_get_slot, ":poison_duration", ":cur_agent", agent_poison_wear_off), 

  (try_begin),
  (gt, ":poison_duration", 0),
    (val_sub, ":poisoned", 1),
    (agent_set_slot,":cur_agent",agent_poisoned,":poisoned"), 
    (val_sub, ":poison_duration", 1),
    (agent_set_slot,":cur_agent",agent_poison_wear_off,":poison_duration"), 
  (else_try),
        (agent_set_slot,":cur_agent",agent_poisoned,0),
        (agent_set_slot,":cur_agent",agent_poison_wear_off,0),
        (agent_set_slot,":cur_agent",agent_poison_damage,0), 
  (try_end),


  (gt, ":poison_duration", 0),
 
    (assign, reg1, ":poison_duration"),
      (display_message, "@poison_wear_off: {reg1}"),
    (assign, reg2, ":poisoned"),
      (display_message, "@poison_timer: {reg2}"),

      (try_begin),   
      (eq, ":poisoned", 1), 
      #begin to damage troop
      (store_agent_hit_points, ":hp", ":cur_agent", 0), #percent
      (agent_get_slot, ":poison_damage", ":cur_agent", agent_poison_damage), 
      (val_sub, ":hp", ":poison_damage"),
      (agent_set_hit_points, ":cur_agent", ":hp", 0), #again, 0 param = relative 
 
      (try_begin),
      (lt, ":hp", 2),
      (agent_deliver_damage_to_agent,":cur_agent",":cur_agent"),
      (try_end),
         
      (agent_get_position, pos1, ":cur_agent"),
      (position_move_z, pos1, 85), #makes the blood higher, otherwise it's on ground level
        (position_move_x, pos1, -32), #makes the blood out from the torso towards the arm stump
        (position_move_y, pos1, 16), #makes the blood come out severed stump
        (position_rotate_x, pos1, -70), #makes the blood spurt downwards
        (particle_system_burst, "psys_game_blood_2", pos1, 80), #100 as power.
 
          (store_random_in_range, ":poison_timing", 4, 6),
        (agent_set_slot,":cur_agent",agent_poisoned,":poison_timing"),   
          (display_message, "@poison deals damage"), 
 
      (agent_get_horse, ":horse", ":cur_agent"),
      (eq, ":horse", -1), #No horse.
      (agent_set_animation, ":cur_agent", "anim_handchop"),

  (try_end),
  (try_end), 
 
  ])

animation
  ["handchop", 0, amf_priority_striked|amf_play,
  [1.5, "strikes", 55, 71, arf_blend_in_3],
],

Here's a testing item to poison yourself with:
["poison_self", "TEST_Poison_Self", [("throwing_stone",0)], itp_type_thrown|itp_no_pick_up_from_ground |itp_primary ,itcf_throw_stone, 1 , weight(4)|difficulty(0)|spd_rtng(97) | shoot_speed(30) | thrust_damage(11 ,  blunt)|max_ammo(15)|weapon_length(:cool:,imodbit_large_bag,
  [(ti_on_missile_hit,
    [

(store_trigger_param_1,":victim"),
##        (store_random_in_range, ":poison_timing", 2, 3),
##        (agent_set_slot,":victim",agent_poisoned,":poison_timing"),
        (agent_set_slot,":victim",agent_poisoned,3),                       
        (store_random_in_range, ":poison_wear_off", 12, 15),
        (agent_set_slot,":victim",agent_poison_wear_off,":poison_wear_off"),
        (agent_get_slot, ":poison_damage", ":victim", agent_poison_damage),
        (val_add, ":poison_damage", 3),
        (val_max, ":poison_damage", 12),
        (agent_set_slot,":victim",agent_poison_damage,":poison_damage"),
        ],)]],
You assigned the slots different values in module constants?
:/nope. And yet I call myself a scripter
EDIT: works like a charm now
 
So I played Native Expansion's mod and fell in love with the new Looting system, among several other changes in the mod I am currently playing I was hoping to implement this. Issue is I couldn't get in touch with NE's modders and I am not familiar with the looting system. Essentially rather than Looting being a party skill that affects raiding villages and such, it was changed to a Personal skill and directly affects the amount of random loot plus its quality at the end of battles. Naturally 0 Looting would be bad/few gears and 10 Looting would be good/many gears.

As this is currently the only thing that has me stuck, and I kind of need it to move forward with my next mini-update, I was wondering if anyone was familiar with changing skills.
 
Kinsume said:
As this is currently the only thing that has me stuck, and I kind of need it to move forward with my next mini-update, I was wondering if anyone was familiar with changing skills.
NE emulates Looting skill through scripting, so you need your mod's sources to implement it. If you have them, then just search for instances of (troop_loot_troop, ...) operation, there should only be a few of them, and replace those instances with whatever custom code you wish. Changing Looting skill from party to personal will only have a visual effect in this case.
 
Which texture contains the loading bar?

As in, which .dds file has the loading bar thingie in it, been trying to find it, and either I'm blind, or it's cleverly hidden somewhere.

Also, I'm looking for a way to change the loading screen text, so instead of saying "Loading Textures..." it says "Prepare for running out of memory..." or something like that.
 
Status
Not open for further replies.
Back
Top Bottom