GithubHelp home page GithubHelp logo

Comments (5)

fredrikr avatar fredrikr commented on July 17, 2024

The timers and daemons mechanism doesn't care about the turn counter.

If you want timers and daemons to run for each turn as you advance the turn counter in your sleep action, you need to run them yourself. Something like:

while(i++<50 && deadflag == GS_PLAYING) {
    turns++;
    RunTimersAndDaemons();
}

from punyinform.

hannessssss avatar hannessssss commented on July 17, 2024

While you may not consider this a bug (fair enough), don't you think it would be worth documenting at least? Timers in their basic form (start/stop syntax) are associated with turn count directly. So this behaviour is very likely to go against game author expectations.

from punyinform.

fredrikr avatar fredrikr commented on July 17, 2024

The turn counter is something you can't just change and expect the library to figure out what you mean, just like you can't move the player except for with the PlayerTo routine.

A wait or sleep command that spans several moves typically needs a bit more work anyway - if a daemon makes a person enter the room, or a gunshot is heard, you may want to give the player the chance to abort the waiting and spring to action. Also, you probably want the statusline to reflect the time or moves, even as you wait. There are extensions for Inform 6, like waittime.h, that handles these things.

To make it easier to create a WAIT command, we have now placed the code executed at the end of the turn in a routine called EndTurnSequence. This can be called by the WAIT command to run timers and daemons, each_turn, advance time/turns and update darkness. It's a public routine and we will mention it in the manual.

from punyinform.

hannessssss avatar hannessssss commented on July 17, 2024

Hm, I thnk it's fairly obvious what a game author intends if turn count is manually manipulated: all derived logic (meaning time, daemons and timers) should adapt. Don't think this is a weird expectation at all. Though if I understand correctly what you describe, this would enable to more easily adapt such behaviour in the game code, so thank you!

from punyinform.

fredrikr avatar fredrikr commented on July 17, 2024

There is now a new extension called ext_waittime.h which provides a more advanced Wait verb.

from punyinform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.