是否有可能让用户输入只接受某些单词,然后激活一个一直处于休眠状态的脚本? [游戏制作人]

Is it possible to get the user input to only accept certain words and then activate a script that was dormant until then? [Game-Maker]

我想知道在 game-maker 中,是否有可能做到这样,当用户让我们说第一次点击时(目前分配给攻击),会出现一个弹出窗口,要求用户输入然后他们必须输入某个 word/sentence,然后当他们输入正确时,弹出窗口消失,然后他们就解锁了攻击能力?谢谢!

在您的房间控制器对象中,

1 - 有一个 "create" 步骤将您的 "firstLeftClick" 初始化为 "true"

2 - 有一个 "step" 事件,其中你有一个 "execute code " :

// code to execute
posX = (room_height - sprite_get_height(myDialogObject))/2;
posY = (room_width - sprite_get_width(myDialogObject))/2;

if(firstLeftClick && mouse_check_button(mb_left)){
    instance_create(posX,posY,myDialogObject);
}

接下来有你的对话框对象(不知道如何创建但一定不难,同样的方法添加一个步骤事件来验证提示的值并在识别某些模式时执行一些操作。

参见script_execute(scr, arg0, arg1, arg2, ...);在 https://docs.yoyogames.com/index.html?page=source%2Fdadiospice%2F002_reference%2Fmouse,%20keyboard%20and%20other%20controls%2Fdevice%20input%2Findex.html