Author Topic: Sea Battles  (Read 13583 times)

Guest

  • Guest
Sea Battles
« Reply #15 on: August 05, 2009, 06:38:00 AM »
What/where are the files? I've searched for the files named, and they don't exist anywhere on my entire computer. Do I need to create them?

Jubal

  • Megadux
    Executive Officer
  • Posts: 30952
  • Karma: 124
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Sea Battles
« Reply #16 on: August 05, 2009, 08:21:22 AM »
You need a copy of;
- Python, the language by which M&B modding works
- the ModuleSystem, a set of Python scripts released by the developers which can be compiled to make mods.

These can both be found on the TaleWorlds official forum.
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

cdvader

  • Posts: 3
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #17 on: August 29, 2009, 09:50:13 PM »
Hey man. This is some nice contribution you've made to the whole modding community, etc. So I thought I'd help you with some issues you had previously. Hope I will help.

In this thread, http://forums.taleworlds.net/index.php/topic,53962.0.html, I saw you were having problems by "connecting" scene props. You can "connect" objects by using the (position_transform_position_to_parent) or (position_transform_position_to_local). I recommend using the transform to local variant.

And in this thread, http://forums.taleworlds.net/index.php/topic,72933.msg1893703.html#msg1893703, I saw you had a pretty ... no offense: crappy code. Try this code, it should work.

Code: [Select]
   #CdVader - Ship Collision fixer.
#Put this in your ship's mission template.
    (1, 0, ti_once, [],
    [(scene_prop_get_instance, ":player_ship", "spr_player_ship", 0),
 (scene_prop_get_instance, ":enemy_ship", "spr_enemy_ship", 0),
 (prop_instance_get_position, pos1, ":player_ship"),
     (prop_instance_get_position, pos2, ":enemy_ship"),
 (try_begin),
    (get_distance_between_positions, pos1, pos2),
(lt, ":distance", 400),
(position_move_z, pos1, 200),
(position_move_z, pos2, -200),
(prop_instance_animate_to_position, pos1, ":player_ship", 400), #4 seconds.
(prop_instance_animate_to_position, pos2, ":enemy_ship", 400), #4 seconds.
 (try_end),
 (assign, "$boardedd", 1),
]),

Again, I hope I helped,
cdvader.

PS: Download this file for the "cleaner" version.

Attachments:
« Last Edit: August 29, 2009, 10:06:12 PM by cdvader »

deathincarnatelolz

  • Posts: 2
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #18 on: August 30, 2009, 08:42:23 AM »
Quote from: "cdvader"
Hey man. This is some nice contribution you've made to the whole modding community, etc. So I thought I'd help you with some issues you had previously. Hope I will help.

In this thread, http://forums.taleworlds.net/index.php/topic,53962.0.html, I saw you were having problems by "connecting" scene props. You can "connect" objects by using the (position_transform_position_to_parent) or (position_transform_position_to_local). I recommend using the transform to local variant.

And in this thread, http://forums.taleworlds.net/index.php/topic,72933.msg1893703.html#msg1893703, I saw you had a pretty ... no offense: crappy code. Try this code, it should work.

Code: [Select]
   #CdVader - Ship Collision fixer.
#Put this in your ship's mission template.
    (1, 0, ti_once, [],
    [(scene_prop_get_instance, ":player_ship", "spr_player_ship", 0),
 (scene_prop_get_instance, ":enemy_ship", "spr_enemy_ship", 0),
 (prop_instance_get_position, pos1, ":player_ship"),
     (prop_instance_get_position, pos2, ":enemy_ship"),
 (try_begin),
    (get_distance_between_positions, pos1, pos2),
(lt, ":distance", 400),
(position_move_z, pos1, 200),
(position_move_z, pos2, -200),
(prop_instance_animate_to_position, pos1, ":player_ship", 400), #4 seconds.
(prop_instance_animate_to_position, pos2, ":enemy_ship", 400), #4 seconds.
 (try_end),
 (assign, "$boardedd", 1),
]),

Again, I hope I helped,
cdvader.

PS: Download this file for the "cleaner" version.
Where do I put the ship code??

And where do I put this:

Spoiler: click to toggle

cdvader

  • Posts: 3
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #19 on: August 30, 2009, 10:28:48 AM »
Quote from: "Deathincarniatelolz"
Where do I put the ship code??
You mean my Ship Collision fixer? It goes to your "ship_battle" mission template, but do not use it yet. Jubal needs to play around with the values on the script.

Quote from: "Deathincarniatelolz"
And where do I put this:
As Jubal said, you need to put it in your "Town" menu.

Jubal

  • Megadux
    Executive Officer
  • Posts: 30952
  • Karma: 124
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Sea Battles
« Reply #20 on: September 06, 2009, 05:01:06 PM »
Thanks, I'll test this soon. Just got back from holiday.
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

mr wabbit

  • Posts: 1
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #21 on: October 17, 2009, 01:18:28 AM »
Interesting I have tested and found it to work fine though a few little issues I thought I would bring up

Ships can take some time to reach each, also the smoke particals overlay on the deck of the ship so makes the ship look like its sinking.
Camp menu needs sorting
After battles you become a person running on water though maintain the ship status

I wouldnt find playing around sometime.

Also whats the verdict on cdvader's little collision fix
Also at the start the bandits swamp thir its impossible to get close

Also you can buy ships from all towns though not able to move from other towns easily ie constant do you want to disembark.

Lastly a little thing I noticed, not changed it in case it was purposefull chances unlikily.
Quote
Add this to module_party_templates;
Code:
 ("sea_pierats","Sea Pirates",icon_ship|pf_is_ship|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_sea_raider,20,35)]),

Last but not least the strings dont seem to work I am probley being silly and placed them wrong am rather tired, oh and highlighted a spelling issue
Module_strings;
Quote
These show you which command you have given yur ship;
Code:
 ("hold", "Drop the anchor and hold here!"),
 ("skirmish", "Skirmish with the enemy!"),
 ("board", "Close in and board the enemy ship!"),
 ("numberofships", "{reg60}"),

Hope all this helps I hope to go though more detail soon

Jubal

  • Megadux
    Executive Officer
  • Posts: 30952
  • Karma: 124
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Sea Battles
« Reply #22 on: October 17, 2009, 09:33:37 AM »
The yur is not purposeful, the pierats is.

I'm working on an updated version of all this code, the stuff I've got in SR now hopefully has some major improvements.
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

COGlory

  • Posts: 6
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #23 on: December 30, 2009, 11:47:36 PM »
Sorry for the necro, but....

It keeps saying that (store_random,":spawn_point",num_sea_pirate_spawn_points),

is not defined.  I've gone to party_templates.py and checked, and the spawn points were sea_pirate_spawn_point
and
sea_pirate_spawn_point_2
and
sea_pirate_spawn_point_3

so I tried changing them in the script and it still didn't work.  Any help?  Thanks!

Jubal

  • Megadux
    Executive Officer
  • Posts: 30952
  • Karma: 124
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Sea Battles
« Reply #24 on: December 31, 2009, 11:15:57 AM »
Try changing that to a constant which is the number of sea pirate spwans you have?
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

COGlory

  • Posts: 6
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #25 on: January 04, 2010, 08:21:51 PM »
Change into a constant?  How?

Also, has anyone had any problems during a land battle it keeps saying "[Debug Line Reached]

COGlory

  • Posts: 6
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #26 on: January 25, 2010, 12:46:20 AM »
Alright, I changed it into a constant, and it still gives me errors, only they say:

"sea_pirate_spawn_point" not defined

COGlory

  • Posts: 6
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #27 on: January 08, 2011, 06:56:40 PM »
Since I still actually use this thread for a reference, the module_game_menus.py code should be this:

Code: [Select]
    ("sail_from_port",[(party_slot_eq,"$current_town",slot_party_type, spt_town),
                        # (party_slot_eq,"$current_town",slot_town_near_shore, 1),  #Should remain commented when code implemented.  ~CO
                        ], "Buy a ship (2000 denars)",  #Note: (--Code needs to be revised to check if player has gold.  ~CO--) <--DONE!  ~CO
      [(store_troop_gold, ":gold", "trp_player"),
  (assign, "$g_player_icon_state", pis_ship),
  (try_begin), #begin check if player has gold
    (ge, ":gold", 2000), #if players gold is 2000 or greater, then give ship
         (party_set_flags, "p_main_party", pf_is_ship, 1),
         (troop_remove_gold, "trp_player", 2000),
         (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), #if not, then display message
    (display_message, "@You don't have enough denars!"),  
  (try_end),
       ]),

Otherwise, you can buy the ship even if you don't have 2000 denars.

Jubal

  • Megadux
    Executive Officer
  • Posts: 30952
  • Karma: 124
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Sea Battles
« Reply #28 on: January 08, 2011, 08:38:37 PM »
Yesh, on my version I simply stopped the menu appearing if you had under 2000 denars, but I never added that to the public code for some reason. Thanks, anyhow.
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

COGlory

  • Posts: 6
  • Karma: 0
    • View Profile
    • Awards
Sea Battles
« Reply #29 on: February 28, 2011, 03:12:08 AM »
Well, for anyone wondering how to do that:


     ("sail_from_port",[(party_slot_eq,"$current_town",slot_party_type, spt_town),
        (store_troop_gold, ":gold_check", "trp_player"),
         (eq, ":gold_check", 2000),      
                        ],
                  "Buy a ship (2000 denars)",


:P

(Good idea, by the way.)