Role Play Mod For PW - Questions/Concerns (to be named)

Users who are viewing this thread

Somerled

Recruit
Hello Vornne,

First of all, I must say that I am very impressed with PW and always have been. My friend Agnos and I ran HCRP and have always been fans of roleplay. We wanted something more, and didn't feel that the economy and a few features of PW were friendly to serious roleplay (on a WRP/SRP level). However, we also felt that a lot of the features in PW were simply outstanding, which is why we want to create a hybrid of it.

So far we have completely reworked the economy to near realism and we have made it so that craftsman and sellers do not get rewards. Instead they must actually roleplay selling off goods. Then the goods can be taken by the purchaser and "sold" (no reward gained) to the stockpiles. If a shopkeeper on our map (which has shops that are closed off to people not in the factions where you "take" something off one of the shelves (buying it) and pass it through the counter using an invisible chest, then he does indeed have to buy it. Now the shopkeeper can set his prices higher or lower, but since he has to actually buy the item off of the shelf to deliver it, the game keeps shopkeepers (who are sometimes selling very expensive items) from becoming outrageously rich. All items are linked to the money chest pertaining to the faction to simulate item tax and keep the two lords who will be running the two major factions richer than everyone else.

With that aspect working out perfectly, we have a number of questions and concerns that I either can't answer or the coding skill to complete the tasks in question is simply above me.

-We would like to get rid of faction chat and possibly global chat, as well as decrease the radius of local chat, and perhaps add in a whisper function. Getting rid of faction chat sounds simple enough but I am not sure where I would be editing.

-Would it be possible to have your health bar decrease over time if you have not eaten recently?

And now for the mother of all of my woes:

The bloody map.
Salva allowed Agnos and I to edit borderlands. Agnos has reworked the terrain and "cropping" quite a bit to make the entire map consist of one town, one village, and one castle. He has done a remarkable job with it. Then I took up what he edited and added in the details and fixed the props to make the map fit our new economy system. All fine and dandy.

Once I completed that, I decided to take some artistic liberty. I created a drawbridge loading dock and warehouses for stockpiles. I added a number of braziers_with_fire all with light_red to enhance the effects. I created a public execution stage and a massive village bonfire. The most significant, however, is the mines. I created an intricate maze with many different levels and floors out of randomly rotated large scaled rocks. I hid iron mines in between juts and crevices. The thing is MASSIVE.

With all of these edits, the map became truly outstanding, and maybe too much so. After finishing all of the work this morning, I saved it without an issue and proceeded to test it for a while on the spawnable horse and on foot. Satisfied, I made sure I saved and exited the game. Now I get on and I try to edit the scene. It freezes for a moment after you click "Edit Scene" under the drop box. Then it either crashes to the desktop or stops responding (Mount and Blade: Warband has stopped working - close program). I have tried editing it countless times. Agnos tried putting it up on our test server. You can only stay in it for a tiny bit, unable to spawn for some reason, before you crash. BNS Marko brainstormed the problem with me, and he believes it might have something to do with the large number of props or the battlefield_smoke particle prop that was placed on the village bonfire. We tried having me send him the map files but it crashed on his more powerful computer as well.

The map is 809 KB. I tried editing it with all of my video settings in warband (including directx7, with environment shadows enabled, force single threading, and load textures on demand) to no avail.

Do you Vornne or does anyone have any answers to the questions or this map issue? Is the map save-able?

Thanks and much appreciated folks.

*UPDATE* I just went onto the test server where the map is being hosted. It looks like all of the props are present but the terrain is messed up. Some of it doesnt seem to be showing up and the rest seems to be altered heavily to the point where props in the distance are floating and nothing remotely lines up. I am only able to stay on for about 25-30 seconds before I lose connection.

*SECOND UPDATE* Alright so I got an overhead view of the map before I lost connection. The terrain code must be screwed up because there is a tiny square of terrain in one corner of the map and nothing but floating props everywhere else. My version of the map edits was only made up of additions and translations of scene props. If Agnos has the old terrain code of his before i added more scene props.... can I add it to the scenes.txt to restore it to its old terrain?


*THIRD UPDATE* Well I managed to pull out the old terrain code and now the map works absolutely fine. Hurray! Definitely going to start making back ups now  :smile:
 
Just dropping in to say...

If you've got the wrongs scene code for the map, that will certainly create issues - though I'm not sure if crashing is one of them (I've done it a few times, but I've never crashed because of it), though that will explain spawning strangely, as you will be trying to spawn outside the map.

Though concerning the crashing - it is a common issue with maps containing a large number of props, likely an issue related to Warband not being designed to handle so many props on a map - so in other words, you've probably added way too much, and the only way to solve it is via rolling back to your last map backups (you should backup your maps on a regular basis if you haven't).

That, or you've made edits to scene props or scripts, thus causing the issues you're experiencing.

Also about hunger decreasing health - I suggest you look at the poison code and see how it's done to work out how to adapt it to hunger. Then for editing local chat and faction chat, check out the related scripts (We've done the same thing).
 
N0body said:
Then for editing local chat and faction chat, check out the related scripts (We've done the same thing).

Thanks, but do you know where those scripts are located? I'm very new to modding, coding, and scening with no prior experience. Usnavy was teaching me the very basics.
 
While you are welcome to create a mod based on the PW module system with whatever design you want, the name you have chosen does not comply with the license conditions included with the module system code and in the sticky thread in this board: you must not use "PW" "Persistent World" or anything similar enough to cause confusion in your module name. Be sure to read the full conditions before releasing your mod.

As for any other questions, I'll try to reply later when I am at home with more time.
 
Somerled said:
-We would like to get rid of faction chat and possibly global chat, as well as decrease the radius of local chat, and perhaps add in a whisper function. Getting rid of faction chat sounds simple enough but I am not sure where I would be editing.
A simple way to disable faction chat would be to remove the faction_chat_pressed trigger from the default "common_triggers" generator function in module_mission_templates, which would probably be enough; though if you wanted to prevent the possibility of people tweaking their client to add that trigger back in and send faction chat, you could edit the big script game_receive_network_message, deleting the handler for faction chat messages (search module_scripts for chat_event_type_faction and remove that else_try section).

Adding a whisper function would be more complicated, but you might want to rename the faction chat to "whisper" as probably the easiest solution (quick and dirty): you would then just edit the aforementioned chat_event_type_faction handler to send to other players based on a distance check like for normal local chat, rather than comparing faction id; you would also want to edit the client display handler for faction chat (search for server_event_faction_chat) to have similar code to the local chat handlers (server_event_local_chat), but using a different color parameter for the display_message and script_chat_overlay_add_to_local_buffer calls. Or, you could read all the related scripts and presentations to understand how to write a proper implementation.
Somerled said:
-Would it be possible to have your health bar decrease over time if you have not eaten recently?
Yes, that would not be difficult at all: as suggested above, just read the code for poison damage and passive healing (in script check_agent_health) to damage agents who have a food value of 0, or another similar implementation that you want.
 
Code:
 ("check_agent_health", # server: check for armor encumbrance, poison, and passive healing effects
   [(store_script_param, ":agent_id", 1), # must be valid

    (try_begin),
      (agent_is_alive, ":agent_id"),
      (agent_get_slot, ":armor_speed_factor", ":agent_id", slot_agent_armor_speed_factor),
      (try_begin),
        (is_between, ":armor_speed_factor", 20, reduction_factor_base),
        (agent_get_horse, ":horse_agent_id", ":agent_id"),
        (eq, ":horse_agent_id", -1),
        (set_fixed_point_multiplier, 100),
        (agent_get_speed, pos1, ":agent_id"),
        (position_get_y, ":speed", pos1),
        (gt, ":speed", 10),
        (store_random_in_range, ":pause", 0, ":armor_speed_factor"),
        (gt, ":pause", 20),
        (agent_set_animation, ":agent_id", "anim_pause_encumbered"),
      (try_end),
      (agent_get_slot, ":poison_amount", ":agent_id", slot_agent_poison_amount),
      (try_begin),
        (agent_set_slot, ":poison_amount", 1000000),
        (store_mul, ":damage", ":poison_amount", 6),
        (val_min, ":damage", 10),
        (store_agent_hit_points, ":hit_points", ":agent_id", 1),
        (val_sub, ":hit_points", ":damage"),
        (agent_set_hit_points, ":agent_id", ":hit_points", 1),
        (try_begin),
          (le, ":hit_points", 0),
          (agent_get_slot, ":poisoner_agent_id", ":agent_id", slot_agent_poisoner_agent_id),
          (try_begin),
            (gt, ":poisoner_agent_id", -1),
            (agent_is_active, ":poisoner_agent_id"),
            (agent_get_slot, ":poisoner_player_uid", ":agent_id", slot_agent_poisoner_player_uid),
            (try_begin),
              (gt, ":poisoner_player_uid", -1),
              (agent_get_player_id, ":poisoner_player_id", ":poisoner_agent_id"),
              (player_is_active, ":poisoner_player_id"),
              (player_get_unique_id, ":poisoner_check_uid", ":poisoner_player_id"),
              (eq, ":poisoner_check_uid", ":poisoner_player_uid"),
              (assign, ":poisoner_player_uid", -1),
            (try_end),
            (eq, ":poisoner_player_uid", -1),
          (else_try),
            (assign, ":poisoner_agent_id", ":agent_id"),
          (try_end),
          (agent_deliver_damage_to_agent, ":poisoner_agent_id", ":agent_id", 10),
        (try_end),
      (try_end),
      (agent_get_slot, ":food_amount", ":agent_id", slot_agent_food_amount),
      (try_begin),
        (agent_set_slot, ":food_amount", 50),
        (store_agent_hit_points, ":hit_points", ":agent_id", 0),
        (lt, ":hit_points", 100),
        (agent_get_troop_id, ":troop_id", ":agent_id"),
        (troop_get_slot, ":min_health_percentage", ":troop_id", slot_troop_spawn_health_percent),
        (val_min, ":min_health_percentage", 50),
        (ge, ":hit_points", ":min_health_percentage"),
        (val_sub, ":food_amount", 2),
        (agent_set_slot, ":agent_id", slot_agent_food_amount, ":food_amount"),
        (store_agent_hit_points, ":hit_points", ":agent_id", 1),
        (val_add, ":hit_points", 1),
        (agent_set_hit_points, ":agent_id", ":hit_points", 1),
        (store_mod, ":remainder", ":food_amount", 3),
        (eq, ":remainder", 0), # only send food bar updates to the player's client about every 5% used
        (agent_get_player_id, ":player_id", ":agent_id"),
        (player_is_active, ":player_id"),
        (multiplayer_send_3_int_to_player, ":player_id", server_event_agent_set_slot, ":agent_id", slot_agent_food_amount, ":food_amount"),
      (try_end),
    (try_end),
    ]),

Would this work?
 
Shyana said:
        (agent_set_slot, ":poison_amount", 1000000),

        (agent_set_slot, ":food_amount", 50),
Would this work?
No: you have only made two tiny changes (isolated in the quote), which don't make any sense: the agent_set_slot operation must always have an agent id as the first parameter (the ":food_amount" variable will almost always correspond to an invalid or unrelated agent id), and it must have the slot number next (normally written as one of the constants in module_constants), then the value. Your code would mostly output screeds of script errors to the server console, eventually crashing the server, and occasionally set slots 1000000 and 50 of random agents to 0 (the default value of an operation parameter if you don't specify it).

See the module system syntax guide, linked from the sticky thread of this board.
 
    (agent_get_slot, ":food_amount", ":agent_id", slot_agent_food_amount),
      (try_begin),
        (lt, ":food_amount", 1),
        (store_mul, ":damage", ":food_amount", 6),
        (val_min, ":damage", 10),
        (store_agent_hit_points, ":hit_points", 1),
        (val_sub, ":hit_points", ":damage"),
        (agent_set_hit_points, ":hit_points", 1),
        (try_end),

Would this by chance work?
 
Exara said:
Would this by chance work?
No, there is a flaw caused by these lines:
Exara said:
        (lt, ":food_amount", 1),
        (store_mul, ":damage", ":food_amount", 6),
The first line ensures the food_amount value is 0 (the official PW scripts never allow it to be less than 0), and then you multiply 6 times 0, which results in no damage ever being dealt. Even if you had other added scripts that could cause agent food to drop into negative values, your script would then only heal players. If you are running that code in the check_agent_health script, it is called about every 30 seconds, damaging only 1 hit point would cause most players without food to die within 30 minutes. I suggest just subtracting a fixed amount as your "damage" value; if you want players to die faster, just use a bigger damage value.

Another quirk of the module system: using the agent_set_hit_points operation can make the health drop right down to 0, but it will never actually cause death; so if you want players to die when their hit points decreases to 0, add something like (le, ":hit_points" 0), (agent_deliver_damage_to_agent, ":agent_id", ":agent_id", 100), to the end.

Note that any bots that you might want to use would soon die from this script: to prevent bots and horses from being affected, run checks like agent_is_human, neg|agent_is_non_player or agent_get_player_id then player_is_active.
 
Shyana said:
if you changed (lt, ":food_amount", 1), to (lt, ":food_amount", 2), would that then fix it?
Not really: that would only damage health in the rare condition that the agent had exactly 1 food point, which would not last long because of the passive health regeneration (official PW feature).
 
I am not a mod developer but a beginner scene maker. Cant wait for bannerlord PW map creation!

Anyways, I too love PW, many thanks Vornne, you are my hero. But I still wish there was even more to be done about RP. I'm sure you and Vornne will be tired of my "suggestions" by the time bannerlord actually comes out. I recently posted a suggestion to improve ships for better RP (no response yet doh)

Basically, I just wanted to say anybody who is working on making PW even more RP friendly has my support. So whatever you got planned here good luck to you. There are many posts here and other places about the (realism vs fun) or (roleplay restrictions vs more open gameplay) I tend to always fall on the side that says put in even more restriction and rules to curb non rp play. and add more and more elements to improve RP (like better ships or rideable passenger carts, or scenes with lots of RP spots) I usually support people who like to try new things like removing global or making economy changes etc, despite the others around that like to shoot down any change whatsoever but still like to claim that "PW is dead"

Keep up the good work guys.
 
Would it be something like
(try_begin),
    (lt, ":food_amount", 1),
        (try_begin),
            (store_agent_hit_points, ":health", ":player_id", 1),
            (agent_set_hit_points, ":player_id", ":health" - 2 , 1),
        (try_end),
(try_end),
 
Shyana said:
Would it be something like
No, you can't do subtraction (or any other mathematical operation) involving a local variable directly in a M&B operation parameter, at the Python code level: you need to use a separate val_sub operation (or whichever appropriate). As explained in a previous reply, the agent_set_hit_points operation will never cause death by itself.

Also, the extra try_begin try_end block you added is unnecessary, because neither of the store_agent_hit_points or agent_set_hit_points operations can fail, so the extra try block will never have any effect.
 
Vornne said:
Shyana said:
Would it be something like
No, you can't do subtraction (or any other mathematical operation) involving a local variable directly in a M&B operation parameter, at the Python code level: you need to use a separate val_sub operation (or whichever appropriate). As explained in a previous reply, the agent_set_hit_points operation will never cause death by itself.

Also, the extra try_begin try_end block you added is unnecessary, because neither of the store_agent_hit_points or agent_set_hit_points operations can fail, so the extra try block will never have any effect.

Yes, but when you fall or get kicked/punched you will instantly die.
 
Shyana said:
Would it be something like
    (lt, ":food_amount", 1),
        (try_begin),
            (store_agent_hit_points, ":health", ":player_id", 1),
            (val_sub, ":health",2),
            (agent_set_hit_points, ":player_id", ":health" , 1),
        (try_end),
 
Check if the health is greater than the value you want to remove of the health + the food bar is smaller than the value = Remove health cause no food.
Afterwards just remove it in small amounts. If you remove like 2 health/food it should take like 15-20 minutes until the full food bar or health bar is empty.
 
Back
Top Bottom