Saisons effects on maps

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Saisons effects on maps

Post by hermestrismi »

beetlenaut wrote: March 10th, 2023, 9:14 pm I don't see any obvious problems with this. Does it work the way you want now?
So, I know it is difficult but do you (or anyone) know a way to reveal the complete schedule of a scenario in prestart (or at least before the turn one refresh)?
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Saisons effects on maps

Post by beetlenaut »

If you mean how to show the schedule, the normal place for that would be in an [objectives] note. You could also show it in the story text if you want it to appear before the map is revealed. If you did it in the story, you would also be able to show it as a set of ToD images instead of using mostly text.

If you also mean how to store the schedule, it is more complicated. You can do it by using [store_time_of_day] though. It allows you to select a turn to store, so you could store a series of turns with [while] and a counter until the turns ended or the list of times started to repeat. You would end up with an array of ToD containers with ids, names, bonuses and more. You could print a list of the ToD names in the same loop or in a separate [foreach] loop.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Saisons effects on maps

Post by hermestrismi »

Hi, I think I didn't explain the problem properly.
What I am looking for is a way to capture the information about the original setting of the schedule before the beginning of the scenario or at least to acquire the information about the original setting before turn 1.
I mean something like [store_time_of_day] (since this command doesn't do that).
For the player, I already set a message to inform about the beginning and the end of each season.
Why I need to capture the original setting? Bcz I want to modify the cycle of seasons to be parallel with the duration of day. For example, if the scenario is meant to be after the fall (two sun schedule) the player will have two morning winter and three mornings in summer. If the scenario is originally Underground, the loop of seasons will not be activated...
As I saw, their is no way to the game to acquire this information. At least not before turn one refreshing
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Saisons effects on maps

Post by hermestrismi »

beetlenaut wrote: March 11th, 2023, 7:33 pm If you mean how to show the schedule, the normal place for that would be in an [objectives] note. You could also show it in the story text if you want it to appear before the map is revealed. If you did it in the story, you would also be able to show it as a set of ToD images instead of using mostly text.

If you also mean how to store the schedule, it is more complicated. You can do it by using [store_time_of_day] though. It allows you to select a turn to store, so you could store a series of turns with [while] and a counter until the turns ended or the list of times started to repeat. You would end up with an array of ToD containers with ids, names, bonuses and more. You could print a list of the ToD names in the same loop or in a separate [foreach] loop.
I already did that but this is not what I was looking for
User avatar
beetlenaut
Developer
Posts: 2825
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Saisons effects on maps

Post by beetlenaut »

hermestrismi wrote: March 12th, 2023, 2:50 am What I am looking for is a way to capture the information about the original setting of the schedule before the beginning of the scenario or at least to acquire the information about the original setting before turn 1.
The message generated by this code shows the whole schedule before the map even loads. It uses [store_time_of_day] pretty much how I described (although I decided to use a [for] loop instead of a [while] loop to make it shorter). This code could save other data like which turn has an id of "dawn," or if there is a "short_dark", and the stored tod could be appended to an array like I mentioned before.

Code: Select all

[event]
    name=prestart
    [store_turns]
        variable=number_of_turns
    [/store_turns]
    [for]
        # The default variable name is "i".
        start=1
        end=$number_of_turns
        [do]
            [store_time_of_day]
                variable=tod
                turn=$i
            [/store_time_of_day]
            
            # If this id is not already in the list, add it to the list.
            [if]
                [not]
                    [variable]
                        name=tod_id_list
                        contains=$tod.id
                    [/variable]
                [/not]
                [then]
                    [set_variable]
                        name=tod_id_list
                        value=$tod_id_list + "/" + $tod.id
                    [/set_variable]
                [/then]
            [/if]
        [/do]
    [/for]
    [message]
        speaker=narrator
        message= _ "Schedule: " + $tod_id_list
    [/message]
    [clear_variable]
        name=tod, tod_id_list
    [/clear_variable]
[/event]
hermestrismi wrote: March 12th, 2023, 2:51 am I already did that but this is not what I was looking for
Is this really what you did? If so, what is still missing?
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
hermestrismi
Posts: 626
Joined: February 6th, 2016, 11:28 pm
Location: Tunisia
Contact:

Re: Saisons effects on maps

Post by hermestrismi »

beetlenaut wrote: March 12th, 2023, 6:45 am
hermestrismi wrote: March 12th, 2023, 2:50 am What I am looking for is a way to capture the information about the original setting of the schedule before the beginning of the scenario or at least to acquire the information about the original setting before turn 1.
The message generated by this code shows the whole schedule before the map even loads. It uses [store_time_of_day] pretty much how I described (although I decided to use a [for] loop instead of a [while] loop to make it shorter). This code could save other data like which turn has an id of "dawn," or if there is a "short_dark", and the stored tod could be appended to an array like I mentioned before.

Code: Select all

[event]
    name=prestart
    [store_turns]
        variable=number_of_turns
    [/store_turns]
    [for]
        # The default variable name is "i".
        start=1
        end=$number_of_turns
        [do]
            [store_time_of_day]
                variable=tod
                turn=$i
            [/store_time_of_day]
            
            # If this id is not already in the list, add it to the list.
            [if]
                [not]
                    [variable]
                        name=tod_id_list
                        contains=$tod.id
                    [/variable]
                [/not]
                [then]
                    [set_variable]
                        name=tod_id_list
                        value=$tod_id_list + "/" + $tod.id
                    [/set_variable]
                [/then]
            [/if]
        [/do]
    [/for]
    [message]
        speaker=narrator
        message= _ "Schedule: " + $tod_id_list
    [/message]
    [clear_variable]
        name=tod, tod_id_list
    [/clear_variable]
[/event]
hermestrismi wrote: March 12th, 2023, 2:51 am I already did that but this is not what I was looking for
yuup. This is exactly what I wanted . I didn't consider using

Code: Select all

contains=
which was a brilliant solution
Is this really what you did? If so, what is still missing?
this part is what was missing
Post Reply