How to program an RPG script event / Cut scene in an RPG playoff in lens C?

For the background, I worked on an RPG based on the Ray Wenderlich tutorials. (Example) http://www.raywenderlich.com/1163/how-to-make-a-tile-based-game-with-cocos2d.

Now I’m trying to create a scenario script / Cut scene, so that, for example, when a player enters the building, different characters can discuss current events before continuing the adventure. My only problem is that I cannot imagine how to implement this.

I would suggest some kind of one-time trigger, perhaps in one place of the switch singlet statement? Which can attract all temporary characters? Then the event is deactivated.

I'm just looking for a plan on how to do this. Although programming examples are also welcome.

+6
objective-c cocos2d-iphone
source share
2 answers

you can simply check that the tile you are on while moving, and when you are on a specific plate, you can start the scene, you can also add a tag via TiledEditor (this is the recommended editor for use with CCTMXTiledMap) to your map to indicate where the frame should begin, as he indicated the starting point of the character in this tutorial. You check the specified trigger (either a specific tile, or what is indicated on the map) in each game cycle. and then, almost easily, you simply freeze the controls and play back pre-recorded cameras and object movements until the cutout ends. restore the game to normal mode and disable the check for the trigger.

+1
source share

It depends on how much time you want to spend in the system and how universal you want the final system to be. A powerful cutting system can be flexible enough to be used in almost all interactions in a typical 2nd RPG.

If you want your best, I would suggest an approach with a lot of data. Store as much data as possible in files and use the file system to your advantage. If you say: β€œall the scenes in the dialogue are in this folder”, then when adding a new scene, you just need to drop it into the folder and not create a scene, and then touch any conclusion of any main switch. Just keep in mind the large system that you want to make as simple as possible by adding a new scene, rather than 400 different places to touch.

I would also stay away from switch statements to track progress in the video. This adds a lot of overhead to each scene. An identical clipping would be as simple as an array of data and position. Your sketch manager, singleton, can parse the array, decode the data in commands, and turn it off.

Sorry if this is a big uncertainty, but many of these decisions depend on how your engine is structured and what you want from the system. Keep in mind that the more general the system is, the more you can use it to move forward, but to get started you will need more time to get started.

+3
source share

All Articles