Wednesday, December 13, 2023

CCSF '23 Release: Magic Words Core 1.3 Updates


Grab the megapack download here! Or if you want to download each update individually, select below: 
[Magic Words Core 1.3] (also requires the Speech Bubble Upgrades 1.2 for all the features to work) 

Whoof, this one was a lot! The backstory behind this is that I wanted to make Magic Words more flexible by allowing other agents to call them-- not just the hand. But since I had written all my magic words commands assuming that the hand would always be the one to call them, it was going to require a bit of an overhaul. Personally, I feel like it was worth it, especially since it got me to push out a couple other Magic Words updates I've been working on.

I sincerely don't know anyone who even uses the keyboard handler's keybinding abilities-- for as long as DS has existed I can barely even remember anyone talking about it. (If you're a person who does, I would love to know what you bind to your keys.) But I figured it might be more useful if I made it compatible with Magic Words, so that you can assign Magic Words phrases to a hotkey for easy access. 

One thing I didn't mention in this video is that the keyboard handler implements another small update-- if you bind an F-key to a 'favorite place' as explained in the help, it will actually bind it to your current x/y location instead of the current metaroom. This has been super useful for getting around large metarooms like C2toDS quickly.

But I think in this entire pack of updates, I am most happy with the autocomplete feature added to the Magic Words Inject command. It's been on my wishlist for quite some time and I'm just glad I finally got around to doing it-- it's already making my life so much easier.

The rest of this post is aimed at developers, so if you're wondering what this core update might mean to you, read on:

Developers who have written/may write Magic Words commands, you will only need to consider updating your commands if 1) they take the location of the hand into account when deciding how to act, and 2) you want your Magic Words to instead take the location of the call-agent into account if something other than the hand called it. An example of this would be a command that typically produces or moves an item to the hand. The new Magic Words core now will send the calling agent in _P2_ to the magic words script, so you will want to update your script to check if _P2_ is an agent, and if it is, act in whatever way makes sense (like if your magic words generate an item, have that item move to _P2_'s location instead of mopx mopy). If you have any questions or difficulty with this, please get in touch with me; I am more than happy to help. I'll try to get a new template posted pretty soon, too.

Also, even if you don't update, your Magic Words will work just fine with core 1.3 -- they just may behave as though the hand is calling them even if another agent is calling them.

Developers who want to create agents that call magic words commands: You can do this by sending a MESG WRIT to script 1000 on the Magic Words Core (game "amk_magic_words_core_agent") with the command set in _p1_ and the agent doing the calling (or at least the agent you want the Magic Words to consider the agent you are calling, such as a creature) in _p2_. Example: mesg wrt+ game "amk_magic_words_core_agent" 1000 "import 1 norn" norn 0
 would use Magic Words Import/Export to import one norn next to the currently selected norn. This will not produce a speech bubble-- you'll still have to use SEZZ or call the speech bubble factory if you want to do that.

Notably, using SEZZ or triggering the speech bubble factory alone will not call the Magic Words-- you still have to message the core agent. Otherwise we would have the possibility of creatively named or vocabularied creatures calling Magic Words, which, while very funny to think about, is something I'd have to patch out anyway as soon as someone started naming norns "war" with all their drive words set to "time" and warping them out to unsuspecting people running unattended worlds. As amusing as the idea is, we probably should not give norns that much power. However if you did want to give creatures that much power... you could probably make an agent with a script 126 (which is called whenever a creature speaks) that waits a few ticks before calling mesg wrt+ game "amk_magic_words_core_agent" 73 13 "" 0 which will manually trigger the Core to scan speech bubbles, including creature speech bubbles, for commands to act upon.

...Anyway, evil tangenting aside...Again, please feel free to ask any questions you have about this and/or let me know if you're having any trouble with it! I know I'm not going into a lot of detail here but I'm hoping to do a better write up when I have more time.


No comments:

Post a Comment