[script] Hunger mod Warband 1.134

Users who are viewing this thread

FantasyWarrior

Hello  :grin:

Somebody want my hunger script ?

-9 for strength
-6 for agility

when we dont have food.
let's go.

module_script

at the end,before the last ]

Code:
#hunger mod scripts
   ("hungry-damages_1429",
   [  
     (troop_raise_attribute, "$g_player_troop", ca_agility, -6),
     (troop_raise_attribute, "trp_player", ca_strength, -9),
     (assign, "$malus_de_faim", 1),        
   ]),


   ("hungry-restore_1429",
   [       
     (troop_raise_attribute, "$g_player_troop", ca_agility, 6),
     (troop_raise_attribute, "trp_player", ca_strength, 9), 
     (assign, "$malus_de_faim", 0),
     (display_message, "@you are satisfied !", 0x33DD33),        
   ]),
#hunger mod


module_script2


find get_player_party_morale_values bloc and after

      (assign, "$g_player_party_morale_modifier_food", 0),
      (try_for_range, ":cur_edible", food_begin, food_end),

bellow

        (call_script, "script_cf_player_has_item_without_modifier", ":cur_edible", imod_rotten),
        (item_get_slot, ":food_bonus", ":cur_edible", slot_item_food_bonus),


past this

Code:
#hunger mod
        (assign, "$testhas_without_modifier", 1),
#hunger mod

module_script3

find this bloc
cf_player_has_item_without_modifier

and after this
        (assign, ":has_without_modifier", 1),
        (assign, ":inv_size", 0), #break
      (try_end),


past

Code:
#hunger mod
      (try_begin),
        (eq, "$testhas_without_modifier", 1),      
        (eq, ":has_without_modifier", 1),      
        (eq, "$malus_de_faim", 1),    
        (call_script, "script_hungry-restore_1429"),
      (assign, "$testhas_without_modifier", 0),      
      (try_end),   

      (eq, ":has_without_modifier", 1),
#hunger mod
  ]),


module_simple_triggers

find
  # Consuming food at every 14 hours
  (14,


and after
      (try_begin),
        (gt, ":available_food", 0),
        (store_random_in_range, ":selected_food", 0, ":available_food"),
        (call_script, "script_consume_food", ":selected_food"),
      (else_try),
        (eq, ":no_food_displayed", 0),
        (display_message, "@I am hungry !", 0xFF0000),
        (call_script, "script_change_player_party_morale", -3),


past


Code:
#hunger mod
     (try_begin),
        (eq, ":no_food_displayed", 0),
        (eq, "$malus_de_faim", 0),    
        (call_script, "script_hungry-damages_1429"),
#


Good appetite  :mrgreen:









edit: and for the following menu :

game menu

after
      ("view_faction_relations_report",[],"View faction relations report.",
      [(jump_to_menu, "mnu_faction_relations_report"),
        ]
      ),

past
Code:
#hunger mod      ("view_hungry_report",[],"Healt report.",
       [(jump_to_menu, "mnu_hungry_report"),
        ]
       ),
#

game_menu 2

after
Code:
  ("faction_relations_report",0,
   "{s1}",
   "none",
   [(str_clear, s2),
    (try_for_range, ":cur_kingdom", kingdoms_begin, kingdoms_end),
      (faction_slot_eq, ":cur_kingdom", slot_faction_state, sfs_active),
      (neq, ":cur_kingdom", "fac_player_supporters_faction"),
      (store_relation, ":cur_relation", "fac_player_supporters_faction", ":cur_kingdom"),
      (try_begin),
        (ge, ":cur_relation", 90),
        (str_store_string, s3, "@Loyal"),
      (else_try),
        (ge, ":cur_relation", 80),
        (str_store_string, s3, "@Devoted"),
      (else_try),
        (ge, ":cur_relation", 70),
        (str_store_string, s3, "@Fond"),
      (else_try),
        (ge, ":cur_relation", 60),
        (str_store_string, s3, "@Gracious"),
      (else_try),
        (ge, ":cur_relation", 50),
        (str_store_string, s3, "@Friendly"),
      (else_try),
        (ge, ":cur_relation", 40),
        (str_store_string, s3, "@Supportive"),
      (else_try),
        (ge, ":cur_relation", 30),
        (str_store_string, s3, "@Favorable"),
      (else_try),
        (ge, ":cur_relation", 20),
        (str_store_string, s3, "@Cooperative"),
      (else_try),
        (ge, ":cur_relation", 10),
        (str_store_string, s3, "@Accepting"),
      (else_try),
        (ge, ":cur_relation", 0),
        (str_store_string, s3, "@Indifferent"),
      (else_try),
        (ge, ":cur_relation", -10),
        (str_store_string, s3, "@Suspicious"),
      (else_try),
        (ge, ":cur_relation", -20),
        (str_store_string, s3, "@Grumbling"),
      (else_try),
        (ge, ":cur_relation", -30),
        (str_store_string, s3, "@Hostile"),
      (else_try),
        (ge, ":cur_relation", -40),
        (str_store_string, s3, "@Resentful"),
      (else_try),
        (ge, ":cur_relation", -50),
        (str_store_string, s3, "@Angry"),
      (else_try),
        (ge, ":cur_relation", -60),
        (str_store_string, s3, "@Hateful"),
      (else_try),
        (ge, ":cur_relation", -70),
        (str_store_string, s3, "@Revengeful"),
      (else_try),
        (str_store_string, s3, "@Vengeful"),
      (try_end),
      (str_store_faction_name, s4, ":cur_kingdom"),
      (assign, reg1, ":cur_relation"),
      (str_store_string, s2, "@{!}{s2}^{s4}: {reg1} ({s3})"),
    (try_end),
    (str_store_string, s1, "@Your relation with the factions are:^{s2}"),

	

    ],
    [
      ("continue",[],"Continue...",
       [(jump_to_menu, "mnu_reports"),
        ]
       ),
      ]
  ),

past

Code:
  ("hungry_report",0,
   "{s1}",
   "none",
   [(str_clear, s1),
#hunger mod reports
    (try_begin),
        (eq, "$malus_de_faim", 0),
        (lt, "$malus_de_faim", 1),    
        (str_store_string, s3, "@i'm satisfied !"),
      (else_try),    
       # (eq, "$malus_de_faim", 1),
       #(lt, "$malus_de_faim", 0),    
        (str_store_string, s3, "@i am hungry! malus for -9/ ag -6"),#
    (try_end),
    (str_store_string, s1, "@Healt report:^{s3}"),
    
    ],
    [
      ("continue",[],"Continue...",
       [(jump_to_menu, "mnu_reports"),
        ]
       ),
      ]
  ),
 
nice,
then,the food would be important to player.
maybe we can change it to water in other mod.
when player travel in desert area,it will become thirsty and weakly if without water~
 
Yifeng_konjac said:
nice,
then,the food would be important to player.
maybe we can change it to water in other mod.
when player travel in desert area,it will become thirsty and weakly if without water~
That would kind of be unfair for people starting out in the desert. It would make it unfairly hard especially that desert bandits are already really fast which is hard already.
 
Yifeng_konjac said:
nice,
then,the food would be important to player.
maybe we can change it to water in other mod.
when player travel in desert area,it will become thirsty and weakly if without water~

Thanks my friend  :smile: yes, it's a good idea,of course we can add a water begin/water end new items (beer/water/hydromel) and make a copie of hunger scripts with differents variables, and others codes...try begin/ if i have water_begin, water_end.... :mrgreen:, and the player need for food and water...

actualy, i try to make the following stat in the game menu (report stats) but not work at the moment)  :roll:




Code:
  ("character_report",0,
   "{s9}",
   "none",
   [(try_begin),
      (gt, "$g_player_reading_book", 0),
      (player_has_item, "$g_player_reading_book"),
      (str_store_item_name, s8, "$g_player_reading_book"),
      (str_store_string, s9, "@You are currently reading {s8}."),
    (else_try),
      (assign, "$g_player_reading_book", 0),

......ect...    

############################
  ("hunger_mod",0,
   "{s1}",
   "none",
   [
#hunger mod reports
    (try_begin),
        (eq, "$malus_de_faim", 0),    
        (str_store_string, s2, "@I am satisfied !", 0x33DD33),
    (else_try),
        (eq, "$malus_de_faim", 1),  
        (str_store_string, s2, "@i am hungry ! malus: for -9/ ag -6", 0xFF0000),
    (try_end),
     ],
    [
      ("continue",[],"Continue...",
       [(jump_to_menu, "mnu_reports"),
        ]
       ),
      ]
  ),
############################


  ("party_size_report",0,
   "{s1}",
   "none"
.........ect.......



Dawiduh said:
If people start in desert area they should automatically receive water. It makes sense.

Yes, it's simple, just add a bottle in a start game script at game_menu :smile: (if you have the variable :    (assign, "$current_town", "p_town_20"), (a saranid town) at start_phase_2 /game_menu/...something like that...

Code:
      ("begin_adventuring",[],"Become an adventurer and ride to your destiny.",[
           (set_show_messages, 0),
           (try_begin),
             (eq,"$character_gender",0),
             (troop_raise_attribute, "trp_player",ca_strength,1),
             (troop_raise_attribute, "trp_player",ca_charisma,1),
           (else_try),
             (troop_raise_attribute, "trp_player",ca_agility,1),
             (troop_raise_attribute, "trp_player",ca_intelligence,1),
           (try_end),

           (troop_raise_attribute, "trp_player",ca_strength,1),
           (troop_raise_attribute, "trp_player",ca_agility,1),
           (troop_raise_attribute, "trp_player",ca_charisma,1),
           
           (troop_raise_skill, "trp_player","skl_leadership",1),

      (try_begin),
        (eq,"$background_type",cb_noble),
        (eq,"$character_gender",tf_male),
        (troop_raise_attribute, "trp_player",ca_intelligence,1),
        (troop_raise_attribute, "trp_player",ca_charisma,2),
        (troop_raise_skill, "trp_player",skl_weapon_master,1),
        (troop_raise_skill, "trp_player",skl_power_strike,1),
        (troop_raise_skill, "trp_player",skl_riding,1),
        (troop_raise_skill, "trp_player",skl_tactics,1),
        (troop_raise_skill, "trp_player",skl_leadership,1),
        (troop_raise_proficiency, "trp_player",wpt_one_handed_weapon,10),
        (troop_raise_proficiency, "trp_player",wpt_two_handed_weapon,10),
        (troop_raise_proficiency, "trp_player",wpt_polearm,10),
###########################
      (try_begin),
(eq,"$current_town", "p_town_20"),
        (troop_add_item, "trp_player","itm_water",0),
         (try_end),

########################### 

       (troop_add_item, "trp_player","itm_regent2",0),
        (troop_add_item, "trp_player","itm_saddle_horse",imod_swaybacked),
        (troop_add_item, "trp_player","itm_black_brigandine",0),           
        (troop_set_slot, "trp_player", slot_troop_renown, 100),
        (call_script, "script_change_player_honor", 3),


If you want the script just for the desert, add on a thirst script:
Code:
          (try_begin),
           (party_get_current_terrain, ":cur_terrain", "p_main_party"),
            (eq, ":cur_terrain", rt_desert),
           (try_end),
Saddened for my lack of precision in english  :???:


ps: finaly, for your bottles meshes, make a 3D model of just a 2D mesh with a texture from a photo (transparancy for the texure and on brf settings)  :wink:

my 2D items quests:
HQlTt.jpg

If you want this brf and textures base , take my item_quest.brf on my mod, and make your items in 2D mesh quickly...

and of course, in module_item, report the meshes ID to your new items:

Code:
["key_1", "Key of a chest", [(*****"item_from_quest_16",0)********], itp_type_goods, 0, 0, weight(1)|abundance(0), imodbits_none ],
["key_2", "The Chambellan's key", [********("item_from_quest_17",0)********], itp_type_goods, 0, 0, weight(1)|abundance(0), imodbits_none ],
 
that is a great job,my friedn,my partner already make this:reduce morale if stay in desert too long...
actually,he also make water become a important resource same as food.
but,FantasyWarrior,my friend,your work will make this better.thanks
 
it's my pleasure  :mrgreen:


I added the following menu on edit in first post !
 
Reordering npc troops every 24 hours by level would be more interesting. But it is only available in Rubik's mod pack. :sad:


Or raise encumbrance penalty. I tried once running without equipment and with 123 kg weight. 123 kg made me slower only by ~30%.  :lol:
Some mods give you athletics penalty while wearing heavy armor.
 
I will really need a thirst script for my mod. Maybe both. It makes sense, but water is most important.

Too bad I don't have time to work on it right now.  :cry:
 
Dawiduh said:
I will really need a thirst script for my mod. Maybe both. It makes sense, but water is most important.

Too bad I don't have time to work on it right now.  :cry:

Hum, if i have the time i can make it  :???: but i t's not a promise...

and actualy, i make a "wounds or death script" sorry it's corect in english ?  :mrgreen:

it work like this:

-after every ko one chance to 6 to death (game over) the 5 others chances are:


-nothing
-leg wound = malus agility
-arms wound = malus strench & agility
-head wound = agility or strench ?..
ect...

and for every wounds (when not death) a variable set to 1 and a aviable dialogue for npc doctor, "i'am wounded/pay/variable set to 0"...

do you want this BIG script ? i can give it on a new thread if you want, the npc at module_troops/dialogues/scripts.. :razz:


I'm so sorry for this "english" but my mod is finished, i do not post here another time  :mrgreen: or just for give my scripts or resources...
 
That would be appreciated, haha. I think it will be a little more complicated.
If you have time and would like to do this give me a PM. Also right now I've suspended the work on the mod because I'm in the middle of a lot of work at the office. Hopefully in february I'll have more time to resume it.
 
I dont know for the thirst mod  :roll:  i'm ok, but later, in one or twos months for example...

(just a copie with some variables of the "need for food script" with the new items like water_begin/water_end)  :smile:

and i give my wounds or death script in this forum when it is finished  :razz:
 
Cool man, really appreciated. No need to hurry from me. I bet next time I have for working on my mod will be about 2 weeks in February.
 
This is awesome. It is exactly what I am trying to do in my mod.
However, I am trying to find to way to make all parties (including the lords' parties) suffer morale penalty if they do not have enough food or wander around too much.

Thank you so much for your script
 
This is rather. Nice. Well, there are some few Buggies which isn't worth your time. It wont really make any bug or something just a bit turned :razz:

Anyways Good Luck
 
ZeNinja said:
This is rather. Nice. Well, there are some few Buggies which isn't worth your time. It wont really make any bug or something just a bit turned :razz:

Anyways Good Luck

Sorry, i dont understand this  :lol:

You have encounter a bug ??? work perfectly for me.


note, if sombody want my next script and resources tell me please, beacause it's lot of work for me to make an osp pack with resources and codes  :???:

-a horses race !  :lol:

-tracks aviables in a district towns for 5/6 town (called in town menus)
-7 riders + player on the race track with different colors
-free training
-you can make bets and watch the curent race or you can ride on the next race yourself

(in progress)...

and excuse me for my "english" but i do my best  :???:

(i'm going to make some screenshots if you want  :razz:)...


edit:
vI0tX.jpg



"go to the horses race track"



VXgz4.jpg


QpmmM.jpg


_LVf-.jpg


2ZXRe.jpg



not finished for the moment...in one month ,beacause i want to play to my next version of my mod before  :mrgreen:
 
Is there a way to modify this whole script to take health aswell as stats and lead to eventual death (or simple game over menu)?
 
Back
Top Bottom