Author Topic: New kingdom management(Module system download post #3)  (Read 9901 times)

0 Members and 1 Guest are viewing this topic.

Berserker Pride

  • Grandmaster Knight
  • *
  • Fearless Scripter of the Berserk Mod
    • View Profile
  • Faction: Vaegir
  • MP nick: CoR_Berserker
  • WB
New kingdom management(Module system download post #3)
« on: November 02, 2009, 09:30:51 PM »
Module_Constants [Search for kingdom_heroes_begin]
(click to show/hide)
Module_Dialogues
(click to show/hide)
Module_Scripts [Search for the Scripts in question then edit them]
(click to show/hide)
#Module_Triggers New Triggers go at the bottom before the last ]
(click to show/hide)
#Module_Simple_Triggers Edit the first trigger the next two are new.  Again make sure you add a comma to the previous trigger at the end of the file if their isn't one #currently.
(click to show/hide)
#module_troops this is a sample troop tree for your new culture (culture_6
(click to show/hide)
module_factions
(click to show/hide)
module_party_templates
(click to show/hide)
module_game_menus two posts below due to character limit.
Credit must go to SPD_Phoenix, Ruthven, Cruger for assistance
and Highlander and Wicketshot for making their code open source so I could edit it.
The module system download is two posts below as well.
« Last Edit: January 22, 2010, 06:38:19 AM by Berserker Pride »

Cruger

  • Guest
Re: Help me write a new kingdom management!
« Reply #1 on: November 02, 2009, 10:09:14 PM »
Without having checked anything about it, I just have a thought:

The reason why that the simple trigger that respawn parties isn't working is obviously because that it only respawn troops that are between kingdom_heroes_begin and kingdom_heroes_end .. It might work if you change the kingdom_heroes_begin to "trp_npc1" instead of "trp_kingdom_1_lord" .. Besides the simple triggers that refresh AI etc also only refresh troops between kingdom_heroes_begin and kingdom_heroes_end,  so putting the the npcs in this will also prevent complete inactivity from their side..

Just an idea, hope you can make it working..

Berserker Pride

  • Grandmaster Knight
  • *
  • Fearless Scripter of the Berserk Mod
    • View Profile
  • Faction: Vaegir
  • MP nick: CoR_Berserker
  • WB
Re: Help me write a new kingdom management!
« Reply #2 on: November 02, 2009, 10:12:19 PM »
module_game_menus here due to post length.
(click to show/hide)
Here is a native module_system with all kingdom management code added.  Compiled clean so it should work for all of your purposes.
http://www.megaupload.com/?d=7A4NZWIP
« Last Edit: December 20, 2009, 02:28:20 AM by Berserker Pride »

Ruthven

  • Revs lil' helper
  • Grandmaster Knight
  • *
  • crushie crushie crushie
    • View Profile
  • Faction: Neutral
  • MP nick: irc://Ruthven
Re: Help me write a new kingdom management!
« Reply #3 on: November 02, 2009, 11:25:21 PM »
When the companions become lords, make sure to give them +20 or 30 relations with the player, that way they'll listen more often etc.

Berserker Pride

  • Grandmaster Knight
  • *
  • Fearless Scripter of the Berserk Mod
    • View Profile
  • Faction: Vaegir
  • MP nick: CoR_Berserker
  • WB
Re: Help me write a new kingdom management!
« Reply #4 on: November 03, 2009, 12:06:05 AM »
Good idea. 

Come to think of it they might end up being at a really high relation of the start if the companion was.  My companions tend to stay at 90ish.  I bet they are still there when they become a lord.

I fixed the not being a marshal thing by adding one line to the script that activates player faction.

Hmm well they talk to me now but still aren't listening.  Right now they are acting like lords of a faction you are friendly with but aren't part or.  And the create party script is cloning the heroes.

EDIT2) IT WORKS!!!  Just had to wait a while.  Also had to edit a certain simple trigger above the main one.  But good old Casca from my mod appeared ready and willing to cause some destruction.  Now I just need to test the trigger that auto-disbands her party if she loses her castle.  Basically every week a trigger runs and checks if any of your companion lords have no powerbase.  If it finds one it disbands their party flags them as a companion and forces them into your party(even if it is full).  Combine this script with a quick tweak to let lords of a defeated faction join you and you are golden.  NE in an early version had there be a chance for lords of a wiped out faction to join your kingdom.  It was a matter of removing a couple lines from a script to implement.
« Last Edit: November 03, 2009, 07:04:57 AM by Berserker Pride »

SoTAL

  • Sergeant at Arms
  • *
  • Wannabe modder.
    • View Profile
  • Faction: Nord
  • MP nick: Dath
  • WB
Re: Help me write a new kingdom management!
« Reply #5 on: November 04, 2009, 03:10:05 PM »
This seems really nice. Any chance for an open-source realease when you're all done with it?  :wink:

"Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac." - George Carlin.
"The ability to quote is a serviceable substitute for wit" - Somerset Maugham.

Dawg of War

  • Sergeant Knight at Arms
  • *
  • The Stagmeister
    • View Profile
  • Faction: Nord
  • MP nick: Dawg_of_War
  • M&BWBWF&S
Re: Help me write a new kingdom management!
« Reply #6 on: November 04, 2009, 06:52:59 PM »
This seems really nice. Any chance for an open-source realease when you're all done with it?  :wink:

He will post it for modders to use I'm sure.

Berserker Pride

  • Grandmaster Knight
  • *
  • Fearless Scripter of the Berserk Mod
    • View Profile
  • Faction: Vaegir
  • MP nick: CoR_Berserker
  • WB
Re: Help me write a new kingdom management!
« Reply #7 on: November 04, 2009, 07:27:59 PM »
Yeah so far I have the following accomplished.
Can make any companion you talk to with over 15 charisma become a companion lord if you have a town or castle to give them they now start at +30 relation to you. (done)
If they have over 8 leadership they get bonus renown and an even bigger army(done)
Lords of a defeated faction will have a chance to join your kingdom(done but not tested however should work)
If your companions lose their town or castle they will disband their army after a week and become a companion in their party again(done)
Bonus just to stir the pot I wrote a little trigger that assigns all lords on the map(including your companions a readiness of 99.  This will make them more prone to group together and form massive multilord armies.  It also helps your lords by making them almost entirely likely to continue following you and not run off.  Mine is set to happen every three months.(done)
The only thing that I have to test is that defeated lords of a faction do join your kingdom properly and make sure that your companions take your current flag for their own.

But I will post the full script in this thread and the share script thread for modders to use once I am done.
« Last Edit: December 19, 2009, 10:05:36 PM by Berserker Pride »

Lumos

  • Grandmaster Knight
  • *
  • Did you say anything?
    • View Profile
  • Faction: Nord
  • WB
Re: Help me write a new kingdom management!
« Reply #8 on: November 05, 2009, 10:00:11 AM »
This will be great, but I'm a fan of managing your kingdom through a game menu. As far as I can tell, you are planning it through scripts and dialogs. Would you like me (after you release it) to port it to game menus, so you can choose how to manage? (And allowing bigger in-game freedom, too)

Berserker Pride

  • Grandmaster Knight
  • *
  • Fearless Scripter of the Berserk Mod
    • View Profile
  • Faction: Vaegir
  • MP nick: CoR_Berserker
  • WB
Re: Help me write a new kingdom management!
« Reply #9 on: November 05, 2009, 05:26:09 PM »
Sure.  I was going to do menus but I suck at making arrays and stuff so I didn't know how to select individual companions.  Whereas when you use dialogues you just use $g_talk_troop and the game knows who to deal with.  The main thing was to make sure that every companion lord had to get a castle or town.

So far everything else works I just need to test if villages are using the right culture now.

FrisianDude

  • Coitus non Awesome
  • Grandmaster Knight
  • *
  • ... and let's keep this as civil as possible
    • View Profile
  • Faction: Neutral
  • MP nick: OLL_SirAndelot/Warden Leo
  • M&BWB
Re: Help me write a new kingdom management!
« Reply #10 on: November 05, 2009, 05:42:55 PM »
Sounds very nice. :)
Nords ruled by King Ragnar, Khergits ruled by Sanjar Khan, Rhodoks ruled by King Graveth, Swadians ruled by King Harlaus, Vaegirs ruled by King Yaroglek. All those peoples live, fight, and die in the continent of Calradia. The Nords and Rhodoks field solely infantry and archers, the Swadians and Vaegirs have infantry, archers and cavalry and the Khergit field almost exclusively cavalry. No such things as "infarty" or "calvary" exist. A nice link to my mod ;)

Wu-long

  • Sergeant Knight at Arms
  • *
    • View Profile
  • Faction: Vaegir
  • MP nick: Wulong
  • WBWF&S
Re: Help me write a new kingdom management!
« Reply #11 on: November 07, 2009, 08:06:11 PM »
YEAH ITS SOMETHING NEW!! AND Management  :lol:

Berserker Pride

  • Grandmaster Knight
  • *
  • Fearless Scripter of the Berserk Mod
    • View Profile
  • Faction: Vaegir
  • MP nick: CoR_Berserker
  • WB
Re: Help me write a new kingdom management!
« Reply #12 on: November 14, 2009, 02:56:27 AM »
Ok the final steps to this have been kicking my ass.   
Two main problems. 
1)No matter what I do I can't seem to get the villages to switch to my new kingdom culture whether they belong to me or I have already given them to a vassal.  Here is what I am currently using for that purpose.
(click to show/hide)
2)I thought this was working but my trigger to disband a hero's party if they lose their castle is misfiring.  It should only fire when that heroes castle is captured.  I had it fire because I had a castle that I retained for myself.  Here is the trigger for that.
(click to show/hide)
       Hopefully someone knows what I am doing wrong here.

Cruger

  • Guest
Re: Help me write a new kingdom management!
« Reply #13 on: November 14, 2009, 09:36:46 AM »
About the village problem, I think it would work to change the script_village_recruit_volunteers_recruit..

You will have to do the same in the mnu_recruit_volunteers, this script is only used when you recruit volunteers by talking to the village elder..

("village_recruit_volunteers_recruit",
    [
     (store_faction_of_party, ":center_faction", "$current_town"),
     (try_begin),
     (eq,":center_faction","fac_player_supporters_faction"),
     (faction_get_slot, ":volunteer_troop", "fac_player_supporters_faction", slot_faction_tier_1_troop),
     (else_try),

     (party_get_slot, ":volunteer_troop", "$current_town", slot_center_volunteer_troop_type),
     (try_end),
     (party_get_slot, ":volunteer_amount", "$current_town", slot_center_volunteer_troop_amount),
     (party_get_free_companions_capacity, ":free_capacity", "p_main_party"),
     (val_min, ":volunteer_amount", ":free_capacity"),
     (store_troop_gold, ":gold", "trp_player"),
     (store_div, ":gold_capacity", ":gold", 10),#10 denars per man
     (val_min, ":volunteer_amount", ":gold_capacity"),
     (party_add_members, "p_main_party", ":volunteer_troop", ":volunteer_amount"),
     (party_set_slot, "$current_town", slot_center_volunteer_troop_amount, -1),
     (store_mul, ":cost", ":volunteer_amount", 10),#10 denars per man
     (troop_remove_gold, "trp_player", ":cost"),   
     ]),
« Last Edit: November 14, 2009, 11:47:45 AM by Cruger »

Berserker Pride

  • Grandmaster Knight
  • *
  • Fearless Scripter of the Berserk Mod
    • View Profile
  • Faction: Vaegir
  • MP nick: CoR_Berserker
  • WB
Re: Help me write a new kingdom management!
« Reply #14 on: November 14, 2009, 11:02:26 AM »
Good idea.  I will do that then.  Thanks for the assist. 

I could have sworn the trigger I had to autodisband a lord party was firing correctly.  Maybe it was just a glitch.  Previously the companion party would only disband when the castle was taken.  I suspect the problem is here.

(party_get_slot, ":lord", ":center_no", slot_town_lord),#####Checks all centres to see which of the companions is a lord.
 (try_for_range,":companion_lord","trp_npc1","trp_kingdom_heroes_including_player_begin"),#Need to put all potential companions in a range.###
    (troop_slot_eq, ":companion_lord", slot_troop_occupation, slto_kingdom_hero),###have been made a vassal###
    (neq,":lord",":companion_lord"),####finds any companion vassal that isn't also a town or castle lord this will be the one who is brought back into your party.

Oh one last problem I wrote a script that is supposed to make the villages of a centre you give to a companion belong to you.  But right now they revert to unowned when you assign the companion as the lord of a town or castle.  What the script is supposed to do is assign the player as the lord of those villages.

« Last Edit: November 15, 2009, 01:19:52 AM by Berserker Pride »