know an EASY way to make a character apperar in different forms?

Started by Isegrim, Thu 23/10/2003 12:26:11

Previous topic - Next topic

Isegrim

Hi there!

I want to make a Game character which changes his appearance several times in the game,
e.g. unarmored, battle gear, tournament gear, monk's robe, etc.
My first idea was to use multiple characters. Then I realized that I always have to check for the current character in the script, have to meddle with the Inventories whenever I change etc.
I know how to do it the way described above. But since QFG 4 1/2 does similar things with the cloaks, I hope there is an easier way to achieve my goal....
This post was generated automatically and therefore bears no signature.

Timosity

SetCharacterView(EGO,5); //will set character 'EGO' to view 5

you can use this to set all the characters views

just remember "ReleaseCharacterView(EGO);" will return the character to its original view, if it needs to return to a different view just use the SetCharacterView again

It goes in the script where you want it to change.

Note: it's probably a good idea to keep track of which view you are in using global ints, as you may only be able to interact with certain objects/hotspots in a certain view, or if you run an animation that can occur in different views.

eg. If you press a button when you have armor on, the animation might use the characters normal view for pressing the button, instead of the armor view. (note: you'd have to make a view that contains the animation in each of the characters costumes)

eg2.
SetGlobalInt(10,0); //unarmored (set to this when he/she returns to normal view)
SetGlobalInt(10,1); //battle gear (set to this when he/she is set to battle gear view)
SetGlobalInt(10,2); // tournament gear
SetGlobalInt(10,3); //monk's robe
etc

Hope that helps

~Tim

Isegrim

This post was generated automatically and therefore bears no signature.

Ishmael

Using ChangeCharacterView, SetCharacterSpeech and maybe SetCharacterIdle might do the job better, since then the character could be able to walkalk in the right appearance for sure...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

RickJ

You may want to reconsider using multiple characters.  You can use the GetPlayerCharacter() function to  return the player character ID in place of a constant such as EGO.  So, for example you would do this:

character[GetPlayerCharacter()].room = 42;

instead of this:

character[EGO].room = 42;



Isegrim

RickJ, what you suggest is just what I used to do.
As I said, it works, but the greatest problem is the inventory.
Multiple characters each have their own inventory, which means I have to use a global array to keep track of the inventory and update each character's inventory every time I change. This, however, is more difficult and error-prone than using just diferent views.
This post was generated automatically and therefore bears no signature.

Pumaman

ChangeCharacterView is the easiest solution for this problem, and is in fact designed for this very scenario.

RickJ

I hadn't thought about the inventory.  Good point.  

Timosity

Cool, I wasn't aware of ChangeCharacterView, I've been using the method I mentioned and never thought of looking for any other solution, and I've never noticed anyone mentioning it before.

I guess it's one of those things that I'll see being mentioned all the time now.

It'll save a little bit of scripting from now on, thanks Tk and CJ, It's those little things you pick up all the time that can help save time in the future.

Hollister Man

I've forgotten the command like that before.  :-) that's why we're here.  All of us miss a command, occasionally.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

SMF spam blocked by CleanTalk