Jump to content

Recommended Posts

I was trying to do some modding with world generation, but I can't get a handle on the very basics. I did some pretty simple (in my opinion at least) modding with prefabs and components, and this seems much more complex.

First of all, I tried to create a world with a very narrow taskset, which includes only one task, moreover, already existing task, "Make a pick", and I am already stuck. This is my primitive code:

AddTaskSet("mytaskset", {
  name = "mytaskset",
  location = "forest",
  tasks = { "Make a pick", },
  valid_start_tasks = {
    "Make a pick",
    },
  })

AddLevel(LEVELTYPE.SURVIVAL, {
  id = "helloworldgen",
  name = "firsttest",
  desk = "stuff",
  location = "forest",
  overrides = { task_set = "mytaskset" }
  })

And this is what crash says:

[00:00:33]: DoLuaFile Error: #[string "scripts/map/tasks/forest.lua"]:65: bad argument #1 to 'random' (number expected, got nil)
#LUA ERROR stack traceback:
@=[C]:-1 in (field) random (C) <-1--1>
@scripts/map/tasks/forest.lua:65 in (local) count (Lua) <65-65>
@scripts/map/storygen.lua:932 in (method) GenerateNodesFromTask (Lua) <899-1014>

 

I do realize, that this line of questions may as well be very stupid, but If someone could point me in a right direction, I would be very appreciative. Also, I found very little information on the subject, next to nil, so my humble guess is that a brief guide into basics would be useful not only to me.

Apologies for any mistakes I may have made due to my poor English, it's not my mother tongue.

Link to comment
https://forums.kleientertainment.com/forums/topic/73648-help-with-worldgen/
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
×
  • Create New...