Author Topic: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)  (Read 19004 times)

0 Members and 1 Guest are viewing this topic.

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Another response to something odd noted a number of different places across the forums: your warlord/noble/monarch character is fool enough to wander unsuspecting into towns and villages without an escort for protection and thus can get caught outnumbered by ruffians or unawares by an assassin at any turn.

The following trigger can be added to the appropriate mission_templates to allow a set number of your NPC companions join you as you visit towns and villages. As coded, the number of bodyguards available to a player is governed by their renown and leadership skill: 1 bodyguard per 3 levels of leadership or 400 points of renown up to a maximum of 4 bodyguards. The guards are taken from the non-wounded NPC/heroes/companions that player has in their party, in the order they appear in the party list...just as they would be taken for a bandit raid mission or some such.


Without further ado...
UPDATED!
(click to show/hide)

Also, to avoid odd dialog if the player chooses to talk with their guard/escort, one line is needed in module_dialogs
(click to show/hide)



(click to show/hide)
« Last Edit: January 25, 2011, 02:54:28 PM by Caba`drin »



ithilienranger

  • Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: ithilienranger
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #1 on: December 30, 2010, 08:14:41 PM »
Thanks, this will save me some time.

Idibil

  • Grandmaster Knight
  • *
    • View Profile
    • Nova Regula
  • Faction: Nord
  • MP nick: CeltíberoIdibil
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #2 on: December 30, 2010, 08:53:37 PM »
I will look this idea for 1.33!

Thank you Caba'Drin

Lumos

  • Probably Not a Help Desk
  • Grandmaster Knight
  • *
  • Mens INsana in corpore sano
    • YouTube - LumosX
    • View Profile
  • Faction: Nord
  • M&BWBWF&SNW
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #3 on: December 31, 2010, 02:31:06 PM »
Nice. Combined with my customised town battles code... it will be awesome.

Mastaninja

  • Regular
  • *
  • Snoogins
    • View Profile
  • Faction: Bandit
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #4 on: January 02, 2011, 03:22:12 AM »
Will this work with Mount and Blade(not Warband)?

theAthenian

  • Guest
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #5 on: January 02, 2011, 06:00:27 PM »
Quote
Will this work with Mount and Blade(not Warband)?

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #6 on: January 02, 2011, 07:13:52 PM »
Quote
Will this work with Mount and Blade(not Warband)?

No guarantees, as I don't have original M&B, but it doesn't use any commands that have been added since the 1.113 version of Warband (when I started modding Warband) so I doubt that it uses any Warband-specific commands. But I'm not sure.

It wouldn't be painful to just toss it in and test, though. ...and to report back as inquiring minds will want to know.



lovebeatles

  • Recruit
  • *
    • View Profile
  • Faction: Sarranid
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #7 on: January 24, 2011, 02:04:11 AM »
when i enter a city or town do not appear the bodyguards, I should have 2 or 3
what is the problem?
does anyone have the translation into spanish of the mod? (you know, i dont have a good english :mrgreen:)

iggorbb

  • Master Knight
  • *
  • ...meh...
    • View Profile
  • Faction: Vaegir
  • MP nick: terorminator
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #8 on: January 24, 2011, 02:14:46 AM »
As much as I understood, you must have leadership minimum 3 and some renown. Do you have that?
Бој не бије свијетло оружје, већ бој бије срце у јунака.

bb_osp

ithilienranger

  • Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: ithilienranger
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #9 on: January 24, 2011, 02:19:37 PM »
Why can't I use the add_visitors_to_sight instead of the spawn agent? I have another mission trigger that uses that with a ti_on_agent_killed_or_wounded interval.

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #10 on: January 24, 2011, 03:21:07 PM »
when i enter a city or town do not appear the bodyguards, I should have 2 or 3
what is the problem?
does anyone have the translation into spanish of the mod? (you know, i dont have a good english :mrgreen:)
You get 1 bodyguard for every 3 points leadership or 400 points of renown. If you meet these criteria, then you've made some mistake in putting the trigger into module_mission_templates.py
As for spanish translation...I don't believe they translate the Module System...though I may be mistaken. And there is no dialog/text that gets edited.

Why can't I use the add_visitors_to_sight instead of the spawn agent? I have another mission trigger that uses that with a ti_on_agent_killed_or_wounded interval.

If you can get it to work, I'd love to see the code...I've been fighting with doing that on and off since about a week before I made this thread.
My problems have been partly chronicled in the Q&A thread, but what it boils down to, mainly, is finding a generic entry point that will work in all town/village/tavern scenes. I've been unable to add visitors to the first 7 entries that the player uses, for instance, I believe because those are marked scene_source rather than visitor_source. Additionally, moving entry points from within the mission seems impossible, so they'll spawn wherever. Beyond that, I haven't found a common entry point in the necessary mission templates and I didn't want to move this to a game_menu code.

Secondary issues would then be that with add_visitors_to_current_scene is that you'd need extra triggers--an on_agent_spawn trigger to assign the new agent to the player's team, make them alert...move them from the entry point to the correct position by the player, etc, and the on_agent_killed trigger to apply casualties to the player party if the companion gets wounded.

But the main problem is getting the entry point BS figured out.



dunde

  • Grandmaster Knight
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #11 on: January 24, 2011, 03:44:33 PM »
Copying the entry that player use, to new one, and then change the flag of the new entry to be visitor_source may help. By using mission entry, we don't need to set the team or set the spawned agent to alarm, as they 're all set by the mission entry's  flags. Overriding the horse and equipment can be done by the flags too.
The only problem is the position. spawn_agent has more freedom to set the spawning position.

ithilienranger

  • Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: ithilienranger
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #12 on: January 24, 2011, 05:27:28 PM »
Wouldn't add_visitors_to_current_scene fix the problem with the face codes getting messed up?

GetAssista

  • Grandmaster Knight
  • *
  • TLD corovan robber
    • View Profile
  • Faction: Neutral
  • M&BWF&S
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #13 on: January 24, 2011, 07:14:55 PM »
but what it boils down to, mainly, is finding a generic entry point that will work in all town/village/tavern scenes.
Why not spawn bodyguards at whatever spawn points that are currently free, depending on the scene, and then teleport them in the vicinity of player at mission start?

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Re: [WB, SP, Code] Bodyguards/Escorts in Town/Village Scenes (Open Source)
« Reply #14 on: January 24, 2011, 07:21:38 PM »
Wouldn't add_visitors_to_current_scene fix the problem with the face codes getting messed up?
Yes, it would, as I indicate in the OP. It also has all of the complications that I haven't been able to work through in a simple fashion, as I indicate in the OP and in the response earlier today.

Why not spawn bodyguards at whatever spawn points that are currently free, depending on the scene, and then teleport them in the vicinity of player at mission start?
That is what I was trying to do last week or so, when I made my most recent inquiries in the Q&A thread, but I haven't had any luck identifying open spawn points from within the mission. Again, I'm trying to keep this confined to the mission template, without any recourse to game_menus and the set-up of the scene. If I'm missing an obvious way to do this, I'd be much obliged to learn it.