Welcome to the Builder Academy

Question Problems with a Mob Command trigger

More
22 Sep 2018 03:03 #8213 by Parnassus
I'm trying to do a trigger to make a mob react to "greet" and "goodbye". I wasn't sure it would work because I seem to remember something about socials not working with command triggers. Sure enough, I tried all sorts of variations of numeric args and arg lists. I tried %cmd% and %cmd.mudcommand% and nothing worked.

(BTW, On looking for help on mudcommand:
>help %cmd%
mudcommand - Returns the mud command the string is shorthand for. Used to make
sure the command you react to is the one you want: For %text%="o"
%text.mudcommand% will yield "open". HELP MUDCOMMAND
>help mudcommand
See HELP TEXT-VAR
>help text-var
mudcommand - Returns the mud command the string is shorthand for. Used to make
sure the command you react to is the one you want: For %text%="o"
%text.mudcommand% will yield "open". HELP MUDCOMMAND
Not extremely helpful...)

Then I thought I'd try trigger 62. I took my trigger and copied 62 over it. I had my test character type "look orb" and nothing happened. Then I attached trigger 62 to my test mob and typed "look orb" and nothing happened. I checked that I was in a room Type: Inside, Flags: Indoors (to make sure it wasn't a visibility thing). Then I took my test character to the magi guard who uses t62 and typed "look orb" and it worked. I went back to my test mob and typed "look orb" and it worked. I detached t62 (leaving my copy trigger), typed "look orb" and it worked. I then had my imm character start playing with the trigger. I switched the l to g and switched look to greet. Greet orb worked. Then I added goodbye and that worked too.

Then I went to another mob with the same trigger and nothing happened again. I took the test character and new test mob and put them into the same room as the original test mob. My test character again tried greet and goodbye in the room with the original and the new test character who both have the same trigger. Only the original test character reacts.

Any idea what I'm missing here?

Hmm, before finishing this I decided to attach mob 62 to my new test character who now reacts to "look orb" AND "greet". So everything's working now but why do I need to attach and detach a tried-and-true trigger to my mobs to make my own triggers work?! Both mobs now give their own reactions to greet so the second mob is not just copying the first mob.

Please Log in or Create an account to join the conversation.

More
22 Sep 2018 11:28 #8214 by thomas
I'm not quite sure I follow what you did here - would you mind writing out the steps you took, for each command?

Please Log in or Create an account to join the conversation.

More
22 Sep 2018 15:27 #8216 by Parnassus
It's a bit complicated because you know that my frankentriggering means pushing and pulling it in any conceivable direction as fast as possible, but it was something like this:

Create trigger:
Name: Command trial
Intended for: Mobiles
Numeric arg: 100
Arguments: *
Commands:
if %cmd% == greetings
say Hello, %actor.name%
elseif %cmd% == goodbye
say Goodbye, %actor.name%
end

Get my test character (level 7) to greetings. (Greetings rather than greet because I had an idea somehow that emotes wouldn't work so I used goodbye which is an emote and greetings which isn't).

> greetings
Huh!?!
> goodbye
You wave goodbye to everyone.

Various changes tried one by one in no particular order and in various combinations:
Changed numeric arg to 0
changed argument to greetings
changed argument to g
changed %cmd% to %cmd.mudcommand%

Looked up various triggers and decided on 62 which is the trigger about 'look orb'.
Cut and pasted the commands over my commands. Still nothing.
Checked that the trigger was actually attached to the mob! (Yes, I've had problems with getting unattached triggers to work before...)
Checked that the room was actually inside and flagged indoors so that it wouldn't be a no-light type situation.
Checked to make sure that, yes, it was my low level character and not my high level character.
Checked to make sure that the parameters were the same as trigger 62.
Still nothing.

Checkload t 62 to see that it's loaded onto a magi guard.
Where magi to see that the guard is in room 134
Took the test character to room 134 to look orb which worked.

Went back to my mob's room.
trigedit 40301
W: copy trigger
62 (as far as I could see it was already the same but then why wasn't it working?)

Tested the trigger again and still nothing.

attach mob 62 quesnel
This worked!
detach quesnel 62 (This left only my 40301 on Quesnel although it thinks it's 62)
Again look orb works and now when I changed everything it all worked. So now I figured everything is good, right? Because it all works! So I brought in another mob, Brianne, who has the same trigger. My thinking is that my test character will do greet (by this time I've changed from greetings) and both of them will react. Nope, only Quesnel reacted. It was a bit confusing because Brianne actually had on another trigger (so two triggers) which was reacting to Quesnel's reaction so I put Quesnel to sleep. Brianne now refused to do anything at all.

attach mob 62 brianne
Look orb worked.
detach brianne 62
Now greet worked.

Woke up Quesnel and did greet.
Quesnel reacted to greet.
Brianne reacted to Quesnel. (other trigger)
Brianne reacted to greet.

So it was perfect! Well, except for the whole attach and detach thing which I totally don't understand.

Yeah, it's a lot of trials but that's how frankentriggering works. I don't worry about this because it's only cosmetic and it reacts as trigger 40301. The trigger still thinks it's trigger 62 and not 40301 but I think it stays like this until I reboot the mud. But I've done lots of triggers and never seen anything like this ignoring the trigger thing except when there's a problem with the trigger itself. I can see it's not the trigger because it worked on one mob but not the other until after the attach/detach at which time the trigger worked with no modification to the trigger itself. It was kind of like the mob didn't know what to do with the trigger until I gave it an example and then it was "Oh, okay, now I understand what you want." and off the trigger goes!

Please Log in or Create an account to join the conversation.

Time to create page: 0.225 seconds