WFaS Coding Presentations Problem

Users who are viewing this thread

Yagababa

Regular
Hey all,

I'm trying to learn how to work with module_presentations, but can't seem to get even a simple example to work:

Code:
("player_blood_screen_1", prsntf_read_only, 0, [
    (ti_on_presentation_load,
        [
        (create_mesh_overlay, "$g_blood_screen_state", "mesh_mp_score_a"),
        (position_set_x, pos1, 1000),
        (position_set_y, pos1, 1000),
        (overlay_set_size, "$g_blood_screen_state", pos1),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, "$g_blood_screen_state", pos1),

        (presentation_set_duration, 999999),
        ]),
    (ti_on_presentation_run,
        [
        (create_mesh_overlay, "$g_blood_screen_state", "mesh_mp_score_a"),
        (position_set_x, pos1, 1000),
        (position_set_y, pos1, 1000),
        (overlay_set_size, "$g_blood_screen_state", pos1),
        (position_set_x, pos1, 0),
        (position_set_y, pos1, 0),
        (overlay_set_position, "$g_blood_screen_state", pos1),

        (presentation_set_duration, 999999),
           ]),
]),

I'm just trying to put a block on the screen, but it flickers on for a fraction of a second then goes away. Does anyone know what I'm doing wrong?
 

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Why are you executing the same code twice? That's not necessary and might be the reason for your problem. I started out with presentations looking up this thread here: https://forums.taleworlds.com/index.php?threads/presentations-basic.358674/
Afterwards try to find a Native presentation which achieves something similar and copy paste and adapt the scripts to your likings. Presentations are sometimes a lot of trial and error.
 
Upvote 0
Solution

Yagababa

Regular
Why are you executing the same code twice? That's not necessary and might be the reason for your problem. I started out with presentations looking up this thread here: https://forums.taleworlds.com/index.php?threads/presentations-basic.358674/
Afterwards try to find a Native presentation which achieves something similar and copy paste and adapt the scripts to your likings. Presentations are sometimes a lot of trial and error.
Thanks I'll check it out.
 
Upvote 0

Yagababa

Regular
I needed a while to find it again but this here is probably what you want to achieve, isn't it?
Yes I was looking at that--my script is for multiplayer so I'm trying to open the presentation via this:

Code:
blood_screen = (ti_on_agent_spawn, 0, 0,
[
    (neg|multiplayer_is_server),
    (store_trigger_param_1, ":agent_no"),
    (multiplayer_get_my_player, ":player"),
    (player_get_agent_id, ":agent", ":player"),
    (eq, ":agent", ":agent_no"),
    (display_message, "@{!} Checks out"),
],
[
    (start_presentation, "prsnt_player_blood_screen_1"),
])

It seems to work initially (the presentation opens), but as soon as any other agents spawn it closes for some reason even though the condition isn't met...
 
Upvote 0

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Take a look how the presentations for the round number and heraldic icons at the top left is made. Not sure at the moment which name the presentation has but it is the only presentation which I recall is permanently open for the player.
 
Upvote 0
  1. Why is there a post marked as solved if the issue has not been solved? That is not good to do that, whoever marked it.
  2. The snippet does not have to be in the two blocks of the presentation.
  3. Connected to 4. - you may check out my MP-only mod linked below (Varena NeoGK) that has bloody screen working after being slain (togglable). I worked a lot with MP and can attest to MP having some stuff broken which otherwise runs fine in SP. Camera and few permanent presentations had some issues which were fine in SP.
  4. I recommend you not to use meshes for the bloody screen, as indicated in the thread Earendil linked, because it is an old and outdated method. Use (mission_cam_animate_to_screen_color, 0x********, *), #0x|**|**|**|** - first two asterisks are Alpha (00 - transparent, FF - opaque), the rest is RRGGBB because it was introduced more recently with VC and it was for MP (primarily). That was the operation I used and it worked fine. VC introduced many useful MP operations which are not popular or have remained relatively unknown because they were introduced too late to the party (such as try_for_players).
  5. If you have tested it on local server - (neg|multiplayer_is_server), will make it not work on local server.
  6. The below script should make the job done (it works in my mod, but remember to fill out the last command's variables marked with asterisks - see header_operations.py for details).
    Python:
    blood_screen = (ti_on_agent_spawn, 0, 0, [],
              [
              (neg|multiplayer_is_dedicated_server), #local server is allowed for testing purposes
              (store_trigger_param_1, ":agent_no"),
            
              (multiplayer_get_my_player, ":my_player_no"),
              (player_get_agent_id, ":player_agent", ":my_player_no"),
            
              (eq, ":agent_no", ":player_agent"),
              (mission_cam_animate_to_screen_color, 0x********, *), #0x|**|**|**|** - first two asterisks are Alpha (00 - transparent, FF - opaque), the rest is RRGGBB
              ])
  7. If you want to revert the effect, just implement the following.
    Python:
    normal_screen = (ti_on_agent_killed_or_wounded, 0, 0, [],
              [
              (neg|multiplayer_is_dedicated_server),
              (store_trigger_param_1, ":dead_agent_no"),
            
              (multiplayer_get_my_player, ":my_player_no"),
              (player_get_agent_id, ":player_agent", ":my_player_no"),
              (eq, ":dead_agent_no", ":player_agent"),
            
              (mission_cam_animate_to_screen_color, 0x********, *), #0x|**|**|**|** - first two asterisks are Alpha (00 - transparent, FF - opaque), the rest is RRGGBB
              ])
  8. (Optional) - what mod are you working on for WFaS? Just curious if it is for public or not.
 
Upvote 0

Yagababa

Regular
  1. Why is there a post marked as solved if the issue has not been solved? That is not good to do that, whoever marked it.
  2. The snippet does not have to be in the two blocks of the presentation.
  3. Connected to 4. - you may check out my MP-only mod linked below (Varena NeoGK) that has bloody screen working after being slain (togglable). I worked a lot with MP and can attest to MP having some stuff broken which otherwise runs fine in SP. Camera and few permanent presentations had some issues which were fine in SP.
  4. I recommend you not to use meshes for the bloody screen, as indicated in the thread Earendil linked, because it is an old and outdated method. Use (mission_cam_animate_to_screen_color, 0x********, *), #0x|**|**|**|** - first two asterisks are Alpha (00 - transparent, FF - opaque), the rest is RRGGBB because it was introduced more recently with VC and it was for MP (primarily). That was the operation I used and it worked fine. VC introduced many useful MP operations which are not popular or have remained relatively unknown because they were introduced too late to the party (such as try_for_players).
  5. If you have tested it on local server - (neg|multiplayer_is_server), will make it not work on local server.
  6. The below script should make the job done (it works in my mod, but remember to fill out the last command's variables marked with asterisks - see header_operations.py for details).
    Python:
    blood_screen = (ti_on_agent_spawn, 0, 0, [],
              [
              (neg|multiplayer_is_dedicated_server), #local server is allowed for testing purposes
              (store_trigger_param_1, ":agent_no"),
           
              (multiplayer_get_my_player, ":my_player_no"),
              (player_get_agent_id, ":player_agent", ":my_player_no"),
           
              (eq, ":agent_no", ":player_agent"),
              (mission_cam_animate_to_screen_color, 0x********, *), #0x|**|**|**|** - first two asterisks are Alpha (00 - transparent, FF - opaque), the rest is RRGGBB
              ])
  7. If you want to revert the effect, just implement the following.
    Python:
    normal_screen = (ti_on_agent_killed_or_wounded, 0, 0, [],
              [
              (neg|multiplayer_is_dedicated_server),
              (store_trigger_param_1, ":dead_agent_no"),
           
              (multiplayer_get_my_player, ":my_player_no"),
              (player_get_agent_id, ":player_agent", ":my_player_no"),
              (eq, ":dead_agent_no", ":player_agent"),
           
              (mission_cam_animate_to_screen_color, 0x********, *), #0x|**|**|**|** - first two asterisks are Alpha (00 - transparent, FF - opaque), the rest is RRGGBB
              ])
  8. (Optional) - what mod are you working on for WFaS? Just curious if it is for public or not.
Thanks, I ended up figuring it out based on the linked thread so that's why I marked it. I had no idea about animate to screen color--that might come in handy for my next idea.

I'm working on a personal mod that borrows a lot of meshes from other projects (I haven't made it public, I'm not sure it's worth the hassle to clear everything), so I'm just trying to release OSP's for some of the more interesting scripts I've come up with.
 
Upvote 0
I had no idea about animate to screen color--that might come in handy for my next idea.
Not many people know some of the more recent VC operations for MP. For example, some people may still use get_max_players and try_for_range instead of try_for_players alone.

Good luck with your project, it is rare to see someone still mod WFaS as Warband has enjoyed much bigger popularity.
 
Upvote 0
Top Bottom