Page 2 of 2
Re: Western Light Time Progs
Posted: Sat Apr 19, 2008 12:28 pm
by Dalvyn
The thing is, I'm not just trying to have this specific bug fixed, but, more importantly, to have a consistent/coherent system - and I think that Mask would agree with me on that point.
Reordering all the time_prog x~ (with no minutes) at the end might work, but even if it worked, that would not be a satisfying solution, because this ordering does not really make sense. Compare with, for example, the ordering of bribe_progs which does make sense: even at the area code level, you can imagine that the different bribe_progs are checked in the order they are given and thus that they should be ordered from the largest amount down to the smallest amount. Here, ordering all the time_prog x~ with no minutes at the end just does not make sense at the area code level, and thus, shouldn't be required by the hard code.
Similarly, having to treat programs that should trigger at H:00 differently than those that should trigger at H:mm is not consistent. Even if turning all the time_prog x 0~ into time_prog x~ would work, it would not be very satisfying (not only because it would not be consistent, but also because it would mean that we no longer have any opportunity to randomize a time_prog over one hour.
Now, don't take those comments negatively. I really appreciate your inputs and suggestions, I'm just trying to put things into perspective here: the most important part is not to have a specific bug fixed, but rather to have it fixed in a "good way".
Re: Western Light Time Progs
Posted: Sun Apr 20, 2008 11:44 am
by Raona
As I understand our Code Council helper roles, our job is to clearly delineate for Mask what is hoped-for...so let me take a try at it:
1) time_prog x ~ triggers randomly at any time during that hour
2) time_prog x 0~ (and time_prog x 00~?) trigger on the hour
3) time_prog x mm (and time_prog x m~?) trigger at the specified time, any mm is allowed (time_prog 5 06, time_prog 5 6?)
4) time_prog 's can come in any order and still operate correctly (?)
5) What about time_prog y~ and time_prog y mm~ in the same code? Allowed? For example, if you wanted a wagon to arrive late, but something under an hour late, should
time_prog 5 00~
Blinkie says "Where the devil is that caravan?!? It's supposed to be here right now!"
time_prog 5~
The caravan rumbles into the station, the driver offering an apologetic look to Blinkie.
work properly, and be allowed code, if it would make the hard coding much more complicated?
We also need to pin down more precisely what is not working. Japcil, any chance you can figure out what the common thread is in the time_prog's that don't work? Is it when there are more than one stacked in the same hour? (...and, how much would I need to learn in order to help with testing stuff like that?)
Re: Western Light Time Progs
Posted: Sun Apr 20, 2008 12:08 pm
by Dalvyn
Actually, time_progs used to only be of the form
time_prog h~, but Mask extended the code to allow for a second argument (the minutes), with the interpretation given above. It's not really something I made out of nowhere
It's how Mask said those things were supposed to work when he coded them.
Re: Western Light Time Progs
Posted: Sun Apr 20, 2008 12:29 pm
by Raona
Ha ha, hold up...I found another way to test the hypothesis, and I think it bears out:
Dalvyn wrote:Code: Select all
#16304
captain Orlyn Jhamluuth~
...
>time_prog 10 0~
connect east
mpat 16327 connect west
mpat 16327 mpecho {70}The Western Light leaves the docks.
mpat 5390 mpareaecho {70}The Western Light leaves the docks.
mpecho {70}The Western Light leaves the docks of Daggerford.
mpat 16355 mpecho {70}You feel the Western Light move as it leaves the docks of Daggerford.
~
>time_prog 10 30~
mpecho {70}The Western Light sets sails west along river Delimbiyr.
mpat 16355 mpecho {70}The Western Light sets sails west along river Delimbiyr.
~
>time_prog 11 0~
mpecho {70}The Western Light sails south along the Sword Coast.
mpat 16355 mpecho {70}The Western Light sails south along the Sword Coast.
~
>time_prog 11 30~
mpecho {70}The Western Light passes by the high walls of Baldur's Gate then Candlekeep.
mpat 16355 mpecho {70}The Western Light passes by the high walls of Baldur's Gate then Candlekeep.
~
>time_prog 12 0~
mpecho {70}The docks of Zazesspur can be seen in the distance.
mpat 16355 mpecho {70}The docks of Zazesspur can be seen in the distance through the port holes.
~
>time_prog 12 30~
mpecho {70}The Western Light pulls into to the Zazesspur Docks and the crew starts to load new cargo.
mpat 16355 mpecho {70}The Western Light pulls into the Zazesspur Docks.
mpat 16321 mpecho {70}The Western Light pulls into dock and the crew starts to load new cargo.
mpat 15274 mpareaecho {70}The Western Light enters the docks.
connect east 16321
mpat 16321 connect west 16354
~
>time_prog 13 30~
mpat 15274 yell In 30 minutes, the Western Light will leave for Holyhead.
~
>time_prog 14 0~
connect east
mpat 16321 connect west
mpat 16321 mpecho {70}The Western Light leaves the docks.
mpat 15274 mpareaecho {70}The Western Light leaves the docks.
mpecho {70}The Western Light leaves the docks of Zazesspur.
mpat 16355 mpecho {70}You feel the Western Light move as it leaves the docks of Zazesspur.
~
>time_prog 14 30~
mpecho {70}The Western Light sets sails north along the coast.
mpat 16355 mpecho {70}The Western Light sets sails north along the coast.
~
>time_prog 15 0~
mpecho {70}The Western Light sets sails west through the Sea of Swords.
mpat 16355 mpecho {70}The Western Light sets sails west through the Sea of Swords.
~
>time_prog 15 30~
mpecho {70}The island of Alaron can be seen in the distance.
mpat 16355 mpecho {70}The island of Alaron can be seen in the distance through the port holes.
~
...
Echoes heard from deck of the Western Light after 10am:
The Western Light leaves the docks of Daggerford.
You hear the hustle and bustle of the city
The Western Light sails south along the Sword Coast.
The docks of Zazesspur can be seen in the distance.
You hear the hustle and bustle of the city (~13:00)
The Western Light leaves the docks of Zazesspur.
The Western Light sets sails west through the Sea of Swords.
It looks to me as if only the first time_prog in each given hour actually executes.
Also, note to self: shipping and cargo area must be a sub-area of a City, hence the hustle and bustle echoes. They seem to come no matter where the ship is in its journeys.
Re: Western Light Time Progs
Posted: Sun Apr 20, 2008 2:19 pm
by Dalvyn
Good catch. That should be enough for Mask to start tracking the bug I think.
Re: Western Light Time Progs
Posted: Mon May 19, 2008 11:30 am
by Raona
Mask tracked this bug back to three different sets of code being used for Time_progs:
Mask wrote:Problem was that there were three different time prog handling functions, one for each of the possible triggers: mobs, objects or rooms. Since the room ones were the only ones that actually worked, I removed the other two implementations so that all three now use the same code.
I just confirmed that the Western Light time programs now work properly on the testport. There may be a corollary effect in that some time_progs coded from before this change may (in beginning to execute properly!) need to be tweaked, but I doubt it. Yay Mask!
Re: Western Light Time Progs
Posted: Mon May 19, 2008 12:48 pm
by Dalvyn
With the new code, do the time_progs still trigger even when there is no PC in the area ?
I remember there used to be a problem with that. For example, there was a room time_prog in Maos that added the connection at 7am (when the island rose to the surface) and closed it at 7pm (when the island sunk back down into the water). This program was on a room in Maos and it never worked, because the area was generally empty; it would only trigger when there was someone somewhere in the area at 7am or 7pm. I had to move this program to another area (Waterdeep) to have it happen.
This is an important question in this case because, even if there's nobody in the boat (i.e., nobody in the "shipping" area), the time progs should still continue to happen (i.e., connections should still open/close as the ship ICly moves from one harbour to the next and so on).
Re: Western Light Time Progs
Posted: Mon May 19, 2008 1:04 pm
by Raona
Dalvyn wrote:With the new code, do the time_progs still trigger even when there is no PC in the area ?
I remember there used to be a problem with that. For example, there was a room time_prog in Maos that added the connection at 7am (when the island rose to the surface) and closed it at 7pm (when the island sunk back down into the water). This program was on a room in Maos and it never worked, because the area was generally empty; it would only trigger when there was someone somewhere in the area at 7am or 7pm. I had to move this program to another area (Waterdeep) to have it happen.
This is an important question in this case because, even if there's nobody in the boat (i.e., nobody in the "shipping" area), the time progs should still continue to happen (i.e., connections should still open/close as the ship ICly moves from one harbour to the next and so on).
I'll check! I assume that if I wait at at a dock (well, somewhere near a dock that is not part of the "shipping" area), and ships arrive and the connections appear, everything is OK, but if they do not, the problem is that there's nobody on a ship/caravan?
Re: Western Light Time Progs
Posted: Mon May 19, 2008 1:48 pm
by Raona
Well, if I understand the concern correctly, I fear this may be a problem for *some* ships. I stood on Dock Street in Waterdeep [part of Waterdeep.are] (on the testport) and popped into the far north docks [part of shipping.are] from time to time. No ship connection was there at the times appointed for some ships, while others showed up on time even when I know I wasn't in the shipping area when the time_prog would have gone off. I'm still testing, but I think that the Wave Runner works, while the Western Light does not, unless someone is sitting on a dock waiting at the right moment. I'll follow up with more complete information when I have more time.
Is one of these ships programmed on its captain, the other on an area? (I can't MPSTAT things)
Re: Western Light Time Progs
Posted: Mon May 19, 2008 8:23 pm
by Mask
How the progs are triggered is that it iterates over all characters in the game, both mob and PC and checks if the room they are in has a time prog. So, for a room prog to trigger, it would have to have a mob (mobinvis if you like) present.
Re: Western Light Time Progs
Posted: Tue May 20, 2008 12:40 am
by Dalvyn
Those time progs are set on a mobs if I remember well ... so I guess they should always trigger (since there's always a mob in the room where that mob is ... duh).
Re: Western Light Time Progs
Posted: Tue May 20, 2008 1:50 pm
by Raona
I think everything is OK! I spot-checked the arrival of all three major ships at various times, and found them in the right place at the right time even without my stepping foot in the shipping area.
Re: Western Light Time Progs
Posted: Wed May 19, 2010 2:21 pm
by Lirith
This appears to be resolved and we've not had further bug reports so I think we can consider this done after two years.