Jump to content

Manipulating Time.


nikki.

Recommended Posts

I have a problem. The plot of my scenario (which is coming on well btw) demands that the game is dark. Basically, the sun has been shrouded so that the baddie can get his minions up onto the surface.

 

Now, in order to achieve this, I used:

 

set_ticks_forward(-1)

 

as is done in Babysitting. This worked, in that it was always evening. However, I soon found a problem.

 

Should the player use a special ability, they would never be able to use it again. This was bad, but workable. I could say that the evil magic blocking the sun stops their skills recharging.

 

Then, though, another problem emerged. My scenario needed the party to have a special item to finish it. Since this item was only obtainable after baddies attacked a fort ON DAY 3, it couldn't be finished. Oops.

 

So, using a timer in the scenario Start_state, I tried to get a variable to count up to 5000, where it would set_ticks_forward(5000) (a day), and reset the timer. At first, the thing skipped a day each turn, and then nothing at all.

 

I've also tried using two SDFs to act as a counter, setting the clock forward after both equalled a certain number. No luck.

 

It's vital that the action takes place in the dark, so any ideas? If not, I'll have to scrap the thing, something I'm not overly keen about.

Link to comment
Share on other sites

Er, dark in the sense of night dark, not dark in the sense of making town dark so you need to cast the Light spell in order to see more than a square away dark.

 

It's annoying that we can't mess with outdoor terrain details nearly as much as we can with town details. I hadn't noticed that (because I've hardly touched outdoor terrains yet).

Link to comment
Share on other sites

I was thinking you could use flags as digits in a base-256 system (ie increment a flag until it got to 255, then increment the other flag by one and reset the first flag to 0), which would get you something like 64 million ticks with two flags. How *i came up with 3125, I don't know, though.

 

EDIT: Ach, too many zeros. Keep's right: 2^16 is about 64 thousand, not million.

Link to comment
Share on other sites

Quote:
Originally written by Garrison:
The outdoors are very rigid compared to Towns, I'm afraid.

What you are proposing seems like a good idea, but there is probably some error in your implementation. You should also realize the problem this would cause with monsters scripts before you get too wrapped up in this.
Errr... problems with monster scripts? What do you mean?

And I tried the SDF trick, but no luck. Does
(set_ticks_forward(-1))
cease all ticks, effectively stopping the timer?

The way I implemented the sdf counter was to use (inc_flag(0,1,1))
in the scenario files start_state. Then, I stuck in a
if(get_flag(0,1) == 255)
{ inc_flag(0,2,1);
}

Finally, I used a
(if(get_flag(0,1) == 1) && if(get_flag(0,2) == 250) {

set_ticks_forward(5000) (i.e. a day).

But no cigar.

I'd love to post the script, but it's not on this computer, so I can't. If all else fails though, it looks like I'll have to adapt the plot so the darkness is more like that in LotR: The Return of the King film, in that day exists, it's just slightly darker. It's all I can do.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...