Blocking the way

Users who are viewing this thread

Lope de Rojas

Grandmaster Knight
Is possible to block a way in the general map depending on the owner of the nearest castle?

I mean, imagine a pass between mountains controlled by the defenders of the Castle of Pontecorvo, if you want to pass, you would need to be:
  • a) Neutral, (pay a toll).
    b) Same faction as the Castle of Pontecorvo.
    c) Allied (or just not to be at war with the owners of the Castle -paying a toll-).

Is it possible? And if so, how can we do that?
 
I don't know if it's possible to physically block movement... maybe using an impassable terrain type for the pass, and making it passable via a menu/dialogue? Which gives me an idea for a probably easier and more fun solution. Have a party or more spawn at the pass and guard (wait) near the castle/outpost. So if you're friendly or the castle/outpost belongs to you they'll let you through without bothering you. If you're neutral make it act like deserter parties where they stop you and ask for a toll before you can proceed. If they're hostile they'll chase you if you get too close to them, and if you manage to defeat them you gain temporary access (until the guard party respawns). There was a thread somewhere about putting castles/outposts that might be relevant to what you want to do: http://forums.taleworlds.com/index.php/topic,73204.0.html

and also Arch3r's bridge battle code if you want a battle to take place in a custom scene when fighting near a pass/bridge: http://forums.taleworlds.com/index.php/topic,68264.0.html
 
Thanks Amade,

So the main problem would be to change the faction of that patrol. The Arch3r's bridge battle code would be interesting to add... if we could make that the defender party would start in a higher position (I haven't seen the scenes nor the code).
 
I know a pretty simply way.. I assume you have the ModuleSystem. What we need is two extra parties, both hidden by pf_disabled flag. I'm assuming that the castle is at the "beginning of the bottle-neck". What we'll do is use a trigger to check that is the player near one of the hidden parties or not. If it is, teleport the player to the second hidden party and pop up a conversation scene saying that you won't be able to pass the castle.

The first hidden party will be placed more "in-wards" to the bottle-neck, while the second one will be placed a bit outwards, near the castle. Here's the code:
Code:
#module_triggers.py
    (1, 0, 0, [(map_free, 0)],
	[
		(party_get_position, pos1, "p_main_party"),
		(party_get_position, pos2, "p_hidden_party_1"),
		(party_get_position, pos3, "p_hidden_party_2"),
		(get_distance_between_positions, ":distance", pos1, pos2),
		(try_begin),
		    (lt, ":distance", 25), #Adjust this for better results.
			 (party_set_position, "p_main_party", pos3),
			 (assign, "$talk_about_castle", 1),
			 (start_map_conversation, "trp_player"),
		(try_end),
	]),

First we check if the player is on the map. Then we get the position of the player's party and the hidden parties. Afterwards, we get the distance between the player party and the hidden party, which will be in the bottle-neck. If the distance is lower than 25, we teleport the player to the second hidden party, assign $talk_about_castle which we will use in the dialog to 1 and start the conversation with yourself.

If you don't know how to create a conversation, here's a example:
Code:
#module_dialogs.py
    [trp_player|plyr, "talk_about_castle", [(eq, "$talk_about_castle", 1)],
	 "Hmm.. It seems that I won't be able to pass through this mountain\
 	 without talking to the guys at the castle first.", "close_window", [(assign, "$talk_about_castle", 0)]],

Then make a new entry in the town menus and make the entry only show up on the certain castle, using (eq, "$current_town", "p_your_castle"),.
 
Back
Top Bottom