![]() |
|
|
#1 |
|
Blue Meanie
Join Date: Apr 2005
Location: Portland, Oregon
Posts: 1,959
|
The game.time Method and Making Reliable Timed Events
This thread is for comments, questions and discussion of this post on the game.time method and this post on making reliable timed events.
__________________
"No. The only thing that lasts forever is apathy. But who cares." Last edited by Cerulean the Blue; December 28th, 2006 at 02:25 PM. |
|
|
|
|
|
#2 |
|
Master Crafter
Join Date: Dec 2004
Location: U.K.
Posts: 3,300
|
Re: The game.time Method and Making Reliable Timed Events
Cool stuff there Blue, that woodcutter's time event has never triggered propperly for me, I'm glad you got it figured out. Good work guys.
![]()
__________________
"I don't want it back. You can never get rid of the smell, you know. Besides, that dagger was Flint's!" - Tasslehoff Burrfoot.
|
|
|
|
|
|
#3 |
|
Goblin Raider
Join Date: Dec 2006
Posts: 13
|
Re: The game.time Method and Making Reliable Timed Events
Blue, do you think it´s possible to unify the various time feedbacks? I mean, in the main GUI it tells you the time elapsed since you started, and it´s like that in the rumors tab, but in the quest tab they are by day of the month and it´s kinda confusing having day 1 in one and day 15 in the other.
Thanks! |
|
|
|
|
|
#4 |
|
Blue Meanie
Join Date: Apr 2005
Location: Portland, Oregon
Posts: 1,959
|
Re: The game.time Method and Making Reliable Timed Events
The dates and times in the GUI and the logbook are functions of the game engine, i.e. it would take a major dll hack to change them. So no, that is not going to happen.
I've added modified versions of Tillahi's and Sargen's scripts to the Timed Event post. If I could get people to test these out it would be really helpful. ![]()
__________________
"No. The only thing that lasts forever is apathy. But who cares." Last edited by Cerulean the Blue; December 28th, 2006 at 03:37 PM. |
|
|
|
|
|
#5 |
|
Gophers, consarn it!
Join Date: Oct 2004
Location: Sydney
Posts: 9,553
|
Re: The game.time Method and Making Reliable Timed Events
Good work Blue
I was going to use nested time thingy's like this for KotB, good to see someone making it easy to do.
__________________
My blog! http://rpg-rant.blogspot.com/ My webcomic! http://rpg-rant.blogspot.com/2007/08/kecik-1.html
|
|
|
|
|
|
#6 |
|
Demon Lord
Join Date: Sep 2003
Location: Israel
Posts: 598
|
Re: The game.time Method and Making Reliable Timed Events
Nifty
I've been waiting for this. I'll test as soon as I can (which could be a while, unfortunately). |
|
|
|
|
|
#7 |
|
Blue Meanie
Join Date: Apr 2005
Location: Portland, Oregon
Posts: 1,959
|
Re: The game.time Method and Making Reliable Timed Events
I've Incorporated my Long Interval Timed Event code into an importable module so that it can be used with a call much similar to that of game.timevent_add.
The following is from the documentation included in TimedEvent.py. Code:
LONG DURATION TIMED EVENT METHOD by Cerulean the Blue You must put these in the global namespace of your function: import _include from co8Util.TimedEvent import * Furthermore "import _include" (without quotes) must be included in the namespace of utilities.py for the method to function across saves and loads. Without this the game will not be able to import co8Util.TimedEvent at startup and the save will be deemed corrupt. Call form: timedEventAdd(<function name>, (<arguments>), <interval>, stopFlags=[<stopFlags>], stopVars=[<stopVars>], stopQuests=[<stopQuests>]) <function name> - Name of the function you want executed after the interval. The function must be in the same module as the call, or imported to the module. <arguments> - The arguments you want passed to the function separated by comas, i.e. "attachee, triggerer". <interval> - An int specifying the delay, in hours, till you want the function to execute. <stopFlags> - OPTIONAL - The flag numbers of global flags that should stop the function from executing separated by comas. If having the flag set should cause the stop just list the flag number. If not having the flag set should cause the stop, put the flag number and 0 separated by a coma in parenthesis, i.e. (85,0). Any number of stop flags can be passed. Example: [58, (51,0)] <stopVars> - OPTIONAL - Like stopFlags, but for global variables. Put each number of the global variable and the value that should cause the stop, separated by a coma,in parenthesis. Any number of variables can be listed. Example: [(21, 4), (36, 10)] <stopQuests> - OPTIONAL - Like stopFlags, but for quests. Put each quest number and the quest state that should cause the stop, separated by a coma, in parenthesis. Any number of quests can be listed. Example: [(21, qs_accepted), (101, qs_completed), (34, qs_botched)] Sample Calls: 2 arguments, 10 hour delay, no stops: timedEventAdd(spawn, (attachee, triggerer), 10) No arguments, 100 hour delay, flag stops: timedEventAdd(spawn, (), 100, stopFlags=[58, (51,0)]) No arguments, 34 hour delay, variable stops: timedEventAdd(spawn, (), 34, stopVars=[(21,4)]) 3 arguments, 56 hour delay, flag and quest stops: timedEventAdd(give_reward, (x,y,z), 56, stopFlags=[82, 132], stopQuests=[(22, qs_completed)]) Logging has been left in to facilitate debugging. The log, named LOG_co8Util.TimedEvent.log, will be in the modules folder of the module being run. I recommend using timedEventAdd for delays of more than 24 hours. Use timevent_add for delays of 24 hours or less, unless you absolutely need the added functionality. Attached is TimeEvent.py, utilities.py, and a sample script to demonstrate the method. TimeEvent.py should go into the data\scr\co8Util folder. The other two go into the data\scr folder. The sample script also has some documentation of the method included inside it.
__________________
"No. The only thing that lasts forever is apathy. But who cares." Last edited by Cerulean the Blue; January 1st, 2007 at 08:44 PM. |
|
|
|
|
|
#8 |
|
Blue Meanie
Join Date: Apr 2005
Location: Portland, Oregon
Posts: 1,959
|
Re: The game.time Method and Making Reliable Timed Events
The Woodcutter's, Thrommel's, Tillahi's, and Sargen's scripts altered to use the method posted above. These go in the data\scr folder.
__________________
"No. The only thing that lasts forever is apathy. But who cares." |
|
|
|
|
|
#9 |
|
Mindflayer
Join Date: Apr 2005
Posts: 1,754
|
Re: The game.time Method and Making Reliable Timed Events
Can I confirm whether or not the files listed above were added to the CMF?
|
|
|
|
|
|
#10 |
|
Master Crafter
Join Date: Dec 2004
Location: U.K.
Posts: 3,300
|
Re: The game.time Method and Making Reliable Timed Events
Yes Zebedee, of course you can.
![]() Actually it is in the latest CMF patch (version 5.0.4 composed by yours truely) if you don't believe me it says so here. ![]()
__________________
"I don't want it back. You can never get rid of the smell, you know. Besides, that dagger was Flint's!" - Tasslehoff Burrfoot.
|
|
|
|
|
|
#11 |
|
Mindflayer
Join Date: Apr 2005
Posts: 1,754
|
Re: The game.time Method and Making Reliable Timed Events
Always good to make sure there are no misunderstandings and people getting the wrong files in the wrong order. |
|
|
|