Log in

View Full Version : Trait bug



xerex
02-25-2007, 07:32
Starting with base BI 1.6,
I added to following lines to export_descr_character_traits:


Trait ExperiencedBodyguards
Characters family
NoGoingBackLevel 3

Level Superior_Bodyguards
Description Superior_Bodyguards_desc
EffectsDescription Superior_Bodyguards_effects_desc
Threshold 1

Effect BodyguardValour 2

Level Elite_Bodyguards
Description Elite_Bodyguards_desc
EffectsDescription Elite_Bodyguards_effects_desc
Threshold 2

Effect BodyguardValour 3

Level Royal_Guard
Description Royal_Guard_desc
EffectsDescription Royal_Guard_effects_desc
Threshold 3

Effect BodyguardValour 4

I created a single trigger in random_birth2 in the same file like so:

Trigger random_birth2
WhenToTest CharacterComesOfAge


Affects Anger 1 Chance 2
Affects Hypochondriac 1 Chance 5
Affects GoodSiegeDefender 1 Chance 5
Affects ExperiencedBodyguards 1 Chance 100

I then added these lines to the bottom of the
export_descr_VnVs_enums:

Superior_Bodyguards
Superior_Bodyguards_desc
Superior_Bodyguards_effects_desc
Elite_Bodyguards
Elite_Bodyguards_desc
Elite_Bodyguards_effects_desc
Royal_Guard
Royal_Guard_desc
Royal_Guard_effects_desc

Finally, I added these lines to the bottom of export_VnVs.txt

¬****************************************************************************************
¬****************************************************************************************
¬*
¬***** Changes made after 02/24/2007 18:00:00
¬*
¬****************************************************************************************
¬****************************************************************************************
{Superior_Bodyguards} Superior Bodyguards

{Superior_Bodyguards_desc}
Being a member of the royal family grants this man a group of superior bodyguards to protect him from harm both on and off the battlefield.

{Superior_Bodyguards_effects_desc}
+4 to bodyguard experience level

{Elite_Bodyguards} Superior Bodyguards

{Elite_Bodyguards_desc}
Being the heir to the throne grants this man a group of elite bodyguards to protect him from harm both on and off the battlefield.

{Elite_Bodyguards_effects_desc}
+6 to bodyguard experience level

{Royal_Guard} King's Bodyguards

{Royal_Guard_desc}
The King's bodyguards are the most experienced warriors in the kingdom. The protect their King from harm both on and off the battlefield.

{Royal_Guard_effects_desc}
+8 to bodyguard experience level


Symptoms of wrongdoing are that I crash to desktop when I attempt to look at any general's traits.

If I play enough turns without looking at a general's trait, I see a general get born and his unit card has the appropriate amount of xp on his unit card, but i still CTD if I look at the general's traits. ATV-TW finds no errors and the lordz trait editor read them fine. I am stumped. Any of you experienced modders seen this before?

Atilius
02-25-2007, 08:11
You no longer have to make changes to export_descr_VnVs_enums.txt file when you add traits. It won't cause problems if you do, it's just not necessary.

It's hard to tell: do you have a tab between {Superior_Bodyguards} and Superior Bodyguards? You might have trouble if you don't.

xerex
02-25-2007, 16:41
Yes, I have a tab between the name tags and their text and a carriage return between the description tags and their descriptions.

I edited the file in notepad on a windows machine. Do I need a special editor to stick in the correct characters for the parser?

I will try undoing the changes to the enums file. I doubt it will help, but I am desperate.

:help:

Makanyane
02-25-2007, 17:25
Did you really mean
any general's traits.? or just the ones with the trait you added. If you really meant any then you may have done something nasty to the file format, probably to the file in data/text, notepad should be OK but you can select 'save as' options for file types that don't work.

DVK901
02-25-2007, 18:20
I don't know if this will help or not, but I had issues with EDB.txt where I got CTD's with no errors. I use Notepad in Windows also, and have found that the game is VERY sensitive to what 'hidden characters' are present in text files. So I downloaded 'Cpad v.026a' from here:

http://www.nonags.com/nonags/texted32.html

It's a very nice text editor, and allows you to turn on hidden characters.
I found such a mess in EDB I couldn't believe it, and after checking the hidden characters in the original RTW EDB, and then duplicating them in my file, all of a sudden the CTD was gone.

The thing is, to LOOK at my file beforehand, you could not see why it would do that. It looked perfect in Notepad. I'd recommend use this editor, or at least using it to check critical RTW txt files.

Makanyane
02-25-2007, 19:51
Sorry off topic but possibly interesting,
DVK901, I just downloaded that and it looks useful, one thing I did notice though is it thinks, the campaign_regions_and_settlements_names.txt files in data/text are meant to be hex files!

I've always had problems if I try and make a completely new file for one of those rather than overwriting / adding to old one. Does that give any clue as to why, or do you have any idea why it does that.

p.s. the problems I've had with that file that also uses {} was my reason for suggesting xerex's problems may be related to export_VnVs.txt

Atilius
02-25-2007, 20:57
Most, if not all, of the files in \text use wide characters to support internationalization. Different text editors treat these differently. My editor of choice likes to interpret the second byte of the wide character as a carriage return-line feed, so I only get one character per line.

Makanyane
02-25-2007, 21:14
@Atilius, you're going slightly over my head explaining that one! :embarassed:

Is there an editor / method of dealing with those files that is fool proof to avoid file format / save problems?

Dol Guldur
02-25-2007, 21:48
I've never been able to get new script files to work (mo_money.txt etc) - the other day I took a vanilla script file and deleted the contents and put my own little script in it - it worked! I wonder if that is related to this matter?

But then again it may be that all the scripting tutorials don't really tak einto account working in BI.

Makanyane
02-25-2007, 23:04
@ Dol Guldur, that certainly sounds like same issue of not getting completely new files to work, I did separate one for perfect_spy but i think by then I was used to idea of overwriting vanilla files, rather than starting anew, so would have done it that way automatically. Determining exactly how this works /not would definitely be useful thing to pin down!

Dol Guldur
02-25-2007, 23:20
If it is related to that, I am not too concerned as it only has been a problem with script files and I have always wanted to keep Fourth Age custom-script-free. I, too, added perfect_spy simply for testing purposes.

I hope there is a category in the next mod awards for 'Modder who took the longest to get a script working' as I think I must win :beam:

xerex
02-25-2007, 23:54
Did you really mean ? or just the ones with the trait you added. If you really meant any then you may have done something nasty to the file format, probably to the file in data/text, notepad should be OK but you can select 'save as' options for file types that don't work.

Well, I can't be 100% sure they don't have the trait because I can't see their traits, but the only trigger I made was the coming of age trigger. So characters that are already come of age at the start of the campaign should not have the trait. They do not have the xp on their unit picture either, so I can say with fair certainty that the sarmation faction leader and heir do not have the trait, but when palacus comes of age, he gets the chevrons on his picture and I believe he has the trait, but again, I can't actually look at it.

Yes, I meant any. I played sarmations. I tried look at my faction leaders traits (he shouldn't have it and doesn't have any chevrons) and I did a hard CTD.

Makanyane
02-26-2007, 01:00
that is sounding like you have generally b'd up files, try commenting out all recent changes you made since it last worked (including if necessary removing new traits from desc-strat, if you'e still not working after that you have, I think, unresolved file structure probem.

revert back to vanilla / last working version and re-code traits (its probably not any consolation) but I also had problem in trait file I could never find which meant I had to re-code from vanilla from scratch!.

xerex
02-26-2007, 04:07
haha...I figured it out. Thanx for the help guys. My baby hit the space bar while the file was open and I didn't notice.

You can add a CTD reason to the list. White space at the begining of export_VnVs causes a hard CTD when viewing any character with a trait.
If your file looks like this, your game will CTD

¬ Lines that begin with the ¬ character are comments
¬ and should not be translated
¬ Items with curly brackets are tags and should not be translated
¬ The text following tags either on the same line, or the next line
¬ should be translated

if it looks like this, you are in business

¬ Lines that begin with the ¬ character are comments
¬ and should not be translated
¬ Items with curly brackets are tags and should not be translated
¬ The text following tags either on the same line, or the next line
¬ should be translated

xerex
02-26-2007, 04:13
sorry, the space didnt show up. Pretend underscore is a space. My first line looked like this when it CTDs

_¬ Lines that begin with the ¬ character are comments
¬ and should not be translated


P.S. How do you edit a post?

Atilius
02-26-2007, 06:42
When you become a full member, an edit button will show up under all your posts. Until then you're out of luck.