OSP Kit Campaign Sea Battles Mk. II & Misc Scenes

Users who are viewing this thread

I've added ships to my mod and it works great, thanks.  I have two suggestions for improvements:

1.  Add a confirm box before you actually buy a ship.  I've accidentally bought ships in Brytenwalda because the position of the menu items changes on the screen if you own the town or have a productive enterprise or both. 

2.  Change the player's ship to a different icon.

How do you do those things?
 
Something along the lines of this: (I didn't compile it so no guarantees.) 

Change the sail from port menu to this:
Code:
      ("sail_from_port",[(this_or_next|eq,"$current_town","p_town_1"),
                         (this_or_next|eq,"$current_town","p_town_2"),
                         (this_or_next|eq,"$current_town","p_town_6"),
                         (this_or_next|eq,"$current_town","p_town_12"),
                         (this_or_next|eq,"$current_town","p_town_19"),
                         (this_or_next|eq,"$current_town","p_town_13"),
                         (eq,"$current_town","p_town_15"),
#                          (eq, "$cheat_mode", 1),
#                         (party_slot_eq,"$current_town",slot_town_near_shore, 1),
                         ], "Buy a ship (5000 denars)",
             (jump_to_menu, "mnu_confirm_ship"),

        ]),
Ad this at the bottom of game_menus before the closing bracket. 
Code:
  ("confirm_ship",menu_text_color(0xFF000000)|mnf_disable_all_keys,
   "Are you sure that you want to buy a ship?",
  "none",
    [],
    [
     ("confirm",[],"I would like to buy a ship.",
       [(store_troop_gold,":money","trp_player"),
      (try_begin),
        (ge,":money",5000),
        (troop_remove_gold,"trp_player",5000),
        (assign, "$g_player_icon_state", pis_ship),
        (party_set_flags, "p_main_party", pf_is_ship, 1),
        (party_get_position, pos1, "p_main_party"),
        (map_get_water_position_around_position, pos2, pos1, 6),
        (party_set_position, "p_main_party", pos2),
        (assign, "$g_main_ship_party", -1),
        (change_screen_return),
      (else_try),
        (display_message,"@You don't have enough money"),
      (try_end),
        ]
       ),

     ("go_back",[],"Go Back...",
       [(jump_to_menu, "mnu_town_center"),
        ]),  
    ]
  ),

As for the icon, someone else can answer that, I've got to go.  :razz:
 
I don't see why you can't put the money check in the condition block itself. As for the icon, either use (party_set_icon, "p_main_party", "icon_whatever"), or modify the trigger that checks for $g_player_icon_state in every frame.
 
Somebody said:
I don't see why you can't put the money check in the condition block itself. As for the icon, either use (party_set_icon, "p_main_party", "icon_whatever"), or modify the trigger that checks for $g_player_icon_state in every frame.

I have it like that in my mod, I just don't have access to the source code from this PC. 
 
When i compile it, Its was always failure. The Python says it because an error in "module_game_menus.py" file. Can someone script it and give it to me?  :cry: :cry:
 
Bolkonsky said:
Something along the lines of this: (I didn't compile it so no guarantees.) 

            (jump_to_menu, "mnu_confirm_ship"),

Thank you, Bolkonsky.  It worked except that you apparently have to have brackets around:

[(jump_to_menu, "mnu_confirm_ship"),]

Thanks again.
 
One more little thing.  The ship icon makes no sound when traveling.  I saw that in module_map_icons it uses "footsteps_on_grass" so I changed it to "gallop" just to see if I could hear it.  I couldn't.
I have a sailing sounds .ogg I want to use for the ship icon.
What do I have to do to make it work?
 
Idibil said:
You can use a tigger, when player is in ship game touch a song (ship song?)

You can add it to tigger of sea battles

True, except I'm not just trying to get the sound to play, I'm trying to understand why the sound doesn't play now.

Consider module_map_icons:
("player",0,"player", avatar_scale, snd_footstep_grass, 0.15, 0.173, 0),
("player_horseman",0,"player_horseman", avatar_scale, snd_gallop, 0.15, 0.173, 0),

When the player is dismounted I hear footsteps.  When he is mounted I hear gallop.

If I change the sound for the player icon:
("player",0,"player", avatar_scale, snd_gallop, 0.15, 0.173, 0),
I hear gallop when he's dismounted.

But when I change the sound for the ship:
("ship",mcn_no_shadow,"boat_sail_on", 0.23, snd_gallop, 0.0, 0.05, 0),

I don't hear anything no matter what sound I put in the tuple.  Why does it work for "player" and "player_horseman" but not for "ship?"
 
I did everything completely, but I get some errors.

Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Traceback (most recent call last):
  File "process_mission_tmps.py", line 64, in <module>
    save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 48, in save_mission_templates
    save_triggers(file,convert_to_identifier(mission_template[mission_template_n
ame_pos]), mission_template[mission_template_triggers_pos],variables,variable_us
es,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 21, in save_triggers
    file.write("%f %f %f "%(trigger[trigger_check_pos],trigger[trigger_delay_pos
],trigger[trigger_rearm_pos]))
TypeError: float argument required, not str
Exporting game menus data...
Error: Unable to find object:mt_ship_battle
ERROR: Illegal Identifier:mt_ship_battle
Error: Unable to find object:mt_ship_battle
ERROR: Illegal Identifier:mt_ship_battle
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: g_leave_town
WARNING: Global variable never used: g_battle_result
WARNING: Global variable never used: g_train_peasants_against_bandits_training_s
ucceeded
WARNING: Global variable never used: attacker_team
WARNING: Global variable never used: trainer_help_message
WARNING: Global variable never used: tutorial_1_finished
WARNING: Global variable never used: tutorial_2_finished
WARNING: Global variable never used: tutorial_3_finished
WARNING: Global variable never used: tutorial_4_finished
WARNING: Global variable never used: tutorial_5_finished
WARNING: Global variable never used: g_base_flag_team_1
WARNING: Global variable never used: g_base_flag_team_2
WARNING: Global variable never used: g_last_number_of_agents_around_belfry
WARNING: Global variable never used: g_multiplayer_round_max_seconds_div_2
WARNING: Global variable never used: g_tutorial_training_ground_current_score_2
WARNING: Global variable never used: g_tutorial_training_ground_conversation_sta
te
WARNING: Global variable never used: g_belligerent_drunk_leaving
WARNING: Global variable never used: g_belligerent_drunk
WARNING: Global variable never used: g_hired_assassin
WARNING: Global variable never used: g_tutorial_training_ground_state
WARNING: Global variable never used: g_tutorial_training_ground_melee_trainer_at
tack_dir
WARNING: Global variable never used: relative_of_merchant_is_found
WARNING: Global variable never used: talked_with_merchant
WARNING: Global variable never used: merchant_sign_count
WARNING: Global variable never used: g_city_merchant_troop_id
WARNING: Global variable never used: g_city_merchant_agent_id
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

How can I solve this problem?  :razz:
 
UP

Sgt.Agression said:
I did everything completely, but I get some errors.

Initializing...
Compiling all global variables...
Exporting strings...
Exporting skills...
Exporting tracks...
Exporting animations...
Exporting meshes...
Exporting sounds...
Exporting skins...
Exporting map icons...
Creating new tag_uses.txt file...
Creating new quick_strings.txt file...
Exporting faction data...
Exporting item data...
Exporting scene data...
Exporting troops data
Exporting particle data...
Exporting scene props...
Exporting tableau materials data...
Exporting presentations...
Exporting party_template data...
Exporting parties
Exporting quest data...
Exporting info_page data...
Exporting scripts...
Exporting mission_template data...
Traceback (most recent call last):
  File "process_mission_tmps.py", line 64, in <module>
    save_mission_templates(variables,variable_uses,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 48, in save_mission_templates
    save_triggers(file,convert_to_identifier(mission_template[mission_template_n
ame_pos]), mission_template[mission_template_triggers_pos],variables,variable_us
es,tag_uses,quick_strings)
  File "process_mission_tmps.py", line 21, in save_triggers
    file.write("%f %f %f "%(trigger[trigger_check_pos],trigger[trigger_delay_pos
],trigger[trigger_rearm_pos]))
TypeError: float argument required, not str
Exporting game menus data...
Error: Unable to find object:mt_ship_battle
ERROR: Illegal Identifier:mt_ship_battle
Error: Unable to find object:mt_ship_battle
ERROR: Illegal Identifier:mt_ship_battle
exporting simple triggers...
exporting triggers...
exporting dialogs...
Checking global variable usages...
WARNING: Global variable never used: g_leave_town
WARNING: Global variable never used: g_battle_result
WARNING: Global variable never used: g_train_peasants_against_bandits_training_s
ucceeded
WARNING: Global variable never used: attacker_team
WARNING: Global variable never used: trainer_help_message
WARNING: Global variable never used: tutorial_1_finished
WARNING: Global variable never used: tutorial_2_finished
WARNING: Global variable never used: tutorial_3_finished
WARNING: Global variable never used: tutorial_4_finished
WARNING: Global variable never used: tutorial_5_finished
WARNING: Global variable never used: g_base_flag_team_1
WARNING: Global variable never used: g_base_flag_team_2
WARNING: Global variable never used: g_last_number_of_agents_around_belfry
WARNING: Global variable never used: g_multiplayer_round_max_seconds_div_2
WARNING: Global variable never used: g_tutorial_training_ground_current_score_2
WARNING: Global variable never used: g_tutorial_training_ground_conversation_sta
te
WARNING: Global variable never used: g_belligerent_drunk_leaving
WARNING: Global variable never used: g_belligerent_drunk
WARNING: Global variable never used: g_hired_assassin
WARNING: Global variable never used: g_tutorial_training_ground_state
WARNING: Global variable never used: g_tutorial_training_ground_melee_trainer_at
tack_dir
WARNING: Global variable never used: relative_of_merchant_is_found
WARNING: Global variable never used: talked_with_merchant
WARNING: Global variable never used: merchant_sign_count
WARNING: Global variable never used: g_city_merchant_troop_id
WARNING: Global variable never used: g_city_merchant_agent_id
Exporting postfx_params...

______________________________

Script processing has ended.
Press any key to exit. . .

How can I solve this problem?  :razz:
 
If the parser is complaining that you need a float instead of string, most likely you wrote some ti_on_whatever_trigger in quotes like a string, while it's actually a floating-point constant.

Search your file for "ti_on_ (quote included)
 
This is not an error. It's just module builder giving you a warning about some sloppy programming. If there's an error, it was before these lines in the builder output.
 
I love this mod  :grin:

Thanks Ruthven  :grin:

One problem is that if you fall into the water you can't get up or drown  :sad:

And how can I make "ship raider" not go too far away on the map?

Does any one know if there is any pirate ship out there?
 
I can't retreat from the sea battles?!

So if I fall in to the water and all of my troops are dead (and I can't retreat) what should I do?!

Please help me !
 
Put damage on full to self, so that you die when you fall of a ship? Or code a check to kill you when you get a certain height.
 
Back
Top Bottom