设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 92|回复: 0

[制作教程] Play Ocarina like in Zelda.

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    前天 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    4446

    主题

    864

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    22899
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    28239

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    New Tutorial that is for the Zelda fans =)

    There are plugins available to play the ocarina style ON MAP and IN BATTLE, some very complex
    to get it working.

    Now, will this work on the map, Ofcrourse it will work, but probably not in battle (not tested).

    what it will look like: (if gif play):
    [/url]
    if it doesn't work, try to click it (it's animated, so I dont know if it plays it, if not, play the demo) =)

    while I wont explain exacly how to create it, but here is what you MUST have in order to work.

    Plugins required:
    - YEP_EngineCore

    if you dont have the following (recommended plugin) I created a temp plugin for same effect!
    ShadowDragon_SM (StopMovement) (best not use in project, but use on your own risk!)
    - YEP_StopMapMovement  (I cannot include this one, because it's behind paid wall)

    Switches and Variables Used:
    Switch Main Loop
    Switch Play Ocarina
    Switch Learning Song
    Switch Check Song
    Switch StopMovement  (temp plugin as replacement for YEP_StopMapMovement)

    Variable Song (placeholder)
    Variable Song Index (button column reader)
    Variable Songs++  (each song has it's variable, so add as many as you like.)


    Step by Step tutorial (comments are in Demo as well):

    We start with creating 4 Common Events (pictures and explantion)
    Spoiler: Common Events
    Spoiler: Main Loop
    Main Loop trigger is set Parallel, and switch to Main Loop.
    Conditional branch checks first if the ocarina is been played, else it does nothing,
    if it does, we check the buttons pressed (this can be spammed if not triggered
    correctly after (see Play Ocarina) where we come later to it.

    Check if OK is being pressed, else, we check if DOWN is being pressed, same
    with RIGHT, LEFT and UP.  (you can use more notes if you like, use a keymapper
    in this case (not in this tutorial).

    Keep in mind that the sounds are NOT 100% correct, so correct them with
    your own sounds, this is only an example!.

    [url=https://forums.rpgmakerweb.com/attachments/mainloop1-png.170665/]

    Spoiler: Use Ocarina[quote]When you use the Ocarina (you can use a keymapper or YEP_ButtonCommonEvent
    to attach this common event to the button.

    We first save the BGM that is played on the MAP and fade that out in 1second.
    You may experience to 2-4 seconds, I wont recommend higer than 3 though.
    We also Disable the Menu Access after so we dont get into the menu unwanted.

    StopMovement switch (ShadowDragon_SM) is a temp solution for YEP_StopMapMovement.
    The song variable is set to 0 (Song variable is the placeholder), Song Index reads the columns.

    1 is the first button, (later explained).
    after that, We place the background (you can be creative in creating those)
    wait 10 frames this buffer is required, 10 to 30 frames max), than we set the Switch
    Play Ocarina ON. (which activate Main Loop Common Events to play the notes!)
    [/url]
    Spoiler: Play Ocarina
    This is a repeatable check, I explain "OK button", but repeat for DOWN, RIGHT,
    LEFT and UP.

    The Commont for variable placed (you may change it).
    OK check = 1
    DOWN check = 2
    RIGHT check = 3
    LEFT check = 4
    UP check = 5

    those numbers are used in the variable, this can be part of 2 ways,
    Long way and short way (confused) but I explain both in the spoiler "How Variables are readed"
    so you can choose which one you like (optional to check, recommeded for beginners).

    When Song Index = 1, we show a picture which is on the far left, when Song Index is 2,
    increse the X to +80 (or what fits for your resolution and settings), the Y is the same for
    the OK button, so only X is needed. repeat for Song Index 3, 4 ~ 8 (9 stays empty)

    9 is basicly max, while variables cannot have more than 9 digits.
    On the end, we add Song Index +=1 (so we have song Index 2,
    SongIndex = 2 reads the 2nd column of the button, Song Index 3, reads
    the 3rd column etc. we also see if the Check Song = ON (self turning switch OFF)
    Explained in Spoiler "Check Song" (next part below this image).

    [url=https://forums.rpgmakerweb.com/attachments/playocarina3-png.170668/]


    On the DOWN, we add +2 when SongIndex = 1, +20 when SongIndex = 2 etc,
    On RIGHT, we add +3 on SongIndex = 1, +30 when SongIndex = 2 etc,
    On LEFT, we add +4 on SongIndex = 1, +40 when SongIndex = 2 etc,
    On UP we add +5 on SongIndex =1, +50 when SongIndex is 2 etc,
    the higher the SongIndex, the more 0's (zeroes) you add, or 1 less 0.
    (depends what's easier, see spoiler "How variables are readed")
    [/url]

    On the Play Ocarina still, we also check when the "cancel button" is triggered,
    if you ask, why is not "escape" checked? (Input.isTriggered('escape') is because
    cancel and escape functions in the same way.

    we fade out the BGM of the ocarina sounds, 30 wait frames (buffer and important)
    without buffer or lower than 20, the menu might open, 30 frames avoid that.
    we Enable the Menu Acces back on, and Play Ocarine switch OFF.
    after we replay the map BGM again.

    the next part of erasing images can be quiet long, erase pic, erase pict2,
    erase pict 3, up to all 10, but it is required if you use 1, 3, 6, 10, etc, else
    we just erase them in a batch using:

                    JavaScript:       
    for (var i = 1; i <= 10; ++i){  //this means, 1 is the picture ID, 10 is the end of Picture ID$gameScreen.erasePicture(i); // this erase all pictures in a range from 1 through 10.}


    in case you picture ID 41-50, use var i = 41; i <= 50 instead.
    than (temp plugin), turn switch OFF to enable player movement again.
    else AllowPlayerMovement if you use YEP_StopMapMovement.
    [url=https://forums.rpgmakerweb.com/attachments/playocarina2-png.170672/]


    SongIndex = 1 are the columns like I said before, but if it's confusing somehow,
    here is a sample (songIndex 1 is only readed ones, while we increase it by +1.
    so here is a sample how SongIndex is readed: which explain the button setting.
    [/url]
    Spoiler: Check Song
    I use this in 3 parts, first part first, 2nd part below this image.
    Check Song trigger is parallel (very important, DO NOT USE AUTORUN), even if it
    turn the Check SOng switch turn OFF.

    If Song = Song 1 (check if Song variable is the same as Song 1)
    we also check if Song Learnging = OFF (switch), explain later on "Event Setup)"
    if the song is correct, play a sound effect, fade out BGM 1 second, Switch Play Ocarina = OFF,
    we dont want them to play do we? than we erase the images in a batch (same as you
    press cancel button).
    IMPORTANT PART HERE: Replace Text (placeholder) to make an effect, like
    weather change to rain, thunder, or time +6 hours, or teleport somewhere or open
    passages when in the correct place, so be creative here.
    We replay the map BGM again, and enable map movement here again.
    wait 10 buffer, and acces Main Access to Enable (make it 20-30 to be save).
    [url=https://forums.rpgmakerweb.com/attachments/checksongs4-png.170675/]


    Part 2 and 2A, Scripcall with xr is optional:

                    JavaScript:       
    let xr = [0, 366, 446, 526, 606, 766, 846, 926, 1006] // X possition array optionalfor (var i = 2; i <=10; ++i) { //we skip 1 because we dont want the background to be deleted$gameScreen.movePicture(i, 0, xr, 5000, 100, 100, 255, 0, 40);}


    the scriptcall for move picture i = picture ID2 through 10, xr reads the array,
    so all bottons drops down to Y position of 5000 in a duration of 40 frames.
    when you enter a wrong song, you can also move it to without xr, and replace
    for 1000, so it go to the right of the map, or -1000 to the left. so play around
    with the X (xr), Y (5000), 40 (duration).

    we set the variable Song back to 0, and song index to 1, than we Play Ocarina to ON
    and Check Song OFF.  so we can try again for the correct song.
    Spoiler: Event Setup
    Short explaining how to set up. so we start with initialize the songs (page 2 and 3 are irrelivant)
    page 2 = empty event with condition of Switch A is ON.

    Main Loop Switch is activated on the first map where your actor starts the game.
    this is set to parallel, autorun is also possible, but parallel is recommend in this case.

    Variables Song 1 through song 6 are set to -1,  it means, you cannot play this song, as long
    it is not learned. you can add songs with already given value (hidden/secret melodies) for
    suprise if you like to or devMode =)
    [/url]

    Learning a Song (finally) (now we can put it in action (yay))
    We set the variable for Song 1 to be learned (you can set the song to be learned)
    the setup for the variable is 523411 (how to use those variables is in the next spoiler)

    Learning Song switch = ON,  this is important on learning a song, so you cannot play any
    song you learned at that moment, so long you learn a new song.
    Save Map BGM, this basicly copy the common event "Use Ocarina"
    in addition of variable and learning switch is added.  (page 1 is irrelivant, but you may add
    one if you want text before like what you learn (see demo), and check if the player has
    the ocarina or a different instrument before it can learn a song.
    [url=https://forums.rpgmakerweb.com/attachments/learningsong1-png.170683/]


    if song = 523411  (the song you need to learn), if correct, play SE sound.
    Play Ocarina switch = OFF, buffer of 10 frames (minimum, 20-30 to be saver),
    Enable the menu again, and replay BGM, erase pictures in a batch again and return
    Players movement and a text and or effect that you learned a new song/melody.
    Learning Song Switch is OFF, so you can play it everywhere you like too. and SelfSwitch
    B, C, D = ON,  or E, F + if you have YEP_SelfVar Plugin.

    when cancel, you can copy the cancel part, but we add 1 switch and 1 variable to it.
    Variable Song = -1  (so you cancel the song learning)
    Switch learning Song = OFF, so you can play the songs you already learned.
    [/url]
    Spoiler: How Variables are readed
    The final part is how Variables are readed, both long, and short (easy and confused)

    confused/hard way (used in demo used)

    When Song Index = 1,  we add to the variable Song+= 1,
    when Song Index = 2, we add to the variable Song += 10,
    then on 3, we add 100 (we add +0 to each Song Index.

    in the demo, I use   A A<- ->↓↑ (114325) but while Song index = 1, than +10
    it start on the end. so you need to read it backwards (reversed), and so it
    become:  523411 as the song.  1 1 = A A.

    Long and Easy way is to read the 00000 if you want 11432500 (+2 "00")
    so if you have a song AA (1 1), than you have 11000000  as song number.

    So you have the following if the above is to hard or confused, change the variables to the following:
    Song Index 1 += 10000000
    Song Index 2 += 1000000
    Song Index 3 += 100000
    Song Index 4 += 10000
    Song Index 5 += 1000
    Song Index 6 += 100
    Song Index 7 += 10
    Song Index 8 += 1

    Basicly, you reverse the index to start with a high number, so the 11432500
    has the correct button input you place, else reversed, this means, you always
    need to put the 8 digit song as learning, if it has 4 digit button, it would be
    like this: 52140000   on the end.
    [/quote]
    That's for the tutorial setup, read the demo (use reversed variable reading)
    but if you have any question or suggestions, feel free to ask your questions.

    be creative in making it a wonderfull way it will fit.

    TIPS:  when creating a piano from it (piano? yes, a piano)
    Use a keymapper to use more buttons =), this is Zelda based, so instead of
    a lines, use a flute or music Note with the Letter and arrows inside of it.

    create colorfull notes or use a flute, or drums, or pipes as image that creates notes.
    the possibillities are almost endless as long you let your brains working.

    Credits? Nah, dont have to as long you use creativity, but creativity image
    of the background and notes used are welcome =)  if you cannot make them,
    maybe I can create one for you, but I tell you, it's easy


    Enjoy.


    Download [url=https://shadowdragon-jb.itch.io/evented-ocarina]here the Example
    :


    本贴来自国际rpgmaker官方论坛作者:ShadowDragon处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/play-ocarina-like-in-zelda.130734/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-14 14:20 , Processed in 0.151372 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表