Hello,
I try to make a toolbar for players, for example, player click button " house commands " ,then there is a gump list all the house commands, such as "I wish to lock this down".
I defined this "I wish to lock this down" button in OnResponse to say this sentence, the result is in game the character will speech this sentence, but only sentence on head, not target selection step. (if I input this sentence by keyboard, there will be target selection to ask me to lock something)

Here is my OnResponse code for button 1:
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;

switch( info.ButtonID )
{
case 1:
{
from.DoSpeech("I wish to lock this down", new int[], MessageType.Regular, from.SpeechHue ) ;
break;
}

Does anyone know what I did wrong ? I've tried use CommandSystem.Handle , but it seems this function only works with commands ( like [admin ).
 
in HouseRegion.cs you will find:

else if (e.HasKeyword(0x23)) // I wish to lock this down

and
else if (e.HasKeyword(0x24)) // I wish to release this

(the rest of the house commands are in the same general area of the script)


example usage:
Code:
public override void OnResponse( NetState state, RelayInfo info )
{
    Mobile from = state.Mobile;

    int[] Num1 = new int[] { 0x23 }; // I wish to lock this down
    int[] Num2 = new int[] { 0x24 }; // I wish to release this

    switch( info.ButtonID )
    {
        case 1:
        {
            from.DoSpeech("I wish to lock this down", Num1, MessageType.Regular, from.SpeechHue ) ;
            break;
        }
        case 2:
        {
            from.DoSpeech("I wish to release this", Num2, MessageType.Regular, from.SpeechHue ) ;
            break;
        }
    }
}
 
It works!
Thank you very much!

And, do you know where can I find all the keyword list?
In HouseRegion.cs :
if (Core.ML && Insensitive.Equals(e.Speech, "I wish to resize my house"))

for "I wish to resize my house", there is no keyword num information, where can I find it or can I add it to be a keyword ?
 
I usually set up Num as 0x0 in a situation like that. 0x0 doesn't do anything that I'm aware of but lets the text pass through anywhere that doesn't have a specific int[]. I'm not certain that it's the correct way but... it has always worked for me. Also just in case you didn't know the "text part" of DoSpeech can say anything or nothing and the int[] that is being used will still trigger the command.

example:
int[] Num =newint[]{ 0x0 };// does nothing I'm aware of

from.DoSpeech("I wish to resize my house", Num, MessageType.Regular, from.SpeechHue);
 
I think that's the problem now, with new int[] { 0x0 } , now it will not trigger the command , can you try it again on your shard ? if true, then maybe it's a bug.
 
what I posted above is from my house commands script I just added

// does nothing I'm aware of
and changed "0, 20" to "MessageType.Regular, from.SpeechHue"
to match what you had above

Make sure your standing directly under the sign when you use the command or if inside the house it'll give a "that is too far away" type message
 
Yes, "I wish to resize my house" works with this way, I tried "bank" with this way, it doesn't work. But for "recdu" "recsu" both works. Anyway, there is no block point for me to write my player toolbar, thanks!
 
Back