This capture the flag tutorial is easy to make and not that complicated.
Code:
First of all you need to make a large map; it should be mostly vertical, Suggestion* the tower tile set is a good choice for this. Make two bases on the map at opposite ends. Make an item that you would like as your flag, It can be a sword, a real flag, or even an item, it really doesn’t matter. Make sure the teams actually look like teams with matching outfits or it can get really hectic. You also need to make a monster and monster group for the opposing team Secondly we need to make the opposing team. This first sprite should be placed in the front of your base This will be a four page event: Movements should be set to follow at fast speed and high frequency Page 1: The code is as follows: <>Variable: [001: Flag Steal] = Random (1..100) <>Conditional Branch: Variable [001: Flag Steal] = = 25 <>Message: Your flag has been captured, go get it back! <>Change Event Location:( *where you put him by your base*) <>Play SE: (*your choice but something annoying*) <>Variable: [002: Flag Capture] -=1 <>Switch: [001: Flag Steal] = ON <> Else Handler <> : End <> Page 2: *Make sure the Local Switch A prediction is checked The sprite should be the same but with a different color to know that He is the one with the flag. The trigger should be collision. Movements should be at slow speeds and at highest frequency They should be custom and set to repeat with the command “Move Away From Hero” The code is as follows: <>Message: Your not Getting this! <>Enemy Encounter: (Team 2) <>Message: You retrieved the flag, now return it back to the base! <>Change Items: [Enemy Flag] +1 <>Local Switch: A = OFF <>Switch: [002: Flag Capture2] = ON <> Page 3: This should have the same sprite you used in the first page, The movements should be set to a fast speed at the highest Frequency. The movement pattern is “FOLLOW” Make sure that in the predictions the switch [002: Flag Capture2] = ON The trigger should be collision. The code is as follows: <>Show Battle Animation [M]: This Event, [Emotion-!] <>Message: Hey! That’s our flag. Give it back! <>Enemy Encounter: [Team2] <>Switch: [002: Flag Capture2] = OFF <>Local Switch: B = ON <> Page 4: This will make the sprite respawn after you defeat it This page should have a fallen or down version of your character sprite Make it a parallel process Also Make sure that the Local Switch B prediction is checked The code is as follows: <>Wait: 300 Frames <>Change Event Location: (*where you put him at the beginning*) <>Local Switch: B = OFF <> This is for the guards that won’t be capturing your flag: Use the same Sprites The movements should be set to follow at slow speeds and the highest frequency The trigger should be hero touch This is a two paged event but in the intrest of saving time and effort just copy page 3of the first event after this page. The code is as follows: <>Message: Come here! Your not going anywhere! <>Enemy Encounter: [Team2] <>Change Event Location: Next to the opposite base <> Now for the members of your team This sprite should be placed at the enemy base Make sure that in the prediction box it says that the variable Capture flag is greater than or equal to 2 The movement pattern should be custom *Note: It should be moving from one base to the other, however you want to do it The sprite should be moving at slow high speeds and at the highest frequency The trigger is parallel Page 1: The code is as follows: <>Variable: [003: Capture] = Random (0..45) <>Conditional Branch: Variable [003:Capture] = 45 <>Message: Your team mate has captured a flag! <>Switch: [002: Flag Capture2] = ON <>Variable: [002: Flag Capture] +=1 <> Else Handler <>Local Switch: A = ON : End <> Page 2: The Local Switch A prediction should be checked Movements are optional The trigger is parallel Use the same sprite as in page 1 The code is as follows: <>Local Switch: A = OFF <> The other members of your team can just be running around like idiots if you like. Or you can set some of them to follow you at slow paces. Now for the Enemy flag: It can be what ever sprite you like The trigger should be Hero touch It is a two paged operation Page 1: The code is as follows: <>Message: You captured the flag, now take it back to the base! <>Change Items: [Enemy Flag] +1 <>Switch: [002: Flag capture2] = ON <>Local Switch: A = ON <> Page 2: The Local switch A prediction should be checked The trigger should be parallel The code is as follows: <>Wait: 200 Frames <>Local Switch: A = OFF <> Now for your flag: Page 1: The code is as follows: <>Conditional Branch: Variable [ Flag Capture] < 5 <>Conditional Branch: Variable [ Flag Capture] = = 4 <>Message: There is only one flag left <> Else Handler <> Conditional Branch: Variable [ Flag Capture] = = 3 <>Message: You need two more flags. <> Else Handler <> Conditional Branch: Variable [ Flag Capture] = = 2 <>Message: You need three more flags. <> Else Handler <> Conditional Branch: Variable [ Flag Capture] = = 1 <>Message: You need four more flags. <> <> Conditional Branch: Variable [ Flag Capture] = = 0 <>Message: You need five flags to win the game. <> Else Handler <> : End <> : End <> : End <> : End <> : End <> Else Handler <>Message: You won the game <>Play ME: (*your choice) <>(*A suitable reward*) <>Variable: [ flag capture] -=10 <>Change Items: [Enemy Flag] -10 <> : End <> Page 2: Make sure the prediction for this page says [flag steal] =ON The sprite could be something to show that the flag is missing but it has to be something. The code is as follows: <>Conditional Branch: [Our Flag] possessed <>Message: You retrieved our flag! <>Switch: [001: Flag Steal] = OFF <> Else Handler <>Message: You need to get our flag back before you can score <> : End <> You need to make two items Enemy Flag Our Flag You also need to create a new common event called variables Make it parallel to a [003: Start Game] You will put this start game switch in the map and make it a parallel process as well The code is as follows: <>Variable: [flag Capture] = [Enemy Flag] possessed <> The enemies that don’t steal the flag should have a regular monster group with 1 monster. *This should only go for the enemy that will steal the flag, you have to make another monster group for the guards that will not take the flag. In the monster group you created for the opposing enter this: Trigger: Hero [ ] HP is below 40% Frequency Battle <>The flag was taken from you! <>Change Items:[Enemy Flag] -1 <>End Battle <> *This monster group should go to the guard that takes the flag on page 2 There should be more monsters than the previous group Trigger Hero [ ] HP is below 40% Frequency battle <>Message: They Escaped! <>End Battle <>
