Mobs reacting to socials, %victim.name% not set in act triggers?

  • Banlock
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
1 week 4 hours ago - 1 week 4 hours ago #8435 by Banlock
I'm running tbaMUD 2018.1 and I've been looking for a generalized way to have mobs react to socials (slap a dragon lately?), perhaps with a multiple triggers based on mob temperaments (one trigger each for aggressive, cautious, wimp, etc.) and then in each trigger a set of 'case' statements to flip through all of the socials I'd like to respond to - maybe with a default of 'emote ignores %actor.name%'.

But how would a script determine if the triggering mob is the victim of the social? Looking at the examples, it seems that most trigger on text from the social - but I want to be more general. Why not use %victim.name%?

So I created this trigger:
Name: 'RW - Mob Response to Socials',  VNum: [ 1004], RNum: [  288]
Trigger Intended Assignment: Mobiles
Trigger Type: Act , Numeric Arg: 1, Arg list: *
Commands:
say Trigger activated!
say The victim name is %victim.name%
say the command is %arg%!
say the actor is %actor.name%!

Then in one room loaded a clone (10) and a zombie (11) and attached my trigger to the clone. Then:

550H 150M 132V > smile zombie
You smile at it.
The clone says, 'Trigger activated!'
The clone says, 'The victim name is the zombie'
The clone says, 'the command is Admin beams a smile at the zombie.!'
The clone says, 'the actor is Admin!'

550H 150M 132V > smile clone
You smile at it.
The clone says, 'Trigger activated!'
The clone says, 'The victim name is '
The clone says, 'the command is Admin smiles at you.!'
The clone says, 'the actor is Admin!'


It looks like %victim.name% isn't getting set when the triggering mob is the victim.

Am I doing something wrong?

Is there a way to compare to nul?

I tried:
if %victim.name% == ""
  say I think I'm the target!
  say the actor is %actor.name%!
  say the command is %arg%!
else
  say I don't think I'm the target
  say the target is %victim.name%
  say the actor is %actor.name%!
  say the command is %arg%!
end

Which gives me:

550H 150M 132V > slap zombie
You slap the zombie.
The clone says, 'Trigger activated!'
The clone says, 'I don't think I'm the target'
The clone says, 'the target is the zombie'
The clone says, 'the actor is Admin!'
The clone says, 'the command is Admin slaps the zombie.!'

550H 150M 132V > slap clone
You slap the clone.
The clone says, 'Trigger activated!'
The clone says, 'I don't think I'm the target'
The clone says, 'the target is '
The clone says, 'the actor is Admin!'
The clone says, 'the command is Admin slaps you. Ow!!'


I could use 'you*' to establish that the triggering mob is the victim, but at least 'splash' also uses that in the text to the non-victims. So it doesn't seem safe to do that.

Any advice?
Last edit: 1 week 4 hours ago by Banlock.

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

More
4 days 7 hours ago #8436 by Rumble
I would test with a mortal, looks like you are testing with nohassle on (help nohassle- Prevents aggressive mobs from attacking and triggers from targeting the player).

Rumble
The Builder Academy
tbamud.com 9091

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

  • Banlock
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
4 days 6 hours ago #8437 by Banlock
Thanks, looking at the results of 'toggle' I seem to be running 'nohassle' already, but I tried switching to the zombie first (which should remove any god settings, correct?), and still got an unset victim:

550H 150M 132V > switch zombie
Okay.
the zombie> slap clone
You slap the clone.
The clone says, 'Trigger activated!'
The clone says, 'The victim name is '
The clone says, 'the command is the zombie slaps you. Ow!!'
The clone says, 'the actor is the zombie!'
the zombie> return
You return to your original body.


What I've done now is:
* This is setup to fire on actions
say Trigger activated!
* Note, as this trips on all actions including OLC, emotes and look
* The victim.name isn't set if the target is itself, so we test for 
if (!%victim.name%) && (%self.pos% == Standing)
  say I think I'm the target!
  say the actor is %actor.name%!
  say the command is %arg%!
else
  * Do we want to do anything for other positions?
end

Which gives me:

550H 150M 132V > switch zombie
Okay.
the zombie> slap clone
You slap the clone.
The clone says, 'Trigger activated!'
The clone says, 'I think I'm the target!'
The clone says, 'the actor is the zombie!'
The clone says, 'the command is the zombie slaps you. Ow!!'
the zombie> return
You return to your original body.


I'm working on a more complicated one that will do something like a consider to help the mob decide if they should attack when the victim of a physical social (like a slap).

I might also have some social flagged as too silly to respond to, and have something like:
echo We apologize for the silliness in the socials. Those responsible have been sacked.

I'm working on a more real example, and I'll post that here in case it would be useful to anyone.

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

Time to create page: 1.369 seconds