Welcome to the Builder Academy

Question An Issue with Mob-Time Trigger

More
16 Nov 2013 08:31 #4485 by Papaya Pete
I'm not sure why, but it doesn't seem like mob-time triggers don't work. I want a mob to appear in a forest clearing at a certain time, and disappear. Here's the script I tried...
Code:
Name: 'Feligar Appears in Clearing', VNum: [ 832], RNum: [ 38] Trigger Intended Assignment: Mobiles Trigger Type: Time , Numeric Arg: 20, Arg list: Commands: mgoto 829 %echo% There's the faintest of rustling among the trees before an elven man steps into the clearing. %echo% He walks over to the stump in the clearing, tuning a lute as he walks. %echo% He sits down and starts playing, singing softly; the melody is carried through the air...

And it doesn't work at all. I did another one where he's supposed to send a zoneecho, and it doesn't work either! It's getting a little frustrating when things should work but they don't.
Code:
Name: 'Music Echoes Through Valley', VNum: [ 831], RNum: [ 37] Trigger Intended Assignment: Mobiles Trigger Type: Random , Numeric Arg: 100, Arg list: None Commands: if (%time.hour% < 6) emote plays a soothing melody from this lute, singing something in the elven tongue as he does. %zoneecho% 829 A soothing melody echoes throughout the valley, a gentle singing carried along by the wind. end if (%time.hour% > 16) emote plays a soothing melody from this lute, singing something in the elven tongue as he does. %zoneecho% 829 A soothing melody echoes throughout the valley, a gentle singing carried along by the wind. end

Any ideas what's going on with this? An error in the code itself, maybe?

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

More
16 Nov 2013 19:53 #4487 by thomas
Is this on your mud or on tbamud? Which version?

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

More
16 Nov 2013 20:54 #4488 by Parnassus
I recreated these triggers on TBAmud with no real problems. If there's an error in the code, it would seem to be your modified code. I wondered about the brackets around the times but the trigger went off okay. The only problem I had with the first one was that it didn't fire when I used a mob flagged sentinel. When I attached it to a non-sentinel mob, the trigger went off. It seems that it can't be a sentinel-flagged mob though, because you don't have any instructions for it to move away.

On a more personal side, I wouldn't have used three echos the way you've done the first one. I would either have made a paragraph, split into 3 for spacing (using a color code at the beginning of each line, just to get rid of that irritating capital letter) or I'd put a wait 1 between your three lines to add a bit of emphasis and rhythm.

About the second one, that 100% chance can be really spammy, especially with a zone echo. That echo is going non-stop between 4pm and 6am, 6 times every mud hour, with no escape except to leave the zone.

Also, I see that in one of my triggers, I've used:
if %time.hour% > 19 || %time.hour% < 8
instead of writing everything twice, and it seems to work okay.

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

More
16 Nov 2013 23:47 - 16 Nov 2013 23:53 #4491 by Papaya Pete
This is on my mud, using the latest tbaMUD codebase. I've done quite a few minor mods on it, but have left the scripting portion alone completely.

If the mob-time trigger really doesn't work on mobs that are flagged sentinel... then it's pretty much useless to me in this case; I need that guy to stay in one place the entire time. I've rewritten it a little bit again, and am waiting for the time to come up for it to fire off.

I made the random script go off 100% of the time for testing purposes, just to make sure it was working or not. I tried writing it the way you did as well as breaking it apart more, just to see if I perhaps did something wrong. The only thing I did differently, which might've caused an issue, is putting each condition in (). It's a little sloppy, the way I posted it, but it's after I spent an hour or two trying to get things to work before asking for help.

Edit:
So I've done some testing and, this time, the mob-time trigger is firing off. I guess I should've asked this sooner; when you modify or add a script onto a mob, is it recommended to purge it and reset the zone?
Last edit: 16 Nov 2013 23:53 by Papaya Pete. Reason: Finished testing

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

More
17 Nov 2013 14:56 #4496 by rudeboyrave
i think we use something like
Code:
wait until 14:30 goto 1204 say its 14:30! goto 1 lick puff

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

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

More
17 Nov 2013 15:00 - 17 Nov 2013 15:04 #4497 by rudeboyrave
Here is an example of a mob who sits in room 0 and loads quest turkeys on thanksgiving based on mud time. Some good info in here :)
Credits to Warblade from CyberASSAULT
Code:
Name: 'turkey loading', VNum: [12004], RNum: [ 1021] Trigger Intended Assignment: Mobiles Trigger Type: Global Random , Numeric Arg: 100, Arg list: None Commands: wait until 5:00 set i 99 while %i% > 0 switch %random.5% case 1 mgoto 3052 %load% mob 12001 break case 2 mgoto 604 %load% mob 12001 break case 3 mgoto 24804 %load% mob 12001 break case 4 mgoto 1572 %load% mob 12001 break case 5 mgoto 6151 %load% mob 12001 break done wait 1 eval i %i% - 1 done mgoto 1 %purge% %self% wait until 10:00 set i 99 while %i% > 0 switch %random.5% case 1 mgoto 3052 %load% mob 12001 break case 2 mgoto 604 %load% mob 12001 break case 3 mgoto 24804 %load% mob 12001 break case 4 mgoto 1572 %load% mob 12001 break case 5 mgoto 6151 %load% mob 12001 break done wait 1 eval i %i% - 1 done mgoto 1 %purge% %self% wait until 15:00 set i 99 while %i% > 0 switch %random.5% case 1 mgoto 3052 %load% mob 12001 break case 2 mgoto 604 %load% mob 12001 break case 3 mgoto 24804 %load% mob 12001 break case 4 mgoto 1572 %load% mob 12001 break case 5 mgoto 6151 %load% mob 12001 break done wait 1 eval i %i% - 1 done mgoto 1 %purge% %self% wait until 20:00 set i 99 while %i% > 0 switch %random.5% case 1 mgoto 3052 %load% mob 12001 break case 2 mgoto 604 %load% mob 12001 break case 3 mgoto 24804 %load% mob 12001 break case 4 mgoto 1572 %load% mob 12001 break case 5 mgoto 6151 %load% mob 12001 break done wait 1 eval i %i% - 1 done mgoto 1 %purge% %self%


And a simple gate guard that works off time
Code:
Name: 'gate guard', VNum: [ 6171], RNum: [ 631] Trigger Intended Assignment: Mobiles Trigger Type: Random , Numeric Arg: 100, Arg list: None Commands: wait until 20:00 close gate %door% 6171 west flags a b c d say It's time to close up!

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.
Last edit: 17 Nov 2013 15:04 by rudeboyrave.

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

Time to create page: 0.305 seconds