じ☆ve冰风 发表于 7 天前

Set another event's selfswitch

Sometimes I have found that it seems onerous or wasteful to create map/global switches for one-off events. Sometimes I wish I could have a cutscene event tell another event that it needs to change its state and keep those state changes local/encapsulated to each event. 

I've added a plugin command called SELFSWITCH which will allow one event to control the "self switch" of another event. 

SELFSWITCH <event_id> E.g.:

SELFSWITCH 1 A ONThere may be a better way to accomplish this but I hope maybe this little script will come in handy for someone else.

https://github.com/caseylutz/KCL-MV/blob/master/KCL_SetSelfSwitch.js

If you use a helper library, FindEventByName, then you can call out your event ID by its canonical name rather than its event ID number.

https://github.com/caseylutz/KCL-MV/blob/master/KCL_FindEventByName.js

E.g.:

SELFSWITCH ENGLISH_VILLAGER_001 B ONNote: You may omit the switch and value parameters. The defaults will be "A" and "ON" respectively. 

EDIT: Plug-in moved to GitHub. 


本贴来自国际rpgmaker官方论坛作者:dragoonkain处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/set-another-events-selfswitch.47669/
页: [1]
查看完整版本: Set another event&#039;s selfswitch