User Info
Welcome, Guest. Please login or register.
Did you miss your activation email?
September 02, 2010, 08:24:49 PM

Login with username, password and session length
Search:     Advanced search
News Box
New M&B Version

1.010 is out, and so is the module system. Get modding!

Key Stats
51617 Posts in 2003 Topics by 4425 Members
Latest Member: lovely13
Home Help Search Login Register
M&B Mod Community  |  About Modding  |  Modding Knowledge Base (Moderator: Fisheye)  |  Common Errors and How to Fix Them
Pages: [1] 2  All Print
Author Topic: Common Errors and How to Fix Them  (Read 7109 times)
Yoshiboy
Administrator
*****
Offline Offline

Posts: 353


- Everything is a metaphor -


View Profile WWW Email
« on: January 14, 2007, 01:58:01 PM »

If you have an error that is not listed here then please post it and hopefully we can work out a solution.

Compiling errors


Error:
SyntaxError: invalid syntax
Meaning:
Missing a bracket, comma or quotation mark -- [], (), , or "" -- OR you have too many of them.

Error:
SyntaxError: tuple object is not callable
Meaning:
Missing a comma just before an open bracket (

Error:
TypeError: list indices must be integers
Meaning:
Missing a comma/too many brackets.

Error:
ERROR: INPUT TOKEN NOT FOUND: <name>
NameError: global name 'cause_error' is not defined
Meaning:
You have a starting dialog-state -- example, [trp_constable_hareck,"constable_hareck_introduce_1", -- that isn't being led to by an ending dialog-state -- example, "close_window",[]],

Error:
ERROR: INPUT TOKEN NOT FOUND: <empty>
NameError: global name 'cause_error' is not defined
Meaning:
You have an empty starting dialog-state -- example, [trp_constable_hareck,"constable_hareck_introduce_1",

Error:
NameError: name '<something>' is not defined
Meaning:
Missing a prefix such as trp_, itm_ or mnu_ OR missing a name OR misspelled a name.

Error:
IndexError: tuple index out of range
Meaning:
Nebulous. If you're modding module_mission_templates.py, look for undefined alter flags and undefined AI flags, these are the most common source.

Error:
TypeError: int argument required
Meaning:
Missing an integer such as a mission-template flag. You can find out which calls are integers by looking at Armagan's documentation at the beginning of each module file, (int) calls being integers.

Error:
IndexError: list index out of range
Meaning:
There's an error in one of your list calls -- a list is anything between brackets.

Error:
Error: Unable to find object:<name>
ERROR: Illegal Identifier:<name>
Meaning:
The object you're trying to call does not yet exist OR there is a misspelling in the name.
It could also be that you've forgot to put a $ or : on the variable.

Other errors

Error:
Unable to open file Textures\texture_name_here.dds_0.dds
Meaning:
This is due to the texture tags in the new version (.8xx). You need to remake all your texture references.

Error:
"Unable to find module music file"
Meaning:
You are missing music.txt your mod folder. Copy the file from native.

Error:
map_scene->manifold->faces[target_manifold_index].tag != rt_water (or rt_mountain)
Meaning:
You have a party on the world map that is trying to spawn on water or mountain terrain. Check all your spawn points and spawn radius'

Error:
Get Object failed for *
Meaning:
Any get object failed error is where in one of your BRFs or items/scenes/scene props in game, you are referencing a texture, material or mesh that does not exist. Check the spelling and that everything is referenced properly. Check your BRFs are loading in the right order. And remember capital letters count!

Error:
Buffer.has_more_tokens()
Meaning:
The message means there is a mismatch between the expected and actual size of a data structure.
Could be a malformed BRF, or a corrupted .txt file, or a savegame incompatibility.
It might also be caused by reading past the end of a data structure. E.g. you only have 25 strings and you ask for string #57.
It can also be when you use a space instead of a _ in identifier names.
This one is hard and be all kinds of things.

Error:
rgl_between(skill_level,0,(skills[skill_no].max.level+1))
Meaning:
This assert is checked when the game reads your skills. It verifies that the number read was not more than 10. It doesn't give a damn what your dependent attribute is (Int, Str, Dex, Cha).
Why would this happens when you have well-behaved troops with skills <= 10?
Typically, it means you're either reading a skill from a nonexistent troop or reading a nonexistent skill, or both.
This one can sneak up on you when you're making troops, if you use knows_common it can make troops with more than 10 ranks in a given skill.
knows_common=knows_riding_1|knows_trade_2|knows_inventory_management_2|knows_prisoner_management_1|knows_leadership_1
E.g. knows_common|knows_trade_9


Error:
rgl_between(current_sentence, 0, num_sentences)
Meaning:
Caused when talking to someone who has nothing to say.
« Last Edit: May 19, 2007, 12:15:19 PM by Fisheye » Logged

Yoshiboy :)

My website
Fisheye
Blues Brother
Moderator
*****
Offline Offline

Posts: 428


My scalp's so bright, I gotta wear shades.


View Profile Email
« Reply #1 on: January 14, 2007, 02:56:37 PM »

rgl_between(skill_level,0,(skills[skill_no].max.level+1))

This one can sneak up on you when you're making troops, if you use knows_common it can make troops with more than 10 ranks in a given skill.

knows_common=knows_riding_1|knows_trade_2|knows_inventory_management_2|knows_prisoner_management_1|knows_leadership_1

E.g. knows_common|knows_trade_9

Results in a troop with 11 ranks in trade.

Hellequin:
Well, turns out there's another cause.  Calling (store_skill_level) on a skill that doesn't exist.  Particularly pernicious because (store_skill_level) has its arguments inverted compared to the rest of its class.
« Last Edit: February 21, 2007, 05:43:42 PM by Fisheye » Logged
Yoshiboy
Administrator
*****
Offline Offline

Posts: 353


- Everything is a metaphor -


View Profile WWW Email
« Reply #2 on: January 14, 2007, 02:58:20 PM »

Cheers.
Logged

Yoshiboy :)

My website
Raz
Deus Vult Dev
*****
Offline Offline

Posts: 212



View Profile Email
« Reply #3 on: January 14, 2007, 03:35:16 PM »

Quote
Error:
Error: Unable to find object:<name>
ERROR: Illegal Identifier:<name>
Meaning:
The object you're trying to call does not yet exist OR there is a misspelling in the name.
Maybe you could mention that you may have missed a $ or : if you were trying to call on a variable.
Someone not familiar with it variables may overlook that.
Logged
Yoshiboy
Administrator
*****
Offline Offline

Posts: 353


- Everything is a metaphor -


View Profile WWW Email
« Reply #4 on: January 14, 2007, 04:48:33 PM »

Quote
Error:
Error: Unable to find object:<name>
ERROR: Illegal Identifier:<name>
Meaning:
The object you're trying to call does not yet exist OR there is a misspelling in the name.
Maybe you could mention that you may have missed a $ or : if you were trying to call on a variable.
Someone not familiar with it variables may overlook that.

Hmm, maybe. As far as i was aware it gives a seperate error when a $ or : is missed sometimes.

Edit: actually thats probably only on assignment statements.
Logged

Yoshiboy :)

My website
Yoshiboy
Administrator
*****
Offline Offline

Posts: 353


- Everything is a metaphor -


View Profile WWW Email
« Reply #5 on: January 18, 2007, 11:43:41 AM »

Not a clue, I think it should be working.
Logged

Yoshiboy :)

My website
Fisheye
Blues Brother
Moderator
*****
Offline Offline

Posts: 428


My scalp's so bright, I gotta wear shades.


View Profile Email
« Reply #6 on: January 19, 2007, 01:50:31 PM »

rgl_between(current_sentence, 0, num_sentences)

Caused when talking to someone who has nothing to say.

I encountered this when starting an encounter which didn't jump to a menu, i.e. I just modified the top trigger in simple_triggers to do some scripty stuff without jumping to a menu.

Apparently it wasn't enough since it (likely) fired up mnu_simple_encounter to start a conversation with myself where I had nothing to say.

Changing the code to jump to a game menu (which immediately did change_screen_return) fixed the problem.
Logged
fujiwara
Master
*****
Offline Offline

Posts: 859


View Profile Email
« Reply #7 on: January 22, 2007, 11:09:08 PM »

Don't forget the ever popular 'TypeError: 'tuple' object is not callable' and 'TypeError: 'int' object is not callable', both a result of missing commas.
Logged


The horses tend to get their legs caught in the catapult rather than being properly launched.
Winter
I am Tek Jansen!
Administrator
*****
Offline Offline

Posts: 448


MBX Forum owner


View Profile WWW Email
« Reply #8 on: January 23, 2007, 04:41:22 AM »

Okay everyone, this is the Common Errors thread, not the FAQ or Q&A thread. It is meant for solutions, not questions. I'm moving your posts; please keep future ones on topic.

Rapaciously,
Winter
Logged


STREET: Losing your mind has never been so much fun . . .
Raz
Deus Vult Dev
*****
Offline Offline

Posts: 212



View Profile Email
« Reply #9 on: January 23, 2007, 06:01:55 AM »

Sure, thought the Q&A wasn't there when I posted this. Sorry.
Logged
Cirdan
Craftsman
**
Offline Offline

Posts: 100


View Profile Email
« Reply #10 on: February 14, 2007, 08:55:48 AM »

Another result of missing commas, which has caused me to waste hours debugging scripts: if you forget to place a comma after the script's name, you will get a "Type Error: string indices must be integers" pointing you to the script's last line. This is is extremely misleading because the natural reaction is to search everywhere except where the error actually is, for me at least.
Logged
Fisheye
Blues Brother
Moderator
*****
Offline Offline

Posts: 428


My scalp's so bright, I gotta wear shades.


View Profile Email
« Reply #11 on: February 21, 2007, 04:51:07 PM »

Unexpected End of File while reading file: (null)

Check your code for single quotes ' appearing right after double quotes, e.g.

"'blah', blahblah."
Logged
Fisheye
Blues Brother
Moderator
*****
Offline Offline

Posts: 428


My scalp's so bright, I gotta wear shades.


View Profile Email
« Reply #12 on: February 21, 2007, 04:53:46 PM »

map_scene->manifold->faces[target_manifold_index].tag != rt_mountain

You have a spawn point on an impassable terrain like mountain or ocean.
Logged
Hellequin
Journeyman
***
Offline Offline

Posts: 254


View Profile Email
« Reply #13 on: February 21, 2007, 05:26:11 PM »

Here's a nasty one that bit me today:

rgl_between(skill_level,0,(skills[skill_no].max.level+1))

...look familiar?  (Upthread, Fisheye's first post).  Well, turns out there's another cause.  Calling (store_skill_level) on a skill that doesn't exist.  Particularly pernicious because (store_skill_level) has its arguments inverted compared to the rest of its class.
Logged
kerosima
Apprentice
*
Offline Offline

Posts: 5


View Profile Email
« Reply #14 on: February 28, 2007, 02:22:27 PM »

I modified mission_templates.py and I see "float aargument required" error...
I can write details if you want
Logged
Pages: [1] 2  All Print 
Jump to:  

Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Arcane Magic based on BlackDay by TechnoDragon.net | Buttons by Andrea