Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Musta Kaapu on May 11, 2003, 12:59:35 PM

Title: Problems with entities
Post by: Musta Kaapu on May 11, 2003, 12:59:35 PM
I started scripting my first scene and I ran into very bizarre problems. Idea was to add a hotdog seller to the scene but I couldn't do it, whatever I tried I couldn't get the seller to appear to the screen. The seller is an entity in the project, just like in the oldguy in the wme_demo. In wme_demo project the  room.scene's scene_init.script has these two lines:
global OldGuy = Scene.LoadEntity("entities\oldguy\oldguy.entity");
OldGuy.SkipTo(505, 330);

I added these to my scene's scene_init.script  (of course changed  the name and parameter to point to my entity)

Well nothing happened, the hotdog seller didn't appear. I tried with the wme_demo project and I did managed to get it working (I changed the oldguy to hotdog seller). At this point I was kind a frustrated, so I checked all scripts. Everything was in order, all scripts were fine and I could compile the packages without problems.  But still I couldn't get my entity to the screen.

Then I tried a different approach. I added my scene, actor and entity to the wme_demo, changed game.script to load my scene and actor...and now comes the weird part. The game starts in my scene with my actor, but it starts running the wme_demos/room scene's tour script!!!!  I found out that it uses room scenes scripts but all other things are from my scene (backgrounds, walking areas...) Why is this happening?

If anybody has some good ideas how to get my entity to show up without the tour thingie, I would like to hear.
Title: Re:Problems with entities
Post by: Jerrot on May 11, 2003, 01:35:49 PM
I added these to my scene's scene_init.script  (of course changed  the name and parameter to point to my entity)
Well nothing happened, the hotdog seller didn't appear.

Hm, probably just some little error... you could try to enable the debug mode and to lookup the logfile for possible runtime errors.

Quote
Then I tried a different approach. I added my scene, actor and entity to the wme_demo, changed game.script to load my scene and actor...and now comes the weird part. The game starts in my scene with my actor, but it starts running the wme_demos/room scene's tour script!!!!

Maybe you just copied the scene_init.script in your own scene ?
Well however - at least I can offer you this: zip your game directory and send it to me by email: timo@waelisch.de and I'll try to find the error and to correct it.

Greetings, Jerrot.
Title: Re:Problems with entities
Post by: Mnemonic on May 11, 2003, 04:03:36 PM
Yes, like Jerrot said, be sure to check the log file for possible problems (like missing files etc.). The log file should be in the same folder where is your project file (.wpr) and it's called "wme.log".
About the tour script... you probably forgot a tour.script reference in your scene_init.script file.
Title: Re:Problems with entities
Post by: Musta Kaapu on May 11, 2003, 04:31:25 PM
I found these in wme.log
18:19: Error opening file 'fonts\outline_red.fnt'
18:19: CBFont::LoadFile failed for file 'fonts\outline_red.fnt'
18:19: Error opening file 'scenes\Room\scr\scene_init.script'
18:19: CScEngine::GetCompiledScript - error opening script 'scenes\Room\scr\scene_init.script'

At this time I have deleted whole scenes\Room directory from the project, so that's why those appear. But I also went through all the .script files in the project and none of them have any room word.  So where does this sudden need for Room\scr\scene_init.script come from? It isn't refrenced in anywhere in the project...

By the way, when you make a new entity it automatically writes the font as .fnt file not as .font in the .entity file's FONT section.

EDIT:

I got it, the engine requires that there is one scene in scenes\Room directory. The engine tries to load scene from scenes\room directory even if it doesn't exist!!

But still the engine tries to load outline_red.fnt which isn't referenced anywhere. Guess I just have to copy outline_red.fnt from outline_red.font :)
Title: Re:Problems with entities
Post by: Mnemonic on May 11, 2003, 06:02:39 PM
I got it, the engine requires that there is one scene in scenes\Room directory. The engine tries to load scene from scenes\room directory even if it doesn't exist!!

Are you sure you've changed the LoadScene() line in game.script to load your scene instead of room.scene?
Title: Re:Problems with entities
Post by: Musta Kaapu on May 11, 2003, 07:07:07 PM
Quote
Are you sure you've changed the LoadScene() line in game.script to load your scene instead of room.scene?

Well I can't say for sure now 'cause I don't have the same settings anymore. But I had changed it earlier so I knew about it...

Let me think about it.... No I checked every file in the project and none of them contained word room or Room, so I had changed it. This is really bizarre 'cause if I now change the wme.log it shows correctly that it cannot load the scene...

But it works now, so I'm happy :)