SP Tutorial World Map Creating new spawn points/parties

Currently Viewing (Users: 0, Guests: 1)

Kolba

Since old spawn points tutorials are really outdated, I decided to make actual one. Let's start!

1. Get something to drink and relax. :smile: Think about new party.
2. Open your module system folder, and then module_troops.py. Make new soldiers for your new party. Or skip this point, if you want to use Native troops.
3. Save file and open module_parties.py. Now you need to create new spawn point. Paste following line to the bottom of file (before "]"):

Code:
("new_sp"   ,"new_sp",pf_disabled|pf_is_static, no_menu, pt_none, fac_outlaws,0,ai_bhvr_hold,0,(57, 86),[(trp_looter,15,0)]),
Let's analyse all the code. You can also add your own SP attributes, by searching in header_parties.py.

new_sp - is an ID of your spawn point. It won't show in game, because it's only useful for references in all module system files.

new_sp - is a name of your party. It won't show in game, since...

pf_disabled - it's disabled! The spawn point's name MUST BE disabled, you don't want to see new location on map named "new_sp", right?

no_menu - menu is only needed for new locations, not spawn points.

pt_none - leave it alone.

fac_outlaws - is a name of party faction. You can change it by replacing it with existing faction, or adding new in module_factions.py.

ai_bhvr_hold - it's party behaviour. To change, see header_parties.py.

57, 86 - they're geographical coordinates on map of Calradia. I suggest you to work with Thorgrim's Map Editor and get most satisfacting coordinates.

trp_looter,15,0 - it's not important, so leave it alone (only good for towns/settlements).

4. Great, now let's save it and go to...module_party_templates.py. Paste following line, wherever you want:

Code:
("sea_band","Sea Band",icon_axeman|carries_goods(2),0,fac_outlaws,bandit_personality,[(trp_sea_raider,5,50),(trp_looter,2,15),(trp_mountain_bandit,5,10)]),
It's our new party. Replace "sea_band" with your own ID, "Sea Band" with your own name of party. You can add your own troops into the stacks. Let's analyse:

trp_sea_raider,5,50:

a) trp_sea_raider is an ID of your troop.
b) 5 is minimal amount of troops in party
c) 50 is maximal amount of troops in party

5. Save file. Open module_scripts.py. Stroke CTRL+F and put in: "spawn_bandits" (with quotation marks!). Paste below the first "end_try" this code:

Code:
(try_begin),
       (store_num_parties_of_template, ":num_parties", "pt_sea_band"),
       (lt,":num_parties",14),
       (store_random,":spawn_point",num_new_sp),
       (val_add,":spawn_point","p_new_sp"),
       (spawn_around_party,":spawn_point","pt_sea_band"),
     (try_end),
6. And finally open module_constants. Search for "num_sea_raider_spawn_points = 2". Paste below:

Code:
num_new_sp = 1
"One" is a number of spawn points, so you can optionaly increase it, adding practically THE SAME spawn point (step "3"), but with another ID (but it's not needed now). Save everything, build module and you should see a Sea Band (or whatever did you named it) running around the map. It's end!

There may be some errors, so correct me, please. :razz:

Thanks,
Kolba

 

BerserK

Regular
Best answers
0
Great to see people contributing in info :smile: It would be great if you could add some explanation to other of your code like you did in module_parties.py code. And for my personal interest, do you know everything about this part (trp_sea_raider,5,50)? I mean how it really works.. for example when I start game I have never seen party with maximum soldiers, but when my character grows it seem to grow with it and with larger level I never seen party with small numbers.

Also (lt,":num_parties",14), .. how this works? Is that a number of maximum that kind of party on map? Am I right?

Also, I think its better to write in hear to make it more informative then start new thread, how do you make some party spawn after some given time, like 5 ingame days?

And again thanks for great work on helping people :smile:
 

Keedo420

Knight at Arms
Best answers
0
Reading this thread reminded me of an interesting little oddity that occured to me ingame the other day. I've got it setup in my mod so that when you encounter a party of enemies, any nearby enemy groups will join the battle. Well, I attacked some sea raiders close to the sea raiders spawn point near Wercheg, and in addition to seeing "Sea Raiders has joined the battle on the side of the enemy", I also saw "Sea Raiders SP has joined the battle on the side of the enemy". :lol:
 

Mad Skillz

Baron
WBM&BVC
Best answers
0
the "(trp_sea_raider,5,50)" is just the minimum and maximum of soldiers, and will be generated randomly anywhere between there.

To make a party spawn after 5 days, do this: (I stole it from saxondragon, although I edited this one a bit.)

(store_current_hours, ":cur_hours"),
      (try_begin),
        (gt,":cur_hours",120),
                (try_begin),
                    (store_num_parties_of_template, ":num_parties", "pt_sea_raiders"),
                    (lt,":num_parties",14),
                        (store_random,":spawn_point",num_sea_raider_spawn_points),
                        (val_add,":spawn_point","p_new_spawn_point"),
                        (spawn_around_party,":spawn_point","pt_heretics_army"),
                   
                (try_end),
    (try_end),
 

BerserK

Regular
Best answers
0
Thanks Ruthven. So (lt,":num_parties",14), checks for how much that kind of party's is on map and add them back to this number what is 14 in this case?
 

Mad Skillz

Baron
WBM&BVC
Best answers
0
BerserK said:
Thanks Ruthven. So (lt,":num_parties",14), checks for how much that kind of party's is on map and add them back to this number what is 14 in this case?
Yes, if I understand what you're saying.
 

Kolba

Thanks, guys. If anyone want, I'll try to make a new quest tutorial. What do you think?

 

BerserK

Regular
Best answers
0
If you have nothing to do and are willing to help people, maybe start some kind of code dictionary. As it goes for me, I rather then just copy some code and paste it, want to know how it works, so I could understand it better and generate my own ideas. It really helps, specially in beginning when you know almost nothing but the info in module system tutorial.
 

Kolba

I started working on quest tutorial. It's quite big, so it will take me some time...
 

Mad Skillz

Baron
WBM&BVC
Best answers
0
Kolba said:
I started working on quest tutorial. It's quite big, so it will take me some time...
You are my new best friend. Every time I try to make a new quest I mess up the game and quit trying.  :sad:
 

Kolba

OK, I finished making tutorial, but it's really late here (2:00 AM) and I need to go bed. Good night!
 

M.Minkov

Sergeant at Arms
Best answers
0
Big THANKS for this tutorial Kolba :!:

I have just 1 question though - I've made the new SP to belong to certain faction and gave it the param pf_show_faction and everything works fine, except that the parties are just patroling around the point and although they got attacked by rival factions, they do not attack enemies themseves and do not flee from them as well - I think the problem should be either in parties or parties templates - where the behavior is defined, but although I've tried to switch both of them - the fisrt I sat to default_behavior and the second one to attack_parties(or it was the other way around...), the result is all the same.....
 

FrisianDude

Archduke
M&BWB
Best answers
0
Thanks, just what I needed! :eek:

Edit: I used it, it worked brilliantly. My only question is how do I get it to spawn slightly less parties at the same time? It spawned six or so.
 

Kiado

Regular
Best answers
0
FrisianDude said:
My only question is how do I get it to spawn slightly less parties at the same time? It spawned six or so.
That is defined below, I added the comment in the code:
Code:
(try_begin),
       (store_num_parties_of_template, ":num_parties", "pt_sea_band"),
       (lt,":num_parties",14),  # Change this number to the maximum parties you want on the map. <------- ####
       (store_random,":spawn_point",num_new_sp),
       (val_add,":spawn_point","p_new_sp"),
       (spawn_around_party,":spawn_point","pt_sea_band"),
(try_end),
You can also have them spawn like he said at multiple spots if you don't want them all in one spot. 

Just add another "new_sp", but change it to "new_sp_1" and "new_sp_2" with whatever coordinates you want, and change the num_new_sp = 2 in the module_constants file. 

 

saxondragon

Sergeant Knight
Best answers
0
Great idea Kolba..

May I add the second half to this, which is the ability to customize a response when the new party is encountered.

In this case the Party template encountered is "pt_renegade_knights".

This is a snipped I wrote and is found in module_dialogs.py

Code:
#RENEGADE KNIGHTS  TALK - conversion completed
  [party_tpl|pt_renegade_knights|auto_proceed,"start", [(eq,"$talk_context",tc_party_encounter)], "Warning: This line should never be displayed.", "renegade_knights_1",[
	
	  (store_random_in_range, reg1, 11, 16),
      #        (display_message, "@variable reg1 is {reg1}"),
             (try_begin),
                 (lt,reg1,12),
                  (play_sound, "snd_encounter_dark_knight_mendicant"),
                  (str_store_string, s4, "@ You!  Stand aside mendicant and show your betters proper respect!"),
              (else_try),
                 (lt,reg1,13),
                 (play_sound, "snd_encounter_dark_knight_feat_of_arms"),
                 (str_store_string, s4, "@  challenge you warrior!  Prove your honor in a feat of arms, or die trying!"),
              (else_try), 
                 (lt,reg1,14),
                 (play_sound, "snd_encounter_dark_knight_next_life"),
                 (str_store_string, s4, "@ Hail and well met!  Prepare yourself for a long journey.. into your next life!"),
              (else_try), 
                 (lt,reg1,15),
                 (play_sound, "snd_encounter_dark_knight_test_steel"),
                 (str_store_string, s4, "@ Ah good!  Just in time to test my steel!"),
              (else_try), 
                 (lt,reg1,16),
                 (play_sound, "snd_encounter_dark_knight_have_at_thee"),
                 (str_store_string, s4, "@ Have at thee!"),
             (try_end),
             
  ]],
  [party_tpl|pt_renegade_knights,"renegade_knights_1", [], "{s4}", "renegade_knights_2",[]],
  [party_tpl|pt_renegade_knights|plyr,"renegade_knights_2", [[store_character_level,reg(1),"trp_player"],[lt,reg(1),4]], "So be it!  En Garde!" , "close_window",
   [[encounter_attack]]],
  [party_tpl|pt_renegade_knights|plyr,"renegade_knights_2", [[store_character_level,reg(1),"trp_player"],[ge,reg(1),4]], "<Salute> I promise that your death will be swift.", "close_window",
   [[encounter_attack]]],

This is set up to allow unique sounds, or voice overs as the case may be, to play with the encounter dialogue and randomizes slightly what the dialog will be. 

Hope that this is helpful.

Best regards,

Saxondragon