|
********************************************************************************
This is a Character Switching Tutorial made by James Favier AKA Alynn
the Yellow
eyed. This one was used for 6 characters. With the first char always
being the
main char, Do adjustments accordingly.
If you use it give me credit dangit!
If you have any questions email Alynn@eternals.dk
********************************************************************************
First you need to make yourself a CMS map, however you feel it should
look. Mine
consisted of a self made chipset.
Ok, first lets start out by going to common events. We are going to make
2 here
Name the first one SwitchCharacters and set its Start Condition as call.
Then put
in this code.
<>Change Var: Var[MenuPos1] (Set)-0
<>Change Var: Var[MenuPos2] (Set)-0
<>Change Var: Var[MenuPos3] (Set)-0
<>Change Var: Var[MenuPos4] (Set)-0
<>Change Var: Var[MenuPos5] (Set)-0
<>Change Var: Var[MenuPos6] (Set)-0
That code initializes those variables so that there is no order of the
characters.
If this is not done then the choices a player makes on the last time he
used the
character switching CMS will still be in the variables.
<>Change Switch: Var[MenuRunOnce] Switch ON ((This will be used later))
<>Memorize Place:Map[MenuWhereMap],X[MenuWhereX],Y[MenuWhereY]
<>Change Switch: Var[NotInMenu] Switch OFF ((This will be used later))
<>Teleport: MenuMap(WhereX, WhereY) ((Where the exact start XY is off
your menu map))
<>Change Var: Var[CharacterChosen](Set)-1
Ok SwitchCharacters is done.... now on to the next common event.
Name: CustomMenu Start Condition: Parallel Process Switch: NotInMenu
Code:
<>Enter Password: Var[SwitchPassword]
<>If Var(SwitchPassword) 6
<>If Var(PartySize) 4(>)
<>Set Message Options:Opaque, Middle, Fixed, Wait until done.
<>Message:What do you want to do?
<>Show Choice: Menu/Change Party
:[Menu] Case
<>Call System Menu
<>
:[Change Party] Case
<>Call Event: SwitchCharacters
<>
:End Case
<>
:End Case
<>
:End Case
<>Set Message Options: Opaque, Bottom, Safe, Wait until done.
Ok now for explinations, this always runs in the background throughout
the game
when you hit the escape key it checked for the size of your party, if
its over
four (IE you have enough characters to have a reason to switch) it will
ask weather
you want to check the menu or switch your characters if you just want to
see the menu
If you choose menu you see the system menu, if you choose switch, it
calls the event
you made earlier and trans's the char to the MenuMap. The very end of
the code resets
the message box to the default.
Ok.... now that was the easy part... now its CMS time!!!
Now first things first Lets start with the 3 parallel processes that are
the backbone of
the CMS. Make sure you place these out of the way, so they cant be
interacted with.
Name: WhereHero Start Condition: Parallel Process Movement: Stay Still
code:
<>Change Var: Var[HeroX] (Set)-Hero's X Pos.
<>Change Var: Var[HeroY] (Set)-Hero's Y Pos.
<>
This just records the postion of the character so it knows which line
you are
choosing.
*************************************************
Name: RunOnce Switch: MenuRunOnce StartCondition: Auto Start Movement:
Stay Still
Code:
<>Change Switch: Var[MenuLine1] Switch ON
<>Change Switch: Var[MenuLine2] Switch ON
<>Change Switch: Var[MenuLine3] Switch ON
<>Change Switch: Var[MenuLine4] Switch ON
<>Change Switch: Var[MenuLine5] Switch ON
<>Change Switch: Var[MenuRunOnce] Switch OFF
<>
This code may need to be adjusted depending on how many chars you have
to choose
from. since the main char is always in position 1 for me I only have 5
to choose
from.
********************************************************
This is the hard one :). The numbers that will be saved in the MenuPos
1-whatever
is the char number in the database.
Name: MenuBackbone StartCondition: Parallel Process Movement: StayStill
Code:
<>Change Hero Walk Graphic: (maincharname) Arrow-1 ((this is my arrow
graphic))
<>Change Var: Var[MenuPos1] (Set)-1 ((Main Char is always in first
position))
<>Enter Password: Var[MenuPassword] ((make all choices checked))
<>If Var(MenuPassword) 6
<>Goto memorized Place: [MenuWhereMap] ([MenuWhereX], [MenuWhereY])
<>ChangeSwitch: Var: [NotInMenu} Switch ON
<>
:Else Case ((Everything past this point is dependant on how you have
your cms set up))
<>If Var(MenuPassword) 1 ((Down))
<>Move Event: Hero-Down
<>
:End Case
<>If Var (MenuPassword) 2
<>Move Event: Hero-Face Right
<>
:End Case
<>If Var (MenuPassword) 3
<> Move Event: Hero-Face Right
<>
:End Case
<>If Var (MenuPassword) 4 ((Up))
<>Move Event: Hero-Up
<>
:End Case
((Note You may want to make a Level1Choose through LevelXChoose before
starting this step))
<>If Var(MenuPassword) 5 ((Enter/Confirm NOTE! Everything past this
point is very dependant on how you have
set up your CMS))
<>If Var(HeroY) 5
<>If Switch(MenuLine1) Is ON
<>Call Even Level1ChoosePg[1]
<>
:End Case
<>
:End Case
<>If Var(HeroY) 7
<>If Switch(MenuLine2) Is ON
<>Call Even Level2ChoosePg[1]
<>
:End Case
<>
:End Case
<>If Var(HeroY) 9
<>If Switch(MenuLine3) Is ON
<>Call Even Level3ChoosePg[1]
<>
:End Case
<>
:End Case
<>If Var(HeroY) 11
<>If Switch(MenuLine4) Is ON
<>Call Even Level4ChoosePg[1]
<>
:End Case
<>
:End Case
<>If Var(HeroY) 13
<>If Switch(MenuLine5) Is ON
<>Call Even Level5ChoosePg[1]
<>
:End Case
<>
:End Case
<>
:End Case
<>
:End Case
<>
Wooo... Are you dizzy yet? If not my fingers are hurting... so at least
one of us is in pain.
The next parts are a bit more difficult. and quite the pain in the arse,
but bare with me.
I have a total of five choosable characters... so as you see above i
have five lines that can be choosen. But
how pray tell did i do those considering that not all 6 are in the
party, and how do i know which ones i chose
already. Ok... here we go with this...
The character names are Alynn, Pamela, Jim, Tank, Angeline and Namerek
(1,2,3,4,5,6 in the database)
On the right side of my CMS i have 12 events 2 wide and 6 tall like this
(I am using the Event Names
Number1 Choice1
Number2 Choice2
Number3 Choice3
Number4 Choice4
Number5 Choice5
Number6 Choice6
I will break down how i set them up starting with the left side and
going down
Number1 is just a graphic number 1. That goes for the numbers 2 through
4 also. The only coding has to be
done on the number 5 and 6 (and so on if you have more)
Name: Number5
Page 1: Blank Graphic
Page 2: number 5 graphic Event Condition: Variable: PartySize above 5
Name: Number6
Page 1: Blank Graphic
Page2: Number 6 Graphic Event Condition: Variable: partysize above 6
Now for the Right Side (the Choice side)
Name: Choice 1 In my game it is always Alynn so this never changes if
you dont have a static first char just
follow the coding below for how i did the other 5 Choice events...
Name: Choice2
Page1: Blank Graphic Varible: MenuPos2 above 0
Page2: 2nd hero graphic Variable: MenuPos2 above 2
Page3: 3rd hero graphic Variable: MenuPos2 above 3
Page4: 4th hero graphic variable: MenuPos2 above 4
Page5: 5th hero graphic Variable: Menupos2 above 5
Page6: 6th hero graphic variable: Menupos2 above 6
Continue this for all the other heros. Then do the same for the other
Choice events changine the Variable for
the other positions Menupos3 through whatever.
Now... how do you put the viewable names when you dont have a static
party. This is the tricky part. You will
need to make a group of Events next to each other from right to left as
long as the longest name of your heros
in my case Angeline is the longest name. So i have 5 lines with 8 events
going left to right. Im not going to
spell out all the coding but here is the basic idea
The order that the events appear in are based on the CharPos variables.
I will just do the first one...
Name: Line1Letter1
Page1: Variable CharPos2 above 0 blank graphic
Page2: variable Charpos2 above 2 (first letter of the char2 name)
Page3: variable charpos2 above 3 (first letter of the char3 name)
Page4: variable charpos2 above 4 (first letter of the char4 name)
page5: variable charpos2 above 5 (first letter of the char5 name)
page6: variabel charpos2 above 6 (first letter of the char6 name)
continue this for all the other events in the line. for 2nd 3rd and so
on letters.
Now the final part of this little cms... the events that set the chars
in their right positions.
if you remember back to our MenuBackbone event we coded such a long time
ago, it called some events. Here is
those events I will only do the first one. as the rest are basicly the
same...
Event Name: Level1Choose
Code:
<>Change Var: Var[CurrentChosen](+)- 1
<>If Var(MenuPos2) 0
<>Change Var: Var[MenuPos2](Set)- Var[CharPos2]
<>
:Else Case
<>If Var(MenuPos3) 0
<>Change Var: Var[MenuPos3](set)- Var[CharPos2]
<>
:Else Case
<>If Var(MenuPos4) 0
<>Change Var: Var[MenuPos4](Set)- Var[CharPos2]
<>
:Else Case
<>If Var(MenuPos5) 0
<>Change Var: Var[MenuPos5](set)- var[CharPos2]
<>If Var(CurrentChosen) V[PartySize](=) ((if the number of characters
chosen is equal to the number
in the party))
<>Change Hero's Party:(V[CharPos2]) (Rem)
<>Change Hero's Party:(V[CharPos3]) (Rem)
<>Change Hero's Party:(V[CharPos4]) (Rem)
<>Goto memorized Place: [MenuWhereMap] ([MenuWhereX],[MenuWhereY])
<>Change Var: Var[CharPos2](Set)- [MenuPos2]
<>Change Var: Var[CharPos3](Set)- [MenuPos3]
<>Change Var: Var[CharPos4](Set)- [MenuPos4]
<>Change Var: Var[CharPos5](Set)- [MenuPos5]
<>Change Var: Var[CharPos6](Set)- [MenuPos6]
<>Change Hero's Party: [CharPos2] (Add)
<>Change Hero's Party: [CharPos3] (Add)
<>Change Hero's Party: [CharPos4] (Add)
<>Change Switch: Var[NotInMenu] Switch ON
<>
:End Case
<>
:Else Case
<>Change Var: Var[MenuPos6](set)- var[CharPos2]
<>If Var(CurrentChosen) V[PartySize](=) ((if the number of characters
chosen is equal to the number
in the party))
<>Change Hero's Party:(V[CharPos2]) (Rem)
<>Change Hero's Party:(V[CharPos3]) (Rem)
<>Change Hero's Party:(V[CharPos4]) (Rem)
<>Goto memorized Place: [MenuWhereMap] ([MenuWhereX],[MenuWhereY])
<>Change Var: Var[CharPos2](Set)- [MenuPos2]
<>Change Var: Var[CharPos3](Set)- [MenuPos3]
<>Change Var: Var[CharPos4](Set)- [MenuPos4]
<>Change Var: Var[CharPos5](Set)- [MenuPos5]
<>Change Var: Var[CharPos6](Set)- [MenuPos6]
<>Change Hero's Party: [CharPos2] (Add)
<>Change Hero's Party: [CharPos3] (Add)
<>Change Hero's Party: [CharPos4] (Add)
<>Change Switch: Var[NotInMenu] Switch ON
<>
:End Case
<>
:End Case
<>
:End Case
<>
:End Case
<>
:End Case
<>Change Switch: Var[MenuLine1] Switch OFF
Now continue for every other character that can possibly be chosen
making sure you change the
switch turned off at the end and CharPos2 to 3 and so on... And that my
friends is all that there
is to it :)
Have Fun,
Alynn the Yellow Eyed.
|
|