Sign in to follow this  

AddTaskPreInit does not affect optionaltasks, intended?


Serpens
  • Pending

Is it intended that "AddTaskPreInit" does not affect optionaltasks See "level.lua" the function "ChooseTasks", there "ApplyModsToTasks" is executed before the optional tasks are added.

If this is intended, what would be a proper way to mod also the optional tasks?


Steps to Reproduce

see level.lua ChooseTasks function

  • Big Ups 1
Sign in to follow this  


User Feedback


....

I'm using now:

local tasksfile = require("map/tasks")
AddLevelPreInitAny(function(tasksetdata)
    thetasks = _G.ArrayUnion(tasksetdata.tasks,tasksetdata.optionaltasks)
    for i,name in ipairs(thetasks) do
        task = tasksfile.GetTaskByName(name)
        if task~=nil then
            -- mod the task ...
        end
    end
end) 

is that okay ?
hm, no that is no solution if we need to know the actual chosen_tasks...

The level.lua also has "GetTasksForLevel", but where can we call this before the world is generated?
Or I could "hack" into the ChooseTasks function...

Edited by Serpens

Share this comment


Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now