ID:170784
 
Hey, I was wondering about setting macros dynamically. Someone told me that it can be done, and was curious of how to do it. Is it possible? If so, how would I go about.."Implementing"..it?
How do you mean?

People can set their own macros in the Dream Seeker.
In response to Elation
Elation wrote:
How do you mean?

People can set their own macros in the Dream Seeker.

My friend said that he's seen in a game that set them for them../shrug. I think he was smoking something when he said that. lol.
In response to Lenox
He was smoking DM eh? I smoke that stuff alot. =P

File>New>Script File(.dms)>Name it macros(.dms)

In that file put..
macro
s return "say" //calls the verb named say with the s key.


Then in some DM file..
client
script = 'macros.dms' //Name of the script file.
command_text = ".alt " //Sets the player in "macro" mode.


mob/verb/say(T as text)
if(!T)return
T = "[html_encode(T)]"
T = "[copytext(T,1,251)]"
world<<"<b>[usr] says: [T]</B>"


~>Jiskuha
Dynamically from within code? Can't be done. At least, not any way that I know.

You can set up macros as Jiskuha described, but you can't change those without recompiling the game. Players can of course change macros whenever they want to, via Options->Preferences->Macros, but that's out of the game developer's hands.
To do dynamic macros, you can use the call() proc and text2path proc. Note, however, that when using call, you have no src. If you need some pointers or anything, I'll be happy to help you. :)
In response to Igmolicious
But that's just changing what the macros do, not setting them dynamically. =P

Same difference I guess.
In response to Crispy
Well, he said he saw it in an old zelda game, you could have them set which buttons do what in game, I know about the Macros tab in the preferences popup, but he said there was a different way, so I thought I might ask. Well, thanks for the help ya'll :P
In response to Crispy
Still ends up with the same result, the result Lenox was looking for in the end.

That's something most people around here don't understand. You can do most everything you can think of, it's just a matter of how much effort you are willing to put into it; and possibly how much you want to restrict it to people with high-speed 'net connections. This is something I have been trying to drill into the heads of people who contact me asking if things are possible. If someone says "I wanted to ask you if something is possible in DM." just reply with "Yes." before the person even asks.