Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: HLD_Prophecy on October 26, 2015, 02:12:57 pm

Title: Missing Required Token: Bitmap
Post by: HLD_Prophecy on October 26, 2015, 02:12:57 pm
So I just added a few new weapons to my mod. All are actually based on stock FS2 weapons (The Tempest, the Rebel Bomb, the Cyclops, and the Fusion Mortar).

Upon trying to run FRED, I'm getting several nearly identical errors. They pertain to the weapon based on the Tempest all I changed was the rate of fire by altering the reload time). The first is this:

Code: [Select]
lnd-wep.tbm(line 280):
Error: Missing required token: [+Bitmap:]. Found [;; Trail cannot be set if Exhaust is set] instead.

ntdll.dll! ZwWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fred2_open_3_7_2_NO-SSE.exe! <no symbol>
fred2_open_3_7_2_NO-SSE.exe! <no symbol>

This same "Missing required token" error is repeated for lines 281, 283, and 286 (twice for 286). Howver, the Bitmap token is present in the table (as it would have to be to run in regular FS2). Can someone please help me out?

Thanks!
Title: Re: Missing Required Token: Bitmap
Post by: General Battuta on October 26, 2015, 02:24:12 pm
Post the table entry, this is usually caused by a misplaced entry or a bad character.

Did you use a non-ANSI text editor (like WordPad) to alter the table?
Title: Re: Missing Required Token: Bitmap
Post by: AdmiralRalwood on October 26, 2015, 05:37:33 pm
If the "found" part of those errors start with semicolons, it's almost always because you have an unclosed quotation mark somewhere before the line it's complaining about.
Title: Re: Missing Required Token: Bitmap
Post by: Dragon on October 26, 2015, 07:17:52 pm
Yeah, that looks like a typo in the table. Inspect the entry thoroughly.
Title: Re: Missing Required Token: Bitmap
Post by: headdie on October 27, 2015, 02:45:41 am
[;; Trail cannot be set if Exhaust is set] starts with a double semicolon so why is the code reading it?
Title: Re: Missing Required Token: Bitmap
Post by: AdmiralRalwood on October 27, 2015, 02:54:13 am
[;; Trail cannot be set if Exhaust is set] starts with a double semicolon so why is the code reading it?
Short answer:
because you have an unclosed quotation mark somewhere before the line it's complaining about.

Long answer:
FSO's comment-handling code was overhauled, like, a year or so ago so that it ignored semicolons inside of quoted strings. However, other parts of the parsing code don't actually care about whether or not quotation marks are balanced. As a result, an unclosed quotation mark followed by a comment will (usually) result in a parsing error as the comment isn't removed and FSO tries to match the next token it's looking for to something that will not match any token. There's been some talk of overhauling the parsing code itself so that problems like this will lead to error messages that reflect what the actual problem is (e.g. "unclosed quotation mark on line #X"), but this would require rewriting code used all over the codebase and would be a lot of effort, so nobody's done it yet (AFAIK nobody's even started). Until somebody does, you'll get this somewhat odd behavior.
Title: Re: Missing Required Token: Bitmap
Post by: headdie on October 27, 2015, 03:23:17 am
ahhh, thanks
Title: Re: Missing Required Token: Bitmap
Post by: General Battuta on October 27, 2015, 09:11:12 am
If you use a program with smart quotes, like TextEdit, that will **** up your tables.
Title: Re: Missing Required Token: Bitmap
Post by: HLD_Prophecy on October 28, 2015, 08:15:54 am
Thanks all for responding. :)

Here's the culprit entry:

Code: [Select]
$Name:                                  Strafing Tempest
+Title:                                 XSTR("Strafing Tempest", 3317)
+Description:
XSTR(
"Standard Issue
High-Payload Dumbfire", 3318)
$end_multi_text
+Tech Title:    XSTR("Tempest", 3319)
+Tech Anim:    Tech_GTM_MX-6_Tempest
+Tech Description:
XSTR(
"A modified Tempest missile. Fires fast, respectable anti-cruiser type weapon. Used for enemy strikecraft when bombs would be too heavy.", 3320)
$end_multi_text
$Model File: Tempest.pof
$Mass: 0.1
$Velocity: 360.0
$Fire Wait: 0.30
$Damage: 45                                        ;; damage applied when within inner radius
$Blast Force: 0.2
$Inner Radius: 10.0 ;; radius at which damage is full (0 for impact only)
$Outer Radius: 20.0 ;; max radius for attenuated damage (0 for impact only)
$Shockwave Speed: 0                                         ;; velocity of shockwave.  0 for none.
$Armor Factor: 0.9
$Shield Factor: 0.5
$Subsystem Factor: 0.6
$Lifetime: 1.8
$Energy Consumed: 0.0 ;; Energy used when fired
$Cargo Size: 0.25 ;; Amount of space taken up in weapon cargo
$Homing: NO
$LaunchSnd: 90                                        ;; The sound it makes when fired
$ImpactSnd: 88                                        ;; The sound it makes when it hits something
$FlyBySnd: -1
$Rearm Rate: 12.0 ;; number of missiles/sec that are rearmed
$Flags: ("in tech database" "player allowed" huge")                 
$Trail: ;; Trail cannot be set if Exhaust is set
+Start Width: 0.1                                       ;; Width of trail nearest missile
+End Width: 0.2                                       ;; Width of trail before it "evaporates"
+Start Alpha: 1.0
+End Alpha: 0.0
+Max Life: 0.3                                       ;; how many seconds before trail disappears
+Bitmap: newmiss2 ;; Bitmap used to draw trail
$Icon: iconTempest
$Anim: Tempest
$Impact Explosion: ExpMissileHit1
$Impact Explosion Radius: 3.0

Can you guys help me figure out the error? I can't seem to find the problem here...

BTW, I am using Notepad++. It's the way to go.  :yes: Who uses WordPad? :P
Title: Re: Missing Required Token: Bitmap
Post by: Axem on October 28, 2015, 08:27:42 am
Code: [Select]
$Flags:         ("in tech database" "player allowed" huge")
Code: [Select]
huge")
Someone's missing an " :)
Title: Re: Missing Required Token: Bitmap
Post by: General Battuta on October 28, 2015, 08:28:59 am
$Flags:         ("in tech database" "player allowed" huge")                 
Title: Re: Missing Required Token: Bitmap
Post by: HLD_Prophecy on November 02, 2015, 08:35:02 pm
Code: [Select]
$Flags:         ("in tech database" "player allowed" huge")
Code: [Select]
huge")
Someone's missing an " :)

Took me a few days to get back on this.

Thanks guys! Will fix soon and see if it works.