What Terrain Type is 'Deep Ocean'- Adapting Water Travel to Warband - RESOLVED

正在查看此主题的用户

SkyShadowing

Sergeant
I'm adapting Ruthven's water travel script for use in Warband, and I'm trying to use fords to represent oceans that you can sail on.

I'm having trouble getting the icon to switch based on that, though. The only way I know the trigger is working is that immediately after starting a game, my player icon switches to a walking person. When I step onto the bit of ford I've laid down to test it, no go, doesn't work.

Anybody know what's wrong? Here's the code, for reference:

插入代码块:
(0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
      (neq,":terrain",8),], # rt_steppe is an example for the name of your new water terrain
   [(try_begin),
       (troop_get_inventory_slot, ":cur_horse", "trp_player", 8), #horse slot
    (assign, ":new_icon", -1),
     (try_begin),
      (eq, "$g_player_icon_state", pis_normal),
      (try_begin),
        (ge, ":cur_horse", 0),
        (assign, ":new_icon", "icon_player_horseman"),
      (else_try),
        (assign, ":new_icon", "icon_player"),
      (try_end),
    (else_try),
      (eq, "$g_player_icon_state", pis_camping), # All of this is thanks to Lumos bein' generous, and not being as much of a lazy arse as I am
      (assign, ":new_icon", "icon_camp"),
    (try_end),
]),
 

    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
      (neq,":terrain",8),], #Oh shi- ALL HAIL HYPNOTOAD
   [(party_set_icon,"p_main_party", "icon_player"),]),
 
 (0.1, 0, 0.0, [],
[(try_for_parties, ":cur_party"),
   (party_get_current_terrain, ":terrain", ":cur_party"),
   (eq, ":terrain", 8),
  (party_get_template_id, ":cur_template", ":cur_party"),
 (this_or_next|eq, ":cur_template", "pt_kingdom_hero_party"),
 (this_or_next|eq, ":cur_template", "pt_kingdom_caravan_party"),
 (this_or_next|eq, ":cur_template", "pt_manhunters"),
 (this_or_next|eq, ":cur_template", "pt_village_farmers"),
 (this_or_next|eq, ":cur_template", "pt_deserters"),
 (this_or_next|eq, ":cur_template", "pt_looters"),
 (this_or_next|eq, ":cur_template", "pt_forest_bandits"),
 (this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
 (this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
 (eq, ":cur_template", "pt_sea_raiders"),
   (party_set_icon, ":cur_party", "icon_ship"),
 (else_try),
   (neq,":terrain",8),
   (party_get_template_id, ":cur_template", ":cur_party"),
   (eq, ":cur_template", "pt_kingdom_hero_party"),
 (party_set_icon,":cur_party","icon_flagbearer_a"),
 (else_try),
 (eq, ":cur_template", "pt_kingdom_caravan_party"),
 (party_set_icon,":cur_party","icon_mule"),
 (else_try),
 (eq, ":cur_template", "pt_deserters"),
 (party_set_icon,":cur_party","icon_vaegir_knight"),
 (else_try),
 (eq, ":cur_template", "pt_manhunters"),
 (party_set_icon,":cur_party","icon_gray_knight"),
 (else_try),
  (eq, ":cur_template", "pt_village_farmers"),
 (party_set_icon,":cur_party","icon_peasant"),
 (else_try),
  (this_or_next|eq, ":cur_template", "pt_looters"),
 (this_or_next|eq, ":cur_template", "pt_forest_bandits"),
 (this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
 (this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
 (eq, ":cur_template", "pt_sea_raiders"),
 (party_set_icon,":cur_party","icon_axeman"),
 (else_try),
 (eq, ":cur_template", "pt_cattle_herd"),
 (party_set_icon,":cur_party","icon_cattle"),
 (try_end),]),
 
Aha, that works even better (for some reason I can't initialize the map with massive amounts of Fords)

Still the point remains, though. How do I get the party to change to a ship when they move onto water?

Also, how do I stop my guy from changing to a walking peasant a second into the game?
 
Small update and bump:

I found some new code in the Water Travel thread, and threw it in. I tested it using an already existing terrain (desert), and it worked as advertised.

So I only need to know now what rt_blah is deep ocean considered. I will send you one hundred million theoretical dollars if you can help me.  :grin:

插入代码块:
## SEA BATTLES BEGIN
(0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),(assign,reg1,":terrain")], # rt_steppe is an example for the name of your new water terrain
   [(try_begin),
       (troop_get_inventory_slot, ":cur_horse", "trp_player", 8), #horse slot
    (assign, ":new_icon", -1),
    (try_begin),
      (eq,reg1,0),
      (assign, ":new_icon", "icon_ship"),
     #(display_message,"@water"),
     (else_try),
      (eq, "$g_player_icon_state", pis_normal),
      (try_begin),
        (ge, ":cur_horse", 0),
        (assign, ":new_icon", "icon_player_horseman"),
        #(display_message,"@no water, horse"),
      (else_try),
        (assign, ":new_icon", "icon_player"),
        #(display_message,"@no water, no horse"),
      (try_end),
    (else_try),
      (eq, "$g_player_icon_state", pis_camping), # All of this is thanks to Lumos bein' generous, and not being as much of a lazy arse as I am
      (assign, ":new_icon", "icon_camp"),
    (try_end),
    (party_set_icon,"p_main_party", ":new_icon"),
]),
 

#    (0.1, 0, 0, [(party_get_current_terrain,":terrain","p_main_party"),
 #     (neq,":terrain",5),], #Oh shi- ALL HAIL HYPNOTOAD
 #  [(party_set_icon,"p_main_party", "icon_player"),
 #  (display_message,"@Not water"),
  # ]),
 
 (0.1, 0, 0.0, [],
[(try_for_parties, ":cur_party"),
   (party_get_current_terrain, ":terrain", ":cur_party"),
   (eq, ":terrain", 0),
  (party_get_template_id, ":cur_template", ":cur_party"),
 (this_or_next|eq, ":cur_template", "pt_kingdom_hero_party"),
 (this_or_next|eq, ":cur_template", "pt_kingdom_caravan_party"),
 (this_or_next|eq, ":cur_template", "pt_manhunters"),
 (this_or_next|eq, ":cur_template", "pt_village_farmers"),
 (this_or_next|eq, ":cur_template", "pt_deserters"),
 (this_or_next|eq, ":cur_template", "pt_looters"),
 (this_or_next|eq, ":cur_template", "pt_forest_bandits"),
 (this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
 (this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
 (eq, ":cur_template", "pt_sea_raiders"),
   (party_set_icon, ":cur_party", "icon_ship"),
 (else_try),
   (neq,":terrain",5),
   (party_get_template_id, ":cur_template", ":cur_party"),
   (eq, ":cur_template", "pt_kingdom_hero_party"),
 (party_set_icon,":cur_party","icon_flagbearer_a"),
 (else_try),
 (eq, ":cur_template", "pt_kingdom_caravan_party"),
 (party_set_icon,":cur_party","icon_mule"),
 (else_try),
 (eq, ":cur_template", "pt_deserters"),
 (party_set_icon,":cur_party","icon_vaegir_knight"),
 (else_try),
 (eq, ":cur_template", "pt_manhunters"),
 (party_set_icon,":cur_party","icon_gray_knight"),
 (else_try),
  (eq, ":cur_template", "pt_village_farmers"),
 (party_set_icon,":cur_party","icon_peasant"),
 (else_try),
  (this_or_next|eq, ":cur_template", "pt_looters"),
 (this_or_next|eq, ":cur_template", "pt_forest_bandits"),
 (this_or_next|eq, ":cur_template", "pt_steppe_bandits"),
 (this_or_next|eq, ":cur_template", "pt_mountain_bandits"),
 (eq, ":cur_template", "pt_sea_raiders"),
 (party_set_icon,":cur_party","icon_axeman"),
 (else_try),
 (eq, ":cur_template", "pt_cattle_herd"),
 (party_set_icon,":cur_party","icon_cattle"),
 (try_end),]),
## SEA BATTLES END
 
Vlejundo 说:
You mean rt_deep_ocean ?
That terrain type isn't listed in header_terrain_types, but yes, if it exists, I am forced to assume that that is the one I am looking for.

Is there somewhere else I should be looking for these things? I'm a newbie, still learning the ropes, just get lost sometimes.  :grin:
 
Thanks to help I got on the modding IRC channel, I was able to fix the problem by simply saying "alright, as long as it's NOT any of these, it must be this". I believe it was shik (sorry if I spelled the name wrong).

This issue has been resolved and is now functioning perfectly as intended (apart from a mixup when the player lands on the beach, the scene's a bit scrambled, but that's not high priority to me right now).
 
后退
顶部 底部