Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Amo on August 16, 2006, 08:38:44 PM

Title: entity specific fonts
Post by: Amo on August 16, 2006, 08:38:44 PM
Good evening. We tried to define a separate font type for a entity. In this case: When the cursor rolls over the entity a text with another font type shall be load (black text on black ground isn't that good
Title: Re: entity specific fonts
Post by: metamorphium on August 16, 2006, 09:45:04 PM
Are you using the default game_daemon.script for the caption displaying?
Title: Re: entity specific fonts
Post by: Amo on August 16, 2006, 09:47:03 PM
Yes it is still standard.
Title: Re: entity specific fonts
Post by: Mnemonic on August 17, 2006, 07:15:37 AM
For example, to inherit the font assigned to the entity in SceneEdit, you'd have to do the following:

Edit game_daemon.script, find the line:

WinCaption.Text = ActObj.Caption;

and add this:

WinCaption.Text = ActObj.Caption;
WinCaption.SetFont(ActObj.GetFont());
Title: Re: entity specific fonts
Post by: Amo on August 17, 2006, 09:38:41 AM
Thank you works fine!
Title: Re: entity specific fonts
Post by: Amo on August 17, 2006, 09:58:50 AM
OK, I need to correct myself. It works only fine in debugging mode, after compiling the game we get script errors in main menu. In the game itself it works fine.
Title: Re: entity specific fonts
Post by: odnorf on August 17, 2006, 11:11:35 AM
Please, whenever there is a problem post the errors from the log files.
Title: Re: entity specific fonts
Post by: Amo on August 17, 2006, 12:30:43 PM
Ok, here we go:

WME Log:


13:27: ********** DEBUG LOG OPENED 17-08-2006 (Release Build) *****************
13:27: Wintermute Engine ver 1.6.1, Compiled on May 20 2006, 16:55:09
13:27: Platform: Windows XP Service Pack 2 (Build 2600)
13:27: DirectX version: 9.0
13:27: BugslayerUtil.dll is bound
13:27:
13:27: Scanning packages...
13:27:   Registered 0 files in 0 package(s)
13:27: Initializing scripting engine...
13:27:   Script compiler 'dcscomp.dll' bound successfuly
13:27: Loading plugins...
13:27:   wme_sample_pixel.dll
13:27:   wme_snow.dll
13:27: Loading string table...
13:27:   42 strings loaded
13:27: Enumerating Direct3D devices...
13:27: Enumerating DirectSound devices...
13:27: Available video devices:
13:27:   NVIDIA GeForce 6600 GT  (accelerated)
13:27:     nv4_disp.dll 6.14.10.7189
13:27:   NVIDIA GeForce 6600 GT  (accelerated)
13:27:     nv4_disp.dll 6.14.10.7189
13:27: Available audio devices:
13:27:   Primärer Soundtreiber
13:27:   Creative Sound Blaster-PCI
13:27:   [no sound]
13:27:
13:27: User selected:
13:27:   Video: NVIDIA GeForce 6600 GT  (accelerated)
13:27:          Windowed:no  Colors:32bit  T&L:no  Multisample:4
13:27:   Audio: Primärer Soundtreiber
13:27: Maximum texture size: 4096x4096
13:27: Engine initialized in 547 ms
13:27:
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:27: Runtime error. Script 'scripts\game_daemon.script', line 21
13:27:   Call to undefined method 'GetFont'. Ignored.
13:27: Error opening file '[null]'
13:27: Error opening file '[null]'
13:27: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28: Runtime error. Script 'scripts\game_daemon.script', line 21
13:28:   Call to undefined method 'GetFont'. Ignored.
13:28: Error opening file '[null]'
13:28: Error opening file '[null]'
13:28: CBFontBitmap::LoadFile failed for file '[null]'
13:28:
13:28: Shutting down...
13:28: Shutting down scripting engine
13:28: ********** DEBUG LOG CLOSED ********************************************
Title: Re: entity specific fonts
Post by: Mnemonic on August 17, 2006, 02:00:13 PM
Ok, change the line to:

if(ActObj.Type=="entity") WinCaption.SetFont(ActObj.GetFont());

That should do the trick.
Title: Re: entity specific fonts
Post by: Amo on August 17, 2006, 02:47:49 PM
That should do the trick.

And it does the trick. Thank you.