Permamently change views of my character

Started by Feijotikus, Wed 25/07/2012 12:50:12

Previous topic - Next topic

Feijotikus

Hello!

My main character has different physical states during the game, for example he could be punched in a fight and his face would have a black eye, and I want all the views of the character (walk view, blink view, idle view, speech view, etc...) change. My first idea was modifiying the script:

cEgo.NormalView = vBlackEyed;

but unfortunately the NormalView property is read-only.

Now, I'm creating a new character for each state (cEgo_Normal, cEgo_BlackEyed, etc.) and translating all the actions. but it's a lot of work, and I have the feeling that it should have an easy and nice alternative but I can't find it.

Any idea?

Again, thanks!







Khris

Note that even if that command didn't exist, you could avoid duplicate code by using the player pointer.
So if you were to make a game where the player actually gets to switch between multiple characters, using player.Say("Hello"); will always refer to the character currently set as player character.

(Also, if you look at the manual entry for Character.NormalView, the solution is spelled out there. Always check the manual before opening a thread.)

Feijotikus

Sorry, I've already seen the ChangeView command, but maybe my english is not enough good and something is missing to me. I understand that ChangeView changes the Normal view. My problem is changing permanently all the views of the character.

But, I think that using the player poiner instead of the cCharacter I solve my problem.

And apologies for starting new threads. I use to check the manual all the time, but it's a little heavy to read it all, and the search texbox is broken, so sometimes is difficult to find exactly whay I search. In this case, I found the ChangeView command but I really thought that it wasn't exactly what I was wanting.

Again, thank you

Crimson Wizard

#4
Quote from: Feijotikus on Wed 25/07/2012 13:42:08
And apologies for starting new threads.
It is not a problem ;), it just an advice that reading the manual usually saves time.

Quote from: Feijotikus on Wed 25/07/2012 13:42:08
Sorry, I've already seen the ChangeView command, but maybe my english is not enough good and something is missing to me. I understand that ChangeView changes the Normal view. My problem is changing permanently all the views of the character.
Only NormalView is readonly and should be changed by the use of ChangeView. Other views (Speech, etc) are not read only and could be changed anytime.
But of course, use the method that is more fit for your needs.

Khris

Here's what the manual says:

Character.NormalView is read-only -> use Character.ChangeView()
Character.SpeechView "Gets/sets the character's talking view"
Character.IdleView is read-only -> use Character.SetIdleView()
Character.BlinkView "Gets/sets the character's blinking view."

The manual being heavy or the search box being broken (which one, how?) shouldn't have any impact on finding these and reading their entries.
I know that finding a solution can be tricky, that's why we have the forums and their search function, but I don't really see how this applies here, sorry.
I don't mean to pester you, just saying.

Feijotikus

Ok, Thanks, I'll try harder next time before to ask :D

SMF spam blocked by CleanTalk