Welcome to the Builder Academy

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

More
08 Oct 2019 19:38 - 08 Oct 2019 19:39 #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:
Code:
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:
Code:
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: 08 Oct 2019 19:39 by Banlock.

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

More
11 Oct 2019 15:52 #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
rumble@tbamud.com

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

More
11 Oct 2019 17:14 #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:
Code:
* 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:
Code:
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.

More
02 Nov 2019 18:27 - 02 Nov 2019 18:28 #8438 by Fizban
What MUD are you working on this script on?

I can play around with it on tbaMUD, but might be easier to log onto the actual MUD in question and see if I can help you get it to work due to any potential code-related differences between the two MUDs.
Last edit: 02 Nov 2019 18:28 by Fizban.

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

More
04 Nov 2019 00:31 #8439 by Banlock
Thanks for the offer, the MUD isn't ready for action, between family and the job and whatnot. I'm really still just still working on the god zone for the mud, none of the player areas are ready. I guess I'm using the god zone to test out the atmosphere, or I'm just procrastinating.

But if you are still interested, its mud.rouseworld.org:4000, just let me know your user name so I can promote you to a level that can do some editing.

Below is the current state of the test script, it seems to work okay, but obviously can be confused by emotes with similar wordings. I want at some point to do a better job pushing the socials into categories that make more sense.
Code:
* Mob reactions to socials * This is a test of a mob that is intelligent, non-social, non-provokable, non-wimpy * Note - This is setup to fire on actions * Note - From note above, this trips on all actions including OLC and look * Note - In socials.new the fifth line is the line that the victim sees * Note - For some of these, will need to do a consider before violent reaction? * Note - Maybe have a this social is too silly response? * The victim.name isn't set if the target is itself, so we test for negation/empty string * Note - emotes also don't set victims, so potentially could trigger incorrectly on one * Maybe also check for name in the arg? (%arg% /= %self.name.cdr% doesn't seem to work) if (!%victim.name%) && (%self.pos% == Standing) * aim if (%arg% /= weapon at you) emote gets into a fighting position. say Are you trying to start something? * battlecry/growl/hate/hiss elseif (%arg% /= warcrying) || (%arg% /= growls at you) || (%arg% /= burning with hatred) || (%arg% /= hisses at you) emote stares at %actor.name% warily. * bearhug/muss elseif (%arg% /= bearhug) || (%arg% /= your hair) emote pushes %actor.name% away. say Hey, back off, okay? * beckons elseif (%arg% /= beckons) emote points to thier self questioningly. * bite/caress/collapse/comfort/cradle elseif (%arg% /= bites) || (%arg% /= caresses) || (%arg% /= collapses) || (%arg% /= comforts) || (%arg% /= cradling) emote backs away from %actor.name%. say Keep back you wierdo. * bonk/bop/fwap/noogie elseif (%arg% /= bonks) || (%arg% /= bops) || (%arg% /= fwaps) || (%arg% /= you a noogie) emote shakes their head. say You are starting to make me angry. * bow elseif (%arg% /= bows) emote bows to %actor.name%. * box/clobber elseif (%arg% /= boxes) || (%arg% /= clobber) emote doges %actor.name%. emote takes a few swings at %actor.name%. * challenge elseif (%arg% /= challenges)å emote straightens their posture. say %actor.name%, don't try to start anything. * charge elseif (%arg% /= charges) emote sidesteps %actor.name% advance. say Are you mad? * embrace/enthuse/facegrab/fondle elseif (%arg% /= embraces) || (%arg% /= enthusiastically) || (%arg% /= face tightly) || (%arg% /= being a pervert) emote pushes %actor.name% away. say No! * french/goose/grope/kiss/pinch elseif (%arg% /= passionate kiss) || (%arg% /= gooses your) || (%arg% /= gropes you) || (%arg% /= kisses you) || (%arg% /= pinches your) emote shoves %actor.name% away. emote slaps %actor.name%. * hug/huggle/lean/makeout elseif (%arg% /= hugs you) || (%arg% /= huggles you) || (%arg% /= leans against you) || (%arg% /= looks desperate) emote backs away from %actor.name%. say Stay back, you! * nibble/nuzzle/peck elseif (%arg% /= your ear) || (%arg% /= nuzzles your) || (%arg% /= gentle peck) emote pushes %actor.name% away. say No! * nudge/pat/pet elseif (%arg% /= nudges you) || (%arg% /= your head) || (%arg% /= pets you) emote gives %actor.name% a puzzled look. * peer/look elseif (%arg% /= peers intently at you) || (%arg% /= looks at you) emote looks at %actor.name%. * poke/slap/nyuk elseif (%arg% /= slap) || (%arg% /= poke) || (%arg% /= pokes at your) emote steps back from %actor.name%. say What the heck? * pounce/pound elseif (%arg% /= pounds you into) || (%arg% /= pounces on you) emote dusts themselves off. emote looks at %actor.name%. say If you want to really fight, go for it! else * Ignore things we don't recognize end else * Do we want to do anything for other positions? end

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

More
27 Nov 2019 16:29 #8444 by Banlock
Hey, thanks so much for creating a character, I apologize for not noticing sooner - I was swamped at work and haven't been working on the mud.

I set your level to 33, but when I tried to: "set file fizban admlevel 4", I got a message saying "Can't set that!" - what a I doing wrong?

Thanks,

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

Time to create page: 0.231 seconds