Author Topic: Tutorial: Creating new spawn points/parties  (Read 7544 times)

0 Members and 1 Guest are viewing this topic.

Kolba

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Kolba
Tutorial: Creating new spawn points/parties
« on: December 20, 2008, 10:36:10 PM »
Since old spawn points tutorials are really outdated, I decided to make actual one. Let's start!

1. Get something to drink and relax. :) 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: [Select]
("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: [Select]
("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: [Select]
(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: [Select]
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. :P

Thanks,
Kolba


Ruthven

  • Revs lil' helper
  • Grandmaster Knight
  • *
  • crushie crushie crushie
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
Re: Tutorial: Creating new spawn points/parties
« Reply #1 on: December 20, 2008, 10:37:56 PM »
Yeeoink! *Copies link*

BerserK

  • Regular
  • *
    • View Profile
Re: Tutorial: Creating new spawn points/parties
« Reply #2 on: December 20, 2008, 11:33:07 PM »
Great to see people contributing in info :) 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 :)

Keedo420

  • Knight at Arms
  • *
  • All glory to the Hypnotoad!!
    • View Profile
    • All glory to the Hypnotoad!
  • Faction: Bandit
Re: Tutorial: Creating new spawn points/parties
« Reply #3 on: December 21, 2008, 12:06:19 AM »
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:

Ruthven

  • Revs lil' helper
  • Grandmaster Knight
  • *
  • crushie crushie crushie
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
Re: Tutorial: Creating new spawn points/parties
« Reply #4 on: December 21, 2008, 12:07:18 AM »
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),

-Peter-

  • Master Knight
  • *
    • View Profile
  • Faction: Swadian
  • M&B
Re: Tutorial: Creating new spawn points/parties
« Reply #5 on: December 21, 2008, 12:14:14 AM »
Brilliant, thanks.

BerserK

  • Regular
  • *
    • View Profile
Re: Tutorial: Creating new spawn points/parties
« Reply #6 on: December 21, 2008, 12:15:40 AM »
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?

Ruthven

  • Revs lil' helper
  • Grandmaster Knight
  • *
  • crushie crushie crushie
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
Re: Tutorial: Creating new spawn points/parties
« Reply #7 on: December 21, 2008, 12:18:40 AM »
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

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Kolba
Re: Tutorial: Creating new spawn points/parties
« Reply #8 on: December 21, 2008, 10:28:31 AM »
Thanks, guys. If anyone want, I'll try to make a new quest tutorial. What do you think?


BerserK

  • Regular
  • *
    • View Profile
Re: Tutorial: Creating new spawn points/parties
« Reply #9 on: December 21, 2008, 11:59:19 AM »
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.

Llew

  • Cheap ass bum
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Vaegir
  • MP nick: nK_Llew
  • M&BWB
Re: Tutorial: Creating new spawn points/parties
« Reply #10 on: December 21, 2008, 02:05:51 PM »
Thanks, guys. If anyone want, I'll try to make a new quest tutorial. What do you think?


I say go for it!  :)

Kolba

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Kolba
Re: Tutorial: Creating new spawn points/parties
« Reply #11 on: December 21, 2008, 04:50:05 PM »
I started working on quest tutorial. It's quite big, so it will take me some time...

Ruthven

  • Revs lil' helper
  • Grandmaster Knight
  • *
  • crushie crushie crushie
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
Re: Tutorial: Creating new spawn points/parties
« Reply #12 on: December 21, 2008, 06:44:57 PM »
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.  :(

Dawg of War

  • Sergeant Knight at Arms
  • *
  • "Cry havoc and let slip the dogs of war!"
    • View Profile
  • Faction: Nord
  • MP nick: Dawg_of_War
  • M&BWBWF&S
Re: Tutorial: Creating new spawn points/parties
« Reply #13 on: December 21, 2008, 08:33:34 PM »
Excellent, thank you for this tutorial and your time. :D
A work in progress...

Kolba

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Kolba
Re: Tutorial: Creating new spawn points/parties
« Reply #14 on: December 21, 2008, 09:57:13 PM »
OK, I finished making tutorial, but it's really late here (2:00 AM) and I need to go bed. Good night!