Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
kalarhan said:
markfamily said:
another question is it possible to have a book once read will give a bonus to all companions in your party at the same time like say plus one to strength.

yeap, just use the book read trigger, a loop on companions current in the party and the operation to change atributes

Code:
store_attribute_level                    = 2172  # (store_attribute_level, <destination>, <troop_id>, <attribute_id>),
                                                 # Stores current value of troop attribute. See ca_* constants in header_troops.py for reference.
troop_raise_attribute                    = 1520  # (troop_raise_attribute, <troop_id>, <attribute_id>, <value>),
                                                 # Increases troop attribute by the specified amount. See ca_* constants in header_troops.py for reference. Use negative values to reduce attributes. When used on non-hero troop, will affect all instances of that troop.
Thank you
 
I did this which I know is wrong as I assume it can only handle one troop instead of the group but I cannot find any reference for an entire group
simple trigger
(else_try),
(eq, "$g_player_reading_book", "itm_book_happy_feet"),
    (try_for_range, ":troop_no", companions_begin, companions_end),
    (str_store_troop_name,s4,":troop_no"),   
  (troop_raise_attribute, "troop_no", ca_agility, 3),
        (str_store_string, s2, "@ {s4}'s all companions agility has increased by 3."),
 
markfamily said:
I did this which I know is wrong as I assume it can only handle one troop instead of the group but I cannot find any reference for an entire group
simple trigger
(else_try),
(eq, "$g_player_reading_book", "itm_book_happy_feet"),
    (try_for_range, ":troop_no", companions_begin, companions_end),
    (str_store_troop_name,s4,":troop_no"),   
  (troop_raise_attribute, "troop_no", ca_agility, 3),
        (str_store_string, s2, "@ {s4}'s all companions agility has increased by 3."),

missing the try_end for the loop
missing the ":" on the raise operation
your s4 string makes no sense. If you want to concatenate the list of names like "A, B, C, D" then do something like

Code:
(str_clear, s1)
...
(try_for_range, ...
  (str_store_troop_name,s2,":troop_no"),
  (str_store_string, s1, "@{s2},{s1}"),
  ...
(try_end),

this will get each name on s2 and store it on s1
s1 = empty
s1 = A,
s1 = A, B,
s1 = A, B, C,
...

 
Antonis said:
Hello, sorry to be a bother, but is it possible to check how many enemies a troop(the player) killed or wounded personally? Thank you!
I haven't personally tried it, but
Code:
(get_player_agent_kill_count, <destination>, [get_wounded]),
 # Retrieves the total number of enemies killed by the player. Call with non-zero <get_wounded> parameter to retrieve the total number of knocked down enemies.
 
kalarhan said:
Code:
(str_clear, s1)
...
(try_for_range, ...
  (str_store_troop_name,s2,":troop_no"),
  (str_store_string, s1, "@{s2},{s1}"),
  ...
(try_end),

this will get each name on s2 and store it on s1
s1 = empty
s1 = A,
s1 = A, B,
s1 = A, B, C,
...

Thank you I hope I have done this right
(else_try),
(str_clear, s1),
(eq, "$g_player_reading_book", "itm_book_of_training_1"),
(try_for_range, ":troop_no", companions_begin, companions_end),
  (str_store_troop_name,s2,":troop_no"),
    (troop_raise_attribute, ":troop_no", ca_agility, 3),
  (str_store_string, s1, "@{s2},{s1} After learning new training technique's your companion agility has increased by 3."),
(try_end),
 
SupaNinjaMan said:
I haven't personally tried it, but
Code:
(get_player_agent_kill_count, <destination>, [get_wounded]),
 # Retrieves the total number of enemies killed by the player. Call with non-zero <get_wounded> parameter to retrieve the total number of knocked down enemies.

Thanks, I'll give it a shot!
EDIT: Yup, that was what I was looking for, thanks!
 
Hi all
Any idea where I can find this error please
Belligerent drunk not found
Rough-looking character not found
Entry points for scene 120 : 24 23 22 21 20 19 18 17 16 9 0
Total entry points for scene 120 : 11
DEBUG : Effective relation = 1
DEBUG -- Talk context: 14
DEBUG -- Time since last talk: 6
DEBUG : Effective relation = 1
DEBUG -- Talk context: 14
DEBUG -- Time since last talk: 6
DEBUG -- Prosperity: 64
vdt_regular discard_buffer()
DEBUG -- Prosperity: 64
DEBUG -- Doing political calculations for Orion
Warning: Unmatched else_try.; LINE NO: 17:
Warning: Unmatched try_end; LINE NO: 17:
Warning: Unmatched else_try.; LINE NO: 17:
Warning: Unmatched try_end; LINE NO: 17:
Warning: Unmatched else_try.; LINE NO: 17:
Warning: Unmatched try_end; LINE NO: 17:
At Simple trigger trigger no: 80. DEBUG -- Doing political calculations for Borcha
DEBUG -- Doing political calculations for Marnid
DEBUG -- Doing political calculations for Ymira
DEBUG -- Doing political calculations for Rolf
DEBUG -- Doing political calculations for Baheshtur
DEBUG -- Doing political calculations for Firentis
DEBUG -- Doing political calculations for Deshavi
DEBUG -- Doing political calculations for Matheld
DEBUG -- Doing political calculations for Alayen
DEBUG -- King Harlaus produces a faction strategy for Kingdom of Swadia
No center found to attack
No center found to defend
No center found to defend
Kingdom of Swadia decides: It has been a long time since the lords of the realm gathered for a feast.
DEBUG -- King Yaroglek produces a faction strategy for Kingdom of Vaegirs
No center found to attack
No center found to defend
No center found to defend
DEBUG -- Sanjar Khan produces a faction strategy for Khergit Khanate
No center found to attack
No center found to defend
No center found to defend
Khergit Khanate decides: It has been a long time since the lords of the realm gathered for a feast.
DEBUG -- King Ragnar produces a faction strategy for Kingdom of Nords
Usually the errors are a bit more helpful to find but this one is less so.
 
markfamily said:
Warning: Unmatched else_try.; LINE NO: 17:
Warning: Unmatched try_end; LINE NO: 17:
At Simple trigger trigger no: 80.
It does say the error location tho. The easiest way to find it would be opening simple_triggers.txt of your mod (the compiled one) with Notepad++, look at the line 83 (since first two lines are not actually triggers), and then try to find it in module_simple_triggers.py. Once you find it, count 17 lines from the beginning of the trigger and find out what the problem is.
 
Since I made quite a few custom troops,I want to implement the troop tree of all the factions into the game,so I can balance all those troops more easily.How do I do that?
 
When I give the troop bigger strenght than 30(in this case,31)I get this error : "NameError: name 'str_31' is not defined".What is the deal?
 
Hallo dar,

how to animate a scene-prop from mission_templates?
For example a Ballista, how to make it shift between two states (loaded, empty) of the same vertex animation?

Edit- Easy, too much help! It was simpler than expected, i've never used vertex anims' operations before.
I was putting the right operations in the wrong mission template.
I had another trite question though: what do the _no tags exactly mean? Number?
 
HelrothHyrmir said:
When I give the troop bigger strenght than 30(in this case,31)I get this error : "NameError: name 'str_31' is not defined".What is the deal?

Add after str_30 in header troops
str_31          = bignum | 0x0000001f
str_32          = bignum | 0x00000020
str_33          = bignum | 0x00000021
str_34          = bignum | 0x00000022
str_35          = bignum | 0x00000023
str_36          = bignum | 0x00000024
str_37          = bignum | 0x00000025
str_38          = bignum | 0x00000026
str_39          = bignum | 0x00000027
str_40          = bignum | 0x00000028
str_41          = bignum | 0x00000029
str_42          = bignum | 0x0000002a
str_43          = bignum | 0x0000002b
str_44          = bignum | 0x0000002c
str_45          = bignum | 0x0000002d
str_46          = bignum | 0x0000002e
str_47          = bignum | 0x0000002f
str_48          = bignum | 0x00000030
str_49          = bignum | 0x00000031
str_50          = bignum | 0x00000032
str_51          = bignum | 0x00000033
str_52          = bignum | 0x00000034
str_53          = bignum | 0x00000035
str_54          = bignum | 0x00000036
str_55          = bignum | 0x00000037
str_56          = bignum | 0x00000038
str_57          = bignum | 0x00000039
str_58          = bignum | 0x0000003a
str_59          = bignum | 0x0000003b
str_60          = bignum | 0x0000003c
str_61          = bignum | 0x0000003d
str_62          = bignum | 0x0000003e
str_63          = bignum | 0x0000003f
str_64          = bignum | 0x00000040
str_65          = bignum | 0x00000041
str_66          = bignum | 0x00000042
str_67          = bignum | 0x00000043
str_68          = bignum | 0x00000044
str_69          = bignum | 0x00000045
str_70          = bignum | 0x00000046
 
UndeadDuke said:
markfamily said:
Warning: Unmatched else_try.; LINE NO: 17:
Warning: Unmatched try_end; LINE NO: 17:
At Simple trigger trigger no: 80.
It does say the error location tho. The easiest way to find it would be opening simple_triggers.txt of your mod (the compiled one) with Notepad++, look at the line 83 (since first two lines are not actually triggers), and then try to find it in module_simple_triggers.py. Once you find it, count 17 lines from the beginning of the trigger and find out what the problem is.

Thank you I didn't even register in my head the simple trigger part must get my glasses changed
 
HelrothHyrmir said:
When I give the troop bigger strenght than 30(in this case,31)I get this error : "NameError: name 'str_31' is not defined".What is the deal?

check Lav's modsys for a better reference and documented version of header_XXX.py files.

as a example he has this that creates all the str_XX from str_3 to str_63

Code:
# LAV TWEAKS BEGIN

# Generate constants for attribute levels in [3..64) range.
for index in range(3, 64):
	globals()['str_%d' % index] = bignum | index
	globals()['agi_%d' % index] = bignum | (index << 8)
	globals()['int_%d' % index] = bignum | (index << 16)
	globals()['cha_%d' % index] = bignum | (index << 24)
 
Hi! I am trying to create my own mission in module_templates.

I have experimented with 'Duel with the lord' mission, tweaking it, but I still feel like I am stupid. More or less I understand that ->
Code:
 (11,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,12,[]),
and I think I can use it properly. What I mean is that I more or less can deal with setting individual friends / enemies on scene. But now I need to deal with whole parties, and I feel lost.

I see that other missions have something like that 
Code:
 # (3,mtef_defenders|mtef_team_0,0,aif_start_alarmed,0,[]),
     #(1,mtef_attackers|mtef_team_0,0,aif_start_alarmed,12,[]),

Questions:
1A. When I do use it in my mission, I see my own party (p_main_party) fighting against enemy. How game engine 'knows' what party is related to attackers or to defenders?
1B. How do I set 'source' party to attackers or defenders? Let's say that instead "p_main_party" I want to use "p_quest_tmp_party"? I don't really need to cover wounded/killed friends/enemies, I just need to set up simple fight.

2. Is there any complete tutorial about setting up missions? I read lav's headers and some comments on entry points, but couldn't find anything that would cover exactly 'set-up missions' subject. Does it have any 'official name', that part of modding?


 
Status
Not open for further replies.
Back
Top Bottom