Problem with character views when changing player character

Started by janro, Fri 15/05/2015 17:44:45

Previous topic - Next topic

janro

Hi.

I have a player character named Howard in my project. He is the main player character and game starts with him as the player character. When I change player character from Howard to anyone else, character is displayed normally with it's IdleView animation. When character starts to move, Howard's NormalView animation is displayed instead of character's NormalView animation. Also character's IdleView animation is replaced by Howard's. Except in every 20 seconds or so, character's original IdleView flashes on the screen (appears for half a second or so and then changes back to Howard's view)

Same behaviour happens when player character is changed during the game with .SetAsPlayer-function or have been set as player character in project before project is run.
It doesn't matter if I use different characters, create new views or change starting room.

When I create a new project and import Howard and one of the other characters into that project, then views work as they should. I can change player character during the game or set different player characters in project and views works correctly.

So it seems to be a project related problem. I'm wondering what could I do for my current project to get views working correctly or should I just copy all content to a new project? Is this a known problem? I tried to search from forum but couldn't find any help.

All help is much appreciated.

MyEakinBack

Have you thoroughly looked through all your repeatedly execute code? Perhaps you could post it if you're doing anything significant there?
completed: Beyond Eternity

janro

Thanks for reply MyEakinBack.

I'm doing this project as a trainee so I have to first ask from my boss if I could post any scripts.

In the project we haven't used repeatedly execute -functions. I mean repeatedly_execute and repeatedly_execute_always -functions in the GlobalScript. I'm not aware of any other repeatedly executed codes in AGS. Indeed the problem behaves like it's repeatedly executed.

We have implemented own dialog manager which takes the code from event-functions in room scripts and GlobalScript to custom scripts. I don't know if that is related to problem, it doesn't seem likely for me.

I will double check the codes on Monday when I return working with it.

janro

The problem was caused by using player.ChangeView function call with first player character's normal view ID as parameter. Function call was made in on_mouse_click-function, when left mouse key was clicked. By checking player character's id and calling player.ChangeView with that character's normal view ID solved the whole problem.

MyEakinBack

Ah, so glad you found it. I too am using more than one main character. I found I have to check who's up almost everywhere. I need a button on my keyboard that spits out:

If (player.ID == 0) {
}
else {
}

I've written it so many times!
completed: Beyond Eternity

SMF spam blocked by CleanTalk