Author Topic: [WB, SP, Code] Village Raids & Sieges--Allow Player Party Actions (Open Source)  (Read 14952 times)

0 Members and 1 Guest are viewing this topic.

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Village Raids
The inability for the player to flee from an encroaching enemy while raiding a village has been a frequently voiced "beef" throughout the forum. Not having seen anyone look into this, I thought I'd do so and post what I worked out.

For whatever they are worth, the following minor bits of code/tweaks allow the player's party to behave akin to an NPC lord's party during a village raid: they can move within a certain radius of the village with the raid continuing and if they move beyond this radius, the raid is terminated. At half the limit distance, a menu appears, asking if the player wants to continue the raid, serving as a warning.

Since some Native code needs to be tweaked, I've marked the edited Native code with three comment hashes ###

I've included notes to indicate lines that could be commented out to force the player to hold Spacebar or CTRL+Spacebar for time to pass...this would also give them more fine tuned control for reacting to an enemy party. I've marked these lines ###OPTIONAL COMMENT OUT

(click to show/hide)
(click to show/hide)

« Last Edit: December 16, 2010, 04:11:26 AM by Caba`drin »



Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Sieges
The inability for the player to access their inventory or party window during a siege has been a frequently voiced "beef" throughout the forum. Not having seen anyone look into this, I thought I'd do so and post what I worked out.

For whatever they are worth, the following minor bits of code/tweaks allow the player to have some added flexibility when besieging a town or castle: they player can exit from the auto-rest and access whichever menus they choose, without canceling the siege. Further, they can move within a certain radius of the besieged center with the siege continuing and if they move beyond this radius, the siege is terminated. At half the limited distance, a message scrolls on screen, notifying the player that their siege lines are stretched too thin and serving as a warning.

Since some Native code needs to be tweaked, I've marked the edited Native code with three comment hashes ###

(click to show/hide)



Idibil

  • External Developer
  • *
    • View Profile
    • Nova Regula
  • Faction: Nord
  • MP nick: CeltíberoIdibil
Good work, Caba'Drin.

edbzoso

  • Regular
  • *
    • View Profile
Sorry, I'm new at this.  I want to use the spacebar to make time pass, but I"m not quite sure what to change to implement that.  I have changed the text as described in the first spoiler, but I don't know how to modify it for the spacebar time pass.  I also don't understand what to do with the second spoiler info.

FrisianDude

  • Coitus non Awesome
  • Archduke
  • *
  • Zis is Tshörman tärritorie!
    • View Profile
  • Faction: Neutral
  • MP nick: Liudulf Ward/Léodwulf
  • M&BWB
.. holy... how can I not have seen this yet? This is rather interesting. If I'm reading this(the second this) allows the player to access the party screen while waiting after declaring a siege and before actually fighting it? Very nice, very nice. Baffling that I'd not seen it. :(

@Ed; I'm sorry but I'm not able to answer you. :P
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. Play Vikingr!

Sayd Ûthman

  • Language Moderator
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Sayd_uthman
  • WB
Excellent !!

edbzoso

  • Regular
  • *
    • View Profile
OK I finally realised I was looking in the wrong file for the second spoiler for the raid tweak so I figured that out, but I'm still not sure how to change it to time lapse with the space bar.  The ### lines say "CHANGE rest_for_hours to rest_for_hours_interactive", but the text already reads "rest_for_hours_interactive".

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Excellent !!
.. holy... how can I not have seen this yet? This is rather interesting. If I'm reading this(the second this) allows the player to access the party screen while waiting after declaring a siege and before actually fighting it? Very nice, very nice. Baffling that I'd not seen it. :(
Nice to have folks see this, might see some more use now. So thanks for the question edbzoso, heh!

As for Frisian, yes you are reading it correctly. You need to click to stop the auto-rest that happens when you start a siege, but then you should be able to do whatever you'd like. If you get too far away, the siege auto-cancels, but you are warned. Only caveat is once you've stopped the auto-rest, you need to hold down spacebar or ctrl-spacebar yourself. (I didn't bother to code a button/option to start the automatic rest up again as it didn't seem particularly necessary.)

OK I finally realised I was looking in the wrong file for the second spoiler for the raid tweak so I figured that out, but I'm still not sure how to change it to time lapse with the space bar.  The ### lines say "CHANGE rest_for_hours to rest_for_hours_interactive", but the text already reads "rest_for_hours_interactive".
In the Native module system, module_simple_triggers it does not include the _interactive part, so above notes both how it should look at the change made. Once you locate that line in simple_triggers you either can include _interactive OR place a hash mark (#) at the front of the line. The hash mark will comment the line out, so it isn't used, which will force you to use spacebar to pass time while raiding. (The same goes for the module_game_menus changed. Either add "_interactive" or add a hash to the beginning of those lines.)



Loner

  • Regular
  • *
    • View Profile
  • Faction: Neutral
Can you tell me if those are also part of PBOD ?

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
Can you tell me if those are also part of PBOD ?
At present, no they are not.



deagon

  • Veteran
  • *
  • Old-school
    • Skype - Phoenix10th
    • View Profile
  • Faction: Neutral
  • MP nick: DeagonLT
  • WBNWM&BWF&S
I'm having troubles installing this or placing this into the game..
Is it the simple_trigger.txt I gotta modify?
Or what is?
I'm very confused..

Caba`drin

  • Dovie'andi se tovya sagain
  • Forum Legend
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • WBM&BWF&SNWVC
I'm having troubles installing this or placing this into the game..
Is it the simple_trigger.txt I gotta modify?
Or what is?
I'm very confused..
You'll need to download the source code, or the "module system" and edit those files. Then you'll compile new .txt files. There are tutorials and the module system download in the main Forge board and the 'Unofficial Tutorials' sub-board for getting this setup.



melchar

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Hi, I could use some help pls.  :) I play a mod, let's say Native Expansion, and I'd like to implement your edited village raiding script. So I removed that (else-try) block from the native module system, added the second script right after, and compiled it. Then I took new rows corresponding with those scripts from simple_triggers.txt (one starting with 1.000000, the other with 0.250000) and placed it into NE's simple_triggers.txt (replacing the first one, adding the second one). I also added "breaking_off_raid" string to NE's quick_string.txt... So, that should do it, shouldn't it? Am I missing something important or doing something terribly wrong?

Edit: I assume those "rest_for_hours" to "rest_for_hours_interactive" changes don't affect the basic idea, which is the ability to break off raid..
« Last Edit: October 22, 2012, 09:56:36 AM by melchar »

dunde

  • Count
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Hi, I could use some help pls.  :) I play a mod, let's say Native Expansion, and I'd like to implement your edited village raiding script. So I removed that (else-try) block from the native module system, added the second script right after, and compiled it. Then I took new rows corresponding with those scripts from simple_triggers.txt (one starting with 1.000000, the other with 0.250000) and placed it into NE's simple_triggers.txt (replacing the first one, adding the second one). I also added "breaking_off_raid" string to NE's quick_string.txt... So, that should do it, shouldn't it? Am I missing something important or doing something terribly wrong?

Edit: I assume those "rest_for_hours" to "rest_for_hours_interactive" changes don't affect the basic idea, which is the ability to break off raid..

Well, the address of global variables used by NE may be not the same as at the native Module System. That can make your copied simple trigger mess your game.

melchar

  • Recruit
  • *
    • View Profile
  • Faction: Neutral
Hi, I could use some help pls.  :) I play a mod, let's say Native Expansion, and I'd like to implement your edited village raiding script. So I removed that (else-try) block from the native module system, added the second script right after, and compiled it. Then I took new rows corresponding with those scripts from simple_triggers.txt (one starting with 1.000000, the other with 0.250000) and placed it into NE's simple_triggers.txt (replacing the first one, adding the second one). I also added "breaking_off_raid" string to NE's quick_string.txt... So, that should do it, shouldn't it? Am I missing something important or doing something terribly wrong?

Edit: I assume those "rest_for_hours" to "rest_for_hours_interactive" changes don't affect the basic idea, which is the ability to break off raid..

Well, the address of global variables used by NE may be not the same as at the native Module System. That can make your copied simple trigger mess your game.

Hm, I've just tried to replace the original Native files with newly compiled ones, but the raids remain unchanged in my native game, too. Do I have to start new game or something?