Author Topic: GlobalTime triggers  (Read 3382 times)

0 Members and 1 Guest are viewing this topic.

Offline Parnassus

  • Newbie
  • *
  • Posts: 8
    • View Profile
GlobalTime triggers
« on: August 25, 2014, 09:29:59 pm »
Hi, my name is Parnassus and I'm generally over at TBAmud.  I've been invited to consult on some zones on the 4D build port.  This has been really interesting but there are some differences between TBA and 4D codes which gets a bit confusing.

This particular question has to do with Time triggers.  Over at TBA, a time trigger only hits when someone is on the mud.  This can sometimes make problems because if nobody is on the mud at the time named in the trigger and someone comes on after that time, things can be out of place.  That's where the GlobalTime kicks in.  These triggers fire regardless of occupancy.  That's my understanding, at least.  Also, on TBA, triggers affect lower Imm levels while on 4D, they don't.

Kvetch and I have been trying to troubleshoot a time trigger that was on various rooms.  Before I looked at it, she reported that it worked with some rooms but not others.  I could not find any problems with the trigger except that it stopped working on any rooms.  I ran through my gamut of tests, took it all apart, put it back together exactly the same way, and it worked on all rooms.  The next time I checked it, it was again not working on any rooms.  I found that when I logged in a test character, it started working on all rooms again.  Kvetch found that without a test character, some rooms would work and some wouldn't but apparently only when I wasn't logged in.  We've tried both Time and GlobalTime with the same outcome.  She's got the same sort of trigger working in a different zone which fires consistently.

Right now, one room is triggering while the rest aren't.  Any ideas of what might cause this sort of behavior?  The triggers are all properly attached and run if my test character is on.  Without a test character, one or no rooms trigger.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 728
    • View Profile
    • Email
Re: GlobalTime triggers
« Reply #1 on: August 26, 2014, 07:25:47 am »
Parn and I keep going between GlobalTime and Time - both of which seem to work just fine in the Dragon Master zone with only imm's in the zone - we tested that last night too to make sure.  But this one seems to think it doesn't have to work.  And if the ghosts don't load when they should without anyone in the zone then players may end up spending a lot of time in what looks to be a dead zone because there are no mobs.  All of these mobs should load up in the rooms they belong in at 11pm - whether or not someone is in the zone.  After Parn left yesterday it worked fine twice (with only me on the port) so I took out the zecho's she had to know if each room fired and sent a note in the game port that it was working right and what to check for if something like this happened to other builders.  When I came back from a much needed nap, it wasn't working again unless Parn had her test mortal on.  So, can someone help figure out the problem because it's not going to go into the game port unless it's working right which will suck for Halloween.

Name: 'Load Night Mobs',  VNum: [27587], RNum: [ 1696]
Trigger Intended Assignment: Rooms
Trigger Type: Time, Numeric Arg: 6, Arg list: None
Commands:
if %self.vnum% == 27505
  %load% mob 27521
elseif %self.vnum% == 27542
  %load% mob 27515
  %force% couple north
  %load% mob 27515
  %force% couple east
  %load% mob 27515
  %load% mob 27515
elseif %self.vnum% == 27544
  %load% mob 27528
  %load% mob 27520
  %load% mob 27520
  %load% mob 27520
elseif %self.vnum% == 27550
  %load% mob 27520
elseif %self.vnum% == 27552
  %load% mob 27504
  %load% mob 27504
  %load% mob 27504
elseif %self.vnum% == 27553
  %load% mob 27516
elseif %self.vnum% == 27555
  %load% mob 27527
end

One last note.  Parn did take out the elseif's and put ends in front of each if statement to see if that would help.  It did not.

Offline Parnassus

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: GlobalTime triggers
« Reply #2 on: August 26, 2014, 10:20:26 am »
We've now verified that either time or globaltime will only work if a mort is in the zone, except for room 27553 (mob 27516) which triggers consistently whether or not a mort is logged in to the build port.  I wondered if it might be the mobs but the message I input checks only for the room, not for if the mob loaded or not.  It seems that the room may not know its vnum if no mort is present.

My understanding is that globaltime is to prevent this situation.  In the other zone, the triggers are working with a time trigger (as opposed to a globaltime trigger) even if no mort is present.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 728
    • View Profile
    • Email
Re: GlobalTime triggers
« Reply #3 on: August 26, 2014, 12:20:46 pm »
Update: I did a copyover of the build port (yesterday I had also done a copyover and crash so it's not like the port had been up a really long time when we were trying it today), and the script is now working fine - for the time being.  WE'll see if it still works when Parn gets back on later tonight.

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 728
    • View Profile
    • Email
Re: GlobalTime triggers
« Reply #4 on: August 26, 2014, 03:38:33 pm »
Seems we're finding even more weirdness because of this script.  As far as I can tell, the build port doesn't advance time when someone's not logged into it.  I've never checked before so don't know if it's a new thing.  Now when I log out, it seems to be the same time when I log back in.  I thought maybe I had just not waited long enough (after all 72 seconds may not be a long time, but when you're waiting for something it can take forever), so I made sure to time myself on another program for 3 minutes (didn't want the whole 24 hours to go around for the same reason) and logged back in.  should have been at least 2 hours later, but it was the same time as when I logged out.

Offline erwin

  • Sr. Member
  • ****
  • Posts: 314
    • View Profile
Re: GlobalTime triggers
« Reply #5 on: August 26, 2014, 10:45:58 pm »
I wonder if it's the same case for the game port when no one is logged in (does time pass)?

Offline Kvetch

  • Administrator
  • Hero Member
  • *****
  • Posts: 728
    • View Profile
    • Email
Re: GlobalTime triggers
« Reply #6 on: August 27, 2014, 06:24:13 am »
It seems the time not passing thing is a way to save cpu or some such - so that part is meant to happen.  It probably does happen on the game port, but there is rarely no-one on.  If nothing else, Shorty's usually invis and hanging out.  Once I did a copyover yesterday the script seemed to work fine and there wasn't any way *I* was able to break it.  But it brings up the question on why it broke before (so quickly after a copyover) and how often will it break?  Rynald, trying about the same thing on his home port, had it break, did a copyover and it worked.  It seems the answer to "It broke" is copyover, but if it's just going to keep breaking that's not a good answer.  I've not checked in with Parnassus today to see if she managed to break it after I left yesterday, so we'll see later.

Offline Parnassus

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: GlobalTime triggers
« Reply #7 on: August 28, 2014, 03:25:30 pm »
It's not broken yet :)  Date shows that the port has been up 2 days, 3 hours.