Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
You can't have upgrades be disabled and enabled oncertain conditions. You could make the upgrade extremely expensive or requiring absurd amounts of XP, whcih you would lower after the quest. (I'm not certain that the XP thing will work, however, because I've never seen a troop have only one of the two upgrade paths available.) Or, you could make a menu that allows you to convert your Calradian Skirmishers into Calradian Arquebusiers, and that menu could appear only after the given quest is finished.
 
Hi. I've added a new option in the village center, "Hire conscripts" (they lead to a different trooptree than 'vanilla' volunteers). I'd just like to add a condition where the player can only recruit conscripts if he is a lord of the faction controlling that village.

I don't really want to play an incomplete mod until I become a noble but, as you will see, I am a authentic newbie in MS editing. Could anyone confirm that my doing is correct ?

In the vanilla script that check conditions for displaying the 'Hire volunteers' option (cf_village_recruit_volunteers_cond), I read this :

Code:
     (this_or_next|ge, ":center_relation", 5),
     (this_or_next|eq, ":village_faction", "$players_kingdom"),
     (this_or_next|ge, ":village_faction_relation", 0),
     (this_or_next|eq, ":village_faction", "$supported_pretender_old_faction"),
		(eq, "$players_kingdom", 0),

Then I guess I only need to delete I few lines :

Code:
     # We don't care about a conscript's opinion
     (this_or_next|eq, ":village_faction", "$players_kingdom"), # We need to be from that faction
     # Being a friend of the State is not enough
     # Pretender can't use legal conscription
		(eq, "$players_kingdom", 0), # Of course, it can be our own faction

I don't need to do anything else, do I ?
 
Stan233 said:
Could someone point out the script that spawns lords and kings at the start of the game?
script_create_kingdom_hero_party, if I'm getting what you're talking about.

Hartzekar said:
Edit: I found it. Figured out how passages work.
Good work. I was just going to describe it.

Zamensis said:
I don't need to do anything else, do I?
I think not, but I'm not entirely certain.
 
Ok, so my understanding of passages right now is that the menu no. assigned to each passage makes using the passage the same protocol (not sure if that's the right term) as clicking the menu item with the same number. I'm searching through the game_menus.py, and I've found the lines that deal with menus for villages. What I can't figure out how to do is to add a new item that will take the character to another zone. The codes that deal with "Go to the village center" and such don't seem to have a line that takes you to the scene, so I don't know how to add another menu item to take you from say the Reyvadin menu to the village center of a nearby village.

Edit: I have a new item on the menu for the big cities, just have to have that lead to a different scene.
 
Thanks for explaining in detail lumos. I'm studying the tutorials but as you can see their quite dated.
 
Lumos said:
Stan233 said:
Could someone point out the script that spawns lords and kings at the start of the game?
script_create_kingdom_hero_party, if I'm getting what you're talking about.
Doesn't that script create them only (doesn't spawn 'em)? Could there be a trigger for the spawn?
====================================================================================
Абе, тука май само ти отговаряш (от напредналите модъри де) :razz:  Иначе мерси, че си правиш труда да помагаш!
 
Stan233 said:
Lumos said:
Stan233 said:
Could someone point out the script that spawns lords and kings at the start of the game?
script_create_kingdom_hero_party, if I'm getting what you're talking about.
Doesn't that script create them only (doesn't spawn 'em)?
Code:
  # script_create_kingdom_hero_party
  # Input: arg1 = troop_no, arg2 = center_no
  # Output: $pout_party = party_no
  ("create_kingdom_hero_party",
    [
      (store_script_param, ":troop_no", 1),
      (store_script_param, ":center_no", 2),

      (store_troop_faction, ":troop_faction_no", ":troop_no"),

      (assign, "$pout_party", -1),
      (try_begin),
        (eq, "$g_there_is_no_avaliable_centers", 0),
      (set_spawn_radius, 0),
	  (else_try),
        (set_spawn_radius, 15),
      (try_end),
      (spawn_around_party, ":center_no", "pt_kingdom_hero_party"),
The last line of those I included here.
Stan233 said:
Абе, тука май само ти отговаряш (от напредналите модъри де) :razz:
Моята дарба и проклятие...
Не съм само аз. Просто не мога да устоя на изкушението да обяснявам на другите колко грешат. :lol:
Освен това останалите хора тук по принцип имат по-важни работи, с които да се занимават.


Thane Delphi said:
Thanks for explaining in detail lumos. I'm studying the tutorials but as you can see their quite dated.
Forget the tutorials. I've never used a dialogue tutorial in my life, and I've seen it once. You learn better through watching and examining how stuff works.


Hartzekar said:
Ok, so my understanding of passages right now is that the menu no. assigned to each passage makes using the passage the same protocol (not sure if that's the right term) as clicking the menu item with the same number.
It's called a "menu option" or a "submenu" if you wish. And yes, correct, though you didn't mention that the order of the menu options is extremely important, given that they don't really have IDs. A passage leading to zero will lead you where the first menu option would, and so on. (Or so it's supposed to be. I haven't really paid attention to these things yet.)
Hartzekar said:
What I can't figure out how to do is to add a new item that will take the character to another zone.
Add a menu option, but below all others that are used for passages, or you'll screw stuff up.
Oh, villages? I don't think they use passages altogether, so you're probably safe just adding a new option anywhere between the others. If you don't want it visible in the menu, use something like an
Code:
[color=navy](eq, 1, 0),[/color]
in its conditions to prevent it from appearing. It will still be usable from a passage though.
Hartzekar said:
The codes that deal with "Go to the village center" and such don't seem to have a line that takes you to the scene...
BhzHK2t.png
Hartzekar said:
...so I don't know how to add another menu item to take you from say the Reyvadin menu to the village center of a nearby village.
If you want to make a passage that leads you from the Reyvadin scene to the village center, you can't. Or maybe you can, through a ritual to Satan and the god of bad code. Don't do it.
Making a menu option should be straightforward though.
Code:
      ("go_to_random_village", [], "Teleport to a village.", [
		(change_screen_return, 0),
		(leave_encounter), # Just in case?
		(party_relocate_near_party, "p_main_party", "p_random_village", 0),
		(assign, "$g_encountered_party", "p_random_village"),
		(assign, "$current_town", "p_random_village"),
		(start_encounter, "p_random_village"),
        ]),
Note that I've never really left encounters on purpose, so I might be doing it wrong. This should set you on your way though.
 
Thanks a lot Lumos, you're a life saver. My gratitude exceeds the number of lines I've sifted through to find random stuff.

I'm familiar with lists and stuff in Python (I have a bit of proficiency in the language itself). I'll avoid using passages with villages, I wasn't aware that they don't use passages at all. I added an item to the submenu, just have to get it to send me to the right area.

 
Can anyone help me with particle positioning? I have an fire arrow script, which makes a flame particle when the arrow hits, however it sets the feathers of the arrow alight, rather than the front end within the victim. Here is a picture.
xvPl4Jm.jpg
And here is the code.
Code:
["roman_arrows2","Fire Arrows", [("firearrowunlit",0),("firearrow",ixmesh_flying_ammo),("quiver_c", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_front_right, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(30,pierce)|max_ammo(20),imodbits_missile,
[
	    (ti_on_missile_hit,
		[
		    #pos1 - Missile hit position
			#param_1 - Shooter agent
		    (try_begin),
			    (multiplayer_is_server),
				 (store_trigger_param_1, ":shooter"),
				 (particle_system_burst, "psys_torch_fire", pos1, 100),
				 (get_max_players, ":max"),
				 (try_for_range, ":i", 1, ":max"),
				    (player_is_active, ":i"),
					 (player_get_agent_id, ":agent", ":i"),
					 (ge, ":agent", 0),
					 (agent_is_alive, ":agent"),
					 (agent_get_position, pos2, ":agent"),
					 (position_move_z, pos2, 50),
					 (get_distance_between_positions, ":dist", pos1, pos2),
					 (try_begin),
					    (lt, ":dist", 150),
						 (store_agent_hit_points, ":hp", ":agent", 1),
						 (val_sub, ":hp", 10),
						 (val_max, ":hp", 0),
						 (agent_set_hit_points, ":agent", ":hp", 1),
						 (try_begin),
						    (eq, ":hp", 0),
							 (agent_deliver_damage_to_agent, ":shooter", ":agent"),
						 (try_end),
					 (try_end),
				 (try_end),
			 (try_end),
		]),
	]],

I have tried changing the numbers for the pos1 and pos2 and the dist, but it never seems to change, any ideas?
 
Lumos said:
Stan233 said:
Lumos said:
Stan233 said:
Could someone point out the script that spawns lords and kings at the start of the game?
script_create_kingdom_hero_party, if I'm getting what you're talking about.
Doesn't that script create them only (doesn't spawn 'em)?
Code:
  # script_create_kingdom_hero_party
  # Input: arg1 = troop_no, arg2 = center_no
  # Output: $pout_party = party_no
  ("create_kingdom_hero_party",
    [
      (store_script_param, ":troop_no", 1),
      (store_script_param, ":center_no", 2),

      (store_troop_faction, ":troop_faction_no", ":troop_no"),

      (assign, "$pout_party", -1),
      (try_begin),
        (eq, "$g_there_is_no_avaliable_centers", 0),
      (set_spawn_radius, 0),
	  (else_try),
        (set_spawn_radius, 15),
      (try_end),
      (spawn_around_party, ":center_no", "pt_kingdom_hero_party"),
The last line of those I included here.
Thanks for answering, but I got my invasion script working non the less, by:
Lumos said:
watching and examining how stuff works.
:wink:

Lumos said:
Stan233 said:
Абе, тука май само ти отговаряш (от напредналите модъри де) :razz:
<snip>
Не съм само аз. Просто не мога да устоя на изкушението да обяснявам на другите колко грешат. :lol:
<snip>
Изкушението без наслада не е изкушение  :mrgreen: Подразни ги малко преди да им сервираш кода на поднос!  :twisted:
Шегувам се естествено, все пак и аз сигурно ще искам помощ.  :lol:
 
I'm trying to prevent a player from rotating his agent while still allowing him to look around.

So I've looked into the death animations which seem to be the only ones with the acf_lock_camera flag but it doesn't work when you simply set the animation on an agent, the animation plays but the player can still rotate the agent around in 3rd person.

It is probably the same thing that happens in the Battle gametype when it says "Round starts in %d seconds...".
Problem is I can't find any relation to that in the mission template and the string is in \Languages\en\ui.csv so it seems to be something hardcoded (?).

Any clues?
 
shokkueibu said:
I'm trying to prevent a player from rotating his agent while still allowing him to look around.
Have you tried with agent_set_no_dynamics? I think this will still allow the agent to attack though.

Thane Delphi said:
We should get Lumos the custom title Question Cracker
Trust me, other people deserve it more than I do.

Willhelm said:
Can anyone help me with particle positioning? I have an fire arrow script, which makes a flame particle when the arrow hits, however it sets the feathers of the arrow alight, rather than the front end within the victim.
My guess would be that you need something like
Code:
[color=navy](set_position_delta, 0, 15, 0),[/color]
or something like that to move the actual position a bit before bursting your particles.
 
Willhelm said:
Can anyone help me with particle positioning? I have an fire arrow script, which makes a flame particle when the arrow hits, however it sets the feathers of the arrow alight, rather than the front end within the victim. Here is a picture.
xvPl4Jm.jpg
And here is the code.
Code:
["roman_arrows2","Fire Arrows", [("firearrowunlit",0),("firearrow",ixmesh_flying_ammo),("quiver_c", ixmesh_carry)], itp_type_arrows, itcf_carry_quiver_front_right, 0,weight(3)|abundance(160)|weapon_length(95)|thrust_damage(30,pierce)|max_ammo(20),imodbits_missile,
[
	    (ti_on_missile_hit,
		[
		    #pos1 - Missile hit position
			#param_1 - Shooter agent
		    (try_begin),
			    (multiplayer_is_server),
				 (store_trigger_param_1, ":shooter"),
				 (particle_system_burst, "psys_torch_fire", pos1, 100),
				 (get_max_players, ":max"),
				 (try_for_range, ":i", 1, ":max"),
				    (player_is_active, ":i"),
					 (player_get_agent_id, ":agent", ":i"),
					 (ge, ":agent", 0),
					 (agent_is_alive, ":agent"),
					 (agent_get_position, pos2, ":agent"),
					 (position_move_z, pos2, 50),
					 (get_distance_between_positions, ":dist", pos1, pos2),
					 (try_begin),
					    (lt, ":dist", 150),
						 (store_agent_hit_points, ":hp", ":agent", 1),
						 (val_sub, ":hp", 10),
						 (val_max, ":hp", 0),
						 (agent_set_hit_points, ":agent", ":hp", 1),
						 (try_begin),
						    (eq, ":hp", 0),
							 (agent_deliver_damage_to_agent, ":shooter", ":agent"),
						 (try_end),
					 (try_end),
				 (try_end),
			 (try_end),
		]),
	]],

I have tried changing the numbers for the pos1 and pos2 and the dist, but it never seems to change, any ideas?

Did you try changing the position of the mesh instead of the particle burst?
 
Status
Not open for further replies.
Back
Top Bottom