Modding Q&A [For Quick Questions and Answers]

Users who are viewing this thread

Status
Not open for further replies.
Eogan said:
The UE has a problem.  There's a box for "Spoken by" and one for "Other troop", but the "Other troop" box is disabled, and nothing seems to be able to enable it. :/

in the spoken by box select other troop, and then in the other troop box select the other troop i would imagine.
 
Yoshiboy said:
in the spoken by box select other troop, and then in the other troop box select the other troop i would imagine.
Yeah, that's the way it should work, but selecting 'other' doesn't enable the other troop box.  It just sits there, annoyingly and uneditably greyed out.

Looks like I'm plum out of luck.  I can't edit it in Python, the UE has a bug, and I can't understand the chicken scratch in the conversations.txt file for the life of me.  :sad:  Time to find a work-around, I suppose.
 
Alright, so between the inability to export a mod into python script and the bug in the UE, I'm currently just having one character "pretend" to be another character for that discussion.  I want to say, it looks pretty dumb.  If anyone knows a way I can get "anyone|other(trp_trynn)" directly into the conversations.txt, that would be wonderful; otherwise, I'm just going to live with a stupid "bug" in my mod for ever and ever, amen.

Next question:  is there a script I can use to open up a trade screen with a chest that may or may not be somewhere completely different on the map?  The idea is to have an "inventory wagon" which my quartermaster lugs around that I can trade things out of, but not to be able to trade directly with the quartermaster himself.  I don't want him to put on armour and prance around the field like a tank.

It also allows him to put as much stuff in "inventory" as he wants which doesn't slow down the party in the slightest. :smile:
 
Err, I cant answer that question, but I do think it is impossible to trade/talk with someone on the battlefield.

Now my question: How many polys is a good amount for a scene? Im thinking about the collusem in my mod. I really dont feel like having to delete every face that isnt needed after I am finished, so what would be a decent amount for the average computer? I was thinking upword toward 1500, but I dont know if that would be right.
 
I've had 3-4k poly scenes in Storymod with no problems. Yeah the collision meshes had about that many polys too.

For a thing like a colloseum where the stands are not accessible, you can leave out the collision manifold for the inaccessible parts, and save a bunch on polycount.

During testing, the Storymod scenes started to stagger a bit under a very heavy load of fighters (40+?). So I'd ballpark the max polycount to about 5-10k-ish if you want everyone to have smooth fights with over 30fps.

Of course that was in 0.731 and the engine was souped up considerably in 0.75, so... probably anything below 10k should be ok.
 
Okay I have another question regarding a the "this_or_next|" operation...

I'm wondering if you can create code that is essentially

(if x and y are true then proceed) or
(if a and b are true then proceed) or
(ect ect)

I'm wondering if just even doing this will work

(this_or_next|eq,"$variable_a",1),(eq,"$variable_1",1),
(this_or_next|eq,"$variable_b",1),(eq,"$variable_2",1),
(this_or_next|eq,"$variable_c",1),(eq,"$variable_3",1),
(ect, ect)

In other words I need to be able to generate a conditions block that evaluates two variables for each valid possibility.

Thanks in advance for all assistance
Ahadhran

 
Ahadhran said:
(this_or_next|eq,"$variable_a",1),(eq,"$variable_x",1),
(this_or_next|eq,"$variable_b",1),(eq,"$variable_y",1),
(this_or_next|eq,"$variable_c",1),(eq,"$variable_z",1),

That evaluates to:

if (a or x) and (b or y) and (c or z) then ...

It's a CNF (conjunctive normal form) for those who know mathematical logic: a conjunction of disjunctions.

If you want to express a DNF (disjunctive normal form) like:

if (a and x) or (b and y) or (c and z) then ...

It's easiest to just convert the DNF to a negation of a CNF using De Morgans Law:

if ~( (~a or ~x) and (~b or ~y) and (~c or ~z) ) then ...

So the above is expressible in M&B script as:

(try_begin),
  (this_or_next|neq, "$a",1),(neq, "$x",1),
  (this_or_next|neq, "$b",1),(neq, "$y",1),
  (this_or_next|neq, "$c",1),(neq, "$z",1),
(else_try),
  (do stuff here),
(try_end),

 
Ahadhran said:
Okay I have another question regarding a the "this_or_next|" operation...

I'm wondering if you can create code that is essentially

(if x and y are true then proceed) or
(if a and b are true then proceed) or
(ect ect)

You can, but it's a little bit complicated.


I'm wondering if just even doing this will work

(this_or_next|eq,"$variable_a",1),(eq,"$variable_1",1),
(this_or_next|eq,"$variable_b",1),(eq,"$variable_2",1),
(this_or_next|eq,"$variable_c",1),(eq,"$variable_3",1),
(ect, ect)

This doesn't work for what you have in mind. It will succeed only if at least one condition of each pair is met.


In other words I need to be able to generate a conditions block that evaluates two variables for each valid possibility.

What you're looking for is something like this:

Code:
(try_begin),
(eq,"$variable_a",1),(eq,"$variable_1",1),
(assign,reg(1),1),
(try_end),
(try_begin),
(eq,"$variable_b",1),(eq,"$variable_2",1),
(assign,reg(2),1),
(try_end),
(this_or_next|eq,reg(1),1),(eq,reg(2),1),
<block continues with whatever you want>

Hope that explains everything!

[EDIT] Or you can use fisheye's far simpler and nicer version. I'm no maths genius. I just make the scripts. [/EDIT]

Ponderously,
Winter
 
Winter's version is longer and uses more registers, but is more intuitive... Depending on your familiarity with logical expressions it may not be immediately obvious to you that the negated CNF is in fact equivalent to the DNF you want.
 
wow quick replies, (Yeah I took logic so I see exactly what you're saying). Anyway just a few clarifications:

Fisheye:

Do I need to have your proposed script in a try block or is that not necessary.
I ask because I will be using it as a condition operation for a trigger. If a try block is needed I will probably just use Winters solution but if not then yours is certainly more concise.
 
Uh, well to do that you need a proper CNF rather than the negation of a CNF. So... just apply distributivity repeatedly to the DNF, and you'll end up with a 3-CNF expression with 8 clauses:

(a v b v c) ^ (a v c v y) ^ (b v c v x ) ^ (c v y v x) ^ (a v b v z) ^ (a v y v z) ^ (b v x v z) ^ (x v y v z)

You get a CNF with 2^k clauses with a DNF with k clauses, so... probably better to use the try block.
 
Ok thanks, I will probably use winters example for what I'm doing in triggers right now but the other one is useful also and will probably be put to use in other places
 
FYI this works in a preconditions block:

(try_begin),
  (this_or_next|neq, "$a",1),(neq, "$x",1),
  (this_or_next|neq, "$b",1),(neq, "$y",1),
  (this_or_next|neq, "$c",1),(neq, "$z",1),
  (assign, reg(1), 0),
(else_try),
  (assign, reg(1),1),
(try_end),
(eq, reg(1),1),

Benefit being that you only use up one register instead of k.
 
Thanks Fisheye
Since I have been posting so many questions on this I will show what the trigger ended up looking like, I would appreciate suggestions comments in this regard since I'm a real newb at all this.

(1.0, 0, 12.0, [(try_begin), #checks to see if character has achieved enough influence for a charisma gain
                  (eq,"$quest_accepted_zendar_dead",1),
                  (ge,"$defenders_influence","$defenders_rank"),
                  (assign,reg(1),1),
                  (try_end),
                  (try_begin),
                  (eq,"$player_relation_to_swadians",rel_ally),
                  (ge,"$swadian_influence","$swadians_rank"),
                  (assign,reg(2),1),
                  (try_end),
                  (try_begin),
                  (eq,"$joined_undead",1),
                  (ge,"$fallen_influence","$fallen_rank"),
                  (assign,reg(3),1),
                  (try_end),
                  (try_begin),
                  (eq,"$player_relation_to_vaegirs",rel_ally),
                  (ge,"$vaegir_influence","$vaegir_rank"),
                  (assign,reg(4),1),
                  (try_end),

                  (this_or_next|eq,reg(1),1),
                  (this_or_next|eq,reg(2),1),
                  (this_or_next|eq,reg(3),1),
                  (eq,reg(4),1)],
 
              #checks which faction the influence has been gained in
              #Assigns difficulty till next level of charsima gain and gives charisma
                [(try_begin),
                    (ge,"$defenders_influence","$defenders_rank"),
                    (val_mul,"$defenders_rank","$defenders_rank_multiplier"),
                    (val_add,"$defenders_rank_multiplier",1),
                    (troop_raise_attribute,"trp_player",3,1),
                    (tutorial_box,"str_gained_defenders_influence"),
                (else_try),
                    (ge,"$swadian_influence","$swadians_rank"),
                    (val_mul,"$swadians_rank","$swadians_rank_multiplier"),
                    (val_add,"$swadians_rank_multiplier",1),
                    (troop_raise_attribute,"trp_player",3,1),
                    (tutorial_box,"str_gained_knightly_influence"),
                (else_try),
                    (ge,"$fallen_influence","$fallen_rank"),
                    (val_mul,"$fallen_rank","$fallen_rank_multiplier"),
                    (val_add,"$fallen_rank_multiplier",1),
                    (troop_raise_attribute,"trp_player",3,1),
                    (tutorial_box,"str_gained_fallen_influence"),
                (else_try),
                    (ge,"$vaegir_influence","$vaegir_rank"),
                    (val_mul,"$vaegir_rank","$vaegir_rank_multiplier"),
                    (val_add,"$vaegir_rank_multiplier",1),
                    (troop_raise_attribute,"trp_player",3,1),
                    (tutorial_box,"str_gained_knightly_influence"),
                (end_try),
                (assign,"$influence_gained",0)]),
 
Looks good...

1. You forgot to clear your registers in the preconditions block.

(assign, reg(1), 0), ...

2. What happens when you quit a faction and join another? You keep the charisma bonuses of the old faction?
 
I was under the impression that the registers zeroed themselves as soon as all operations were done (such that they only have non zero numbers when a trigger has assigned them as such, I will fix that now)

As to the charisma yes you do keep the bonus...(this is because A. it measures how well known you are either good or bad and B. because I don't know how to lower a characters abilities which is why I came up with the justification of A. :lol:)

which brings me to a question completely different question, How in fact do you lower a characters stats?
 
Alternatively you could keep a global variable that tracks your highest rank gained in any faction, and skips the bonus-giving script if your current rank is lower than that. This makes more sense than taking away charisma, I think.
 
Status
Not open for further replies.
Back
Top Bottom