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

[制作教程] Click on a picture to proceed, easy tutorial...

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 前天 07:30 | 显示全部楼层 |阅读模式
    For my own future reference as well as for others, I'm leaving what I've learned here for people to examine and perhaps add to. People can add more answers to this if they want, but it was hard for me to figure out on my own as I didn't know what tags to search up on google. I am using this to create mini-games: 


    How to display a picture of some sort, then click on that picture to proceed


            1) Firstly, you need a picture of some sort. Measure the picture out. I used a picture of a computer mouse that was 50x50 in size. 


            2) Download the following script that I've created: 


    http://www.forums.rpgmakerweb.com/index.php?/topic/54888-astra-cats-simple-cursor-script/


            Install it and activate it. This will create a variable for the X and Y positions of the mouse: MouseX and MouseY. It's a cursor script so it will also allow you to set up a cursor if you'd like. 


            3) Create the following rpg maker game variables: 


            0001: PictureXPos


            0002: PictureYPos


            0003: EventPage


            (Use the 1st and 2nd slots available)


            4) Create your event on your map. 







            5) Create three pages for your event. On the first page check where it says "Variable" and set it to the 0003: Event Page you've created and set it to greater than or equal to 0. 
            6) Set the second page 0003: Event Page greater or equal to 1, and the third page 0003: Event Page greater or equal to 2. 


            7) Set your event Pages all to Auto-run. 


            8) On the first page set up the PictureXPos and PictureYPos variables. Let's say we're doing 200x200 as an example.


            9) Do a "Show Picture" event command.


            10) Make sure to keep the origin of the picture displayed to the top left. 


            11) Know your picture's size in pixels here. As an example it's 50x50. 


            12) Do a "Set Variable" event command and set the 0003: EventPage variable = 1 (so that the event goes on to the next page).


            13) On the second page, make sure it's on Autorun just in case it wasn't set to that before...


            14) Do a "Conditional Branch" event command, and on the 4th page click on the bubble "Script"


            15) For this example, you can put: 


    TouchInput.isTriggered()


            (You can also do "TouchInput.isCancelled()" to wait for a right click instead of a left click)


            16) Do a second "Conditional Branch" event command inside of the first one. On the 4th page click on the bubble "Script"


            17) For this example, you can put something like: 


    MouseX > $gameVariables._data[1] && MouseY > $gameVariables._data[2] && MouseX < $gameVariables._data[1]+50 && MouseY < $gameVariables._data[2]+50







            (Remember that the picture is 50x50 for this example, so you'd have to adjust the size accordingly. A better practice would be to put the picture's size into a $gameVariable as well, then add that on to the MouseX < and MouseY < parts)


            18) If the conditional branch is true, do a "Set Variable" event command and set the 0003: EventPage variable to 2 (to go to the next event page)


            19) Create whatever you want on the third page of the event and beyond. 


            What you've create above by doing this is an event in where you click on a picture that's displayed to proceed. 


    Note: Also


            $gameVariables._data[] is the part that took me a while to figure out. You can also use it to set an in-game variable in rpg maker mv to a comparison between 2 or more numbers like so: 


            Script: $gameVariables._data[4] = $gameVariables._data[5] * $gameVariables._data[6]


            You can use this to create health bars, an example being that you could have 10 or more health bar pictures, and use conditional branches to display them using the following math equation:


            PercentageOfHPLeft = HP / TotalHP * 100


            Mine ended up looking in a Script command like: 


            $gameVariables._data[11] = $gameVariables._data[12] / $gameVariables._data[13] * 100


            Which gave me a percentage of how much HP the character had left, due to the fact that game variable 0011 was HPpercentage, 0012 was HPcurrent, 0013 was HPtotal and 100 just changes the decimal place of your final result.


            HP will change, giving you the percent of your characters HP, which you can then use to change pictures of your health bar. 


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-10 02:59 , Processed in 0.127211 second(s), 55 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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