Using an incomplete character

Started by Mr_Threepwood, Tue 22/08/2006 01:24:27

Previous topic - Next topic

Mr_Threepwood

Alright well here's the problem I'm having.

In one of my rooms I have a character that really isn't a full character so I dont want to draw it in every frame since it doesnt ever use them.  All it does is face one direction until your character clicks to talk on it, at which point it looks downwards and talks.

There's a few problems with this though, here they are.

1.  I'd rather put the interaction between the two characters in the room script than the character interaction script.  I sort of have this by using the global on call function to call the rooms script, but I'd like to know if there way a more elegant way. I was thinking of making the one character an object but didnt think that would work for talking.

2.  The biggest problem I'm having is with figuring out how the frames will work since I only have a few since it never faces left or right.  Right now I have it so that before the room fadein it locks the character view to the one of it facing the wall, and then when the main character talks to it it locks the view in another direction.  What will happen though when I try to add a talking animation for the character in since the view is locked?  How can I work around this to succesfully make the character without drawing all the unneeded frames?

Let me know if I need to make my problem clearer.
I am a mighty pirate

Khris

1. Theoretically, there's no problem with using an object instead, although you'd have to use an invisible character to do the talking.
(And there might be some issues if you are e.g. using an MI-Template or something like that.)
If you want the code to be inside the room script (I'm not sure why, though), use an object. There's no more elegant way than using CallRoomScript, except maybe using a module.

2. There's no need to lock the view.
Use Character.FaceLocation(); instead.
And you can fill the unnecessary frames with some blank or existing sprite, it doesn't really matter.

Mr_Threepwood

Thanks for the reply, I'll stick witht the on_call way of doing it then.  The reason I like it being in one room is because it just makes it easier to do location checks since stuff will probably be happening in the room at the same time.

Plus the code for having the one character be a "ghost" is in the room, and other than this room the character never appears anywhere else.

I'm not using a template or anything though, everything so far is from an empty game.  I may post something on it soon, I've been holding off since I'd rather have a substantial part of the game done before announcing.

However with the amount of work I've put into it now, it will be done eventually.
I am a mighty pirate

SMF spam blocked by CleanTalk