Easygoing Eyebeast Xaiya Posted August 12, 2008 Share Posted August 12, 2008 In the appendix, it has a neat section about ticks. It showed a few bits that had to do with it. ...But I don't think that is all. Is there somewhere that has all that has to do with ticks and explaining ways to use them? Looking at other scripts is kind of confusing with this. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted August 12, 2008 Share Posted August 12, 2008 How to print time, useful when writing a scenario: s = get_current_tick() % 5000; print_big_str("The time is now ",s," minutes."); The BoA day: 3,750 start of dusk 4,000 it gets darker 4,250 darker still 4,500 midnight 4,750 brighter 5,000 brighter still 5,250 daylight See my posts in this forum, or is it the Lyceum?, on timers in BoA. Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted August 13, 2008 Share Posted August 13, 2008 I'm not really sure what there is to add about ticks. I usually use variables for timers, so the only thing they're important for is the way they effect lighting. Is there anything in particular that you want to do? Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted August 13, 2008 Author Share Posted August 13, 2008 Something like what was done in HIM. I basically want to have something happen a certain time after a particular event, yet I wanted to know more about ticks than what I saw in the HIM scripts. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted August 13, 2008 Share Posted August 13, 2008 I used timers in town 21 of my port of River and Leaf. See my post in The Lyceum forum. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted August 13, 2008 Share Posted August 13, 2008 A single tick is one movement in the game, or one round of combat. So, when you move your PC one space, that is one tick. When you complete one round of combat, that is also one tick. Ticks are, as Laz said, really only useful if you want something to happen a set amount of time after a particular event, or, if you want to do something with lighting. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted August 14, 2008 Author Share Posted August 14, 2008 I know what ticks are. I'm just trying to learn how to use them well. Also, I'm not a member of the Lyceum. Thus, I don't go there. I have no idea where a single post might be. I'm sorry if I'm being so vague; it is hard to ask questions about how to do something. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted August 14, 2008 Share Posted August 14, 2008 Know what ticks are is pretty much all there is to know. They tell you what time it is, so you can use them to solve problems involving needing to know what time it is. The only other thing to be aware of is that you can also set what time it is by using set_ticks_forward(). It's handy to be aware of these tools in case you need them, but they aren't terribly interesting in and of themselves. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted August 14, 2008 Share Posted August 14, 2008 No one goes to the Lyceum, it is fast becoming a ghost - town. You should check out the Codex, the last post ever made there was my post on timers. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted August 15, 2008 Share Posted August 15, 2008 Now, Ghost Town by The Specials is an awesome song. (Insert bitching about members here.) But yeah, Iffy, you probably won't want to mess with these calls on their own. You'll only use them in conjunction with other things. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted August 15, 2008 Author Share Posted August 15, 2008 Wouldn't set_time_forward actually set the ticks forward or backward instead of actually setting it? Also, tick_difference call makes no sense. I've also been trying to say that all calls related to ticks are not in that section. I saw a call in a script that wasn't with the other calls in the tick section in the appendix. It's not like I'm trying to be dumb, but seeing that makes me confused since the appendix supposedly has all the calls. Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted August 15, 2008 Share Posted August 15, 2008 set_ticks_forward(value - get_current_tick()) will set time to value. Note that you can turn back time with a negative number, which is important here. tick_difference() is about as useless as it would appear. Great for those of us who don't know how to subtract... set_ticks_forward and get_current_tick are the important ones, and pretty much the only ones. I don't know of any tick calls not in the appendix, but if that's your question then why don't you say what the call is. You know, instead of just asking how ticks work. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted August 15, 2008 Share Posted August 15, 2008 The call "tick_difference(short time1,short time2)" could be useful if it takes algebraic values for time1 and time2. I don't know whether it does or not but normally BoA calls do. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted August 15, 2008 Author Share Posted August 15, 2008 *sigh* I have still barely scratched the surface of BoA scripts and this is simple compared to other stuff. If I had known I could manipulate calls like that (with doing a whole bunch of stuff inside the ()'s), than it might have made things easier... Good thing I'm good with Algebra... So the only drawback of setting the time yourself is that the day thing will be different. Oh well, this is for the end of the scenario. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted August 17, 2008 Share Posted August 17, 2008 Since The Lyceum seems to be a not very popular ghost town these days I will reprint my last post here: Finally, I have come up with a timer that can be used in a chain and is not affected by the length of the intervals between the various states. Previously all intervals had to be a multiple of the same number. This version is intended for intervals that are less than 256 turns. Here u is the time delay in turns and w is the state that is called when the timer runs out. As no script can have more than 20 variables, there is a distinct limit as to how many timers you can have running at the same time. If it is desired to have a timer running from the time that the party enters the town, just initialize u and w with different values. The example below is highly condensed and only includes the details of the timer, it is taken from the BoA port of the BoE scenario River and Leaf. The sequence starts when the party walks into a line of squares and triggers state 16. Incrementing flag (121,0) makes the timer work. // TOWN SCRIPT // Town 21: The Dacgban (L2) begintownscript; variables; short i,j,k,r1,t,x,y,choice; short u = 0; short w = 0; body; beginstate START_STATE; if (u == 0) end(); if ((get_flag(121,0) > 0) && (get_flag(121,0) <= u)){ inc_flag(121,0,1); set_state_continue(50); } break; // Activated by walking into a square beginstate 16; set_state_continue(19); break; beginstate 19; reset_dialog(); add_dialog_str(0,"The captain's room behind you erupts in a blast of water! Someone must have drilled through the ship's hull. The bay's fury is pouring frantically into the lower deck. Duty, it seems, has prompted this suicidal attack.",0); set_flag(121,0,1); u = 5; w = 21; break; beginstate 21; message_dialog("The ship shudders and turns, sinking rapidly. You had better make it to the top soon.",""); set_flag(121,0,1); u = 5; w = 23; break; beginstate 23; message_dialog("Blasts of water fill in from everywhere. You don't make it another two steps before being overwhelmed.",""); i = 0; while (i < 6) { if (char_ok(i)) { kill_char(i,2,0); } i = i + 1; } break; beginstate 50; (This state provides for the steady flooding of the town with water, as detailed in my post Sinking Ships.) if (get_flag(121,0) == u) set_state_continue(w); break; For intervals longer than 255 turns it is simple enough to use a number generated by (256*get_flag(121,0) + get_flag(121,1). For a multi day timer it might be simpler to use the day number: beginstate 16; if (what_day_of_scenario() < (get_flag(211,22) + 2)) message_dialog("The herb patch hasn't grown back yet.",""); else set_state_continue(18); break; beginstate 18; reset_dialog_preset_options(1); add_dialog_str(0,"You find a small patch of Energetic Herbs in the swamp.",0); choice = run_dialog(1); if (choice == 2) { if (reward_give(216)) { set_flag(211,22,what_day_of_scenario()); } } break; Quote Link to comment Share on other sites More sharing options...
Kyshakk Koan La paix Posted August 17, 2008 Share Posted August 17, 2008 Quick question about ticks: How is a tick (in general) defined? For example, in some programming languages, a tick is a unit of time equal to 1/60 sec. Others define it as a 1/20 sec, or a turn (like BoA). So, what is a tick? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted August 17, 2008 Share Posted August 17, 2008 In BoA it is defined as the unit of time taken by one step in town mode, or one round in combat mode. Each step outdoors takes 10 ticks. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Xaiya Posted August 17, 2008 Author Share Posted August 17, 2008 5 outdoors if you are on a horse. I don't know about boats though...is it 10 too? Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted August 18, 2008 Share Posted August 18, 2008 Easy to test, just have your Start State print the current time. Edit Simply insert this at the beginning of your Start State: r = get_current_tick() % 5000; print_big_str("The time is now ",r," minutes."); Boats are no faster than walking, they take ten minutes per square. Quote Link to comment Share on other sites More sharing options...
Kyshakk Koan La paix Posted August 23, 2008 Share Posted August 23, 2008 Actually, I was wondering about ticks in general. Outside of BoA. For example, what is a tick in Geneforge? Do all programs define ticks differently? In Revolution (a slightly high-level programming language), a tick is 1/60 sec. In Ares, a dying but great game, a tick is 1/20 sec. In BoA (obviously) a tick is a turn. But does a tick have one master definition, or is that up to the programmer? Quote Link to comment Share on other sites More sharing options...
Ineffable Wingbolt Dahak Posted August 23, 2008 Share Posted August 23, 2008 A tick is an arbitrary length of time with a defined beginning and end. In the case of BoA it is defined as when one turn (from the end of one turn to the end of the next turn). The relation to real time is irrelveant. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Ishad Nha Posted August 24, 2008 Share Posted August 24, 2008 In BoA time never passes unless the party moves somewhere. (Edit: time will also pass if a PC casts a spell or uses an item.) Thus there is no connection whatsoever between time in the game and time in the real world. I determined this by altering the Start State to show the current game time, using the method outlined in my post on August 17. By contrast, in real time games there may well be a definite connection between the two. Unlike "word" or "short" the word "tick" has no inherent meaning in programming. Thus its meaning is always purely subjective. Quote Link to comment Share on other sites More sharing options...
Well-Actually War Trall Niemand Posted August 24, 2008 Share Posted August 24, 2008 Um, 'word' and 'short' are architecture dependent, in addition to being utterly irrelevant to this discussion. I think we have amply established that a tick is exactly what Jeff says it is in the documentation. Quote Link to comment Share on other sites More sharing options...
Easygoing Eyebeast Thralni Posted August 24, 2008 Share Posted August 24, 2008 Iffy, what exactly is it you want? I see you quoted HIM scripts, and you say you want something like in HIM. Do you mean the earthquakes? If you want, you can send me a PM and I can tell you what is happening in the scripts of HIM. I think that probably, if you understand better what is going on in these scripts, you'll also better understand the working of ticks. Quote Link to comment Share on other sites More sharing options...
Hatchling Cockatrice Lilith Posted August 27, 2008 Share Posted August 27, 2008 edit: oh hey this topic has a second page Anyway, yeah, what the other people said. A tick is the shortest measurable unit of game time. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.