smooth-landing

Jump to content

  • Log In with Google Log In with Steam      Sign In   
  • Create Account

Photo
* * * * * 2 votes

Aug 20Th Update Modding Discussion / Workshop Beta


  • Please log in to reply
65 replies to this topic

#1 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 13 August 2013 - 03:30 PM

There are two big updates to mods this release: Steam Workshop support, and filling out the modding API.


Workshop Support

Modders will be able to upload their mods to Steam Workshop using our custom tool, and then other players can get the mod installed with one click! Instructions for getting the tool are available in this post!

API Additions and Improvements

The API version has been updated to 3! Please test your mods with the preview. When you mod has been updated to work with this version (or if it already works!), then set api_version = 3 in your modinfo.

The Modding API has a bunch of new additions. You can check out the API Examples mod for documentation and examples, but here are the new functions:
 


    [*]AddLevel
    [*]AddLevelPreInit
    [*]AddLevelPreInitAny
    [*]AddTask
    [*]AddTaskPreInit
    [*]AddRoom
    [*]AddRoomPreInit
    [*]AddRecipe (for crafting recipes)
    [*]Ingredient (for crafting recipes)
    [*]AddIngredientValues (for cookpot recipes)
    [*]AddCookerRecipe (for cookpot recipes)
    [*]AddAction
    [*]AddStategraphActionHandler
    [*]AddStategraphState
    [*]AddStategraphEvent
    [*]AddStategraphPostInit
    [*]AddBrainPostInit
    [*]AddClassPostConstruct (for widgets, and other things)
    [*]AddGlobalClassPostConstruct
    [/list]

    PostInit function can now "stack" so you can call, for example, AddSimPostInit multiple times and each function given will run when the sim starts.

    SampleCharacter mod shows the correct place to add the character name string so that the throne works correctly. Also, can now specify the gender of your character so that the pronouns in the end-game sequence are correct.

    A number of engine-level error messages have been improved to help with debugging.

    The Sample Character mod has moved its Strings assignments and has a few small additions which allow it to work with Maxwell's Throne.


    Engine Changes to be aware of

    Widgets have been rearranged and changed. Any widgets that you use will have to have their "require" path updated to the widgets folder, and the class are no longer global so they must be stored to a local. So this:
     


      [*]require("image")
      [/list]

      becomes this:
       


        [*]local Image = require("widgets/image")
        [/list]

        Input behaviour has changed a lot in anticipation of controller support. There are two major things to look out for:
         


          [*]There are no longer "mouse" events. Now everything happens through the OnControl handler on widgets. All our widgets have been updated for this new form, please look there for examples which match your needs or ask for help if you have a specific problem.
          [*]Focus control is much more automatic and you shouldn't have to worry about it for now.
          [/list]

          Edited by Ipsquiggle, 14 August 2013 - 01:46 PM.


#2 Neosaurus

    Neosaurus
  • Maxcell



  • 712 posts

Posted 14 August 2013 - 02:46 AM

Great! Workshop is a great addition, looking forward to the ruins :-) EDIT: AddLevel? So we can make custom cave levels? :o


Edited by Neosaurus, 14 August 2013 - 02:47 AM.

Hello! I'm Neosaurus! I'm here to help, they even (didn't) give me a name badge to remind me of who I am, which is very nice as that does tend to happen...

 

Avatar by the incredible F3RR1S!

 

 

 

 

 


#3 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 14 August 2013 - 07:35 AM

Great! Workshop is a great addition, looking forward to the ruins :-) EDIT: AddLevel? So we can make custom cave levels? :o

 

 

At the very least you can customize the cave levels that are generated. :) That's a good idea though, I'll have a look at what's involved in "adding" either custom caves or a variety to the generation for modders.



#4 Heavenfall

    Heavenfall
  • Senior Member



  • 1114 posts

Posted 14 August 2013 - 08:06 AM

Opening console now shows log.txt - great. How do I get rid of it? Ctrl-L doesn't hide it.


Please quote my post or include @Heavenfall in your post if you are replying to me, it helps me see your reply.
 
My mods

#5 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 14 August 2013 - 08:14 AM

Opening console now shows log.txt - great. How do I get rid of it? Ctrl-L doesn't hide it.

 

There is a keybind for it now, second last option on the Controls page. I've noticed that sometimes bindings won't get updated, you may just want to hit "reset" on the controls page to rebind all the defaults.



#6 tehMug

    tehMug
  • Only an Alt

  • 90 posts

Posted 14 August 2013 - 08:32 AM

No more mouse events... there goes Test Tools again...


Alt of the handsome tehMugwump :whistle:


#7 Heavenfall

    Heavenfall
  • Senior Member



  • 1114 posts

Posted 14 August 2013 - 08:33 AM

I have a recipe with a placer, but the graphics for the placer do not appear unless the animation has already been loaded for an existing, placed prefab nearby the player. Suggestions? Try building the Chaotic Wormhole in this mod https://dl.dropboxus.../HF_Summons.rar without a wormhole nearby your start and you'll see what I mean.

 

Edit: I am also having another issue that maybe you can take a look at (new in 20th aug preview). I have an action handler that makes it so you can right-click these summons to make them stay in one place instead of following you. This is handled through a switch where the player gets the option to either "order to stay" or "order to follow" depending on its current state. This used to work, but now when I right-click the summons once both states gets flipped immediately (as if I clicked twice). If I click and hold on the summon it works as it should. Any idea why this "double click" is happening?

 

Overview of the code:

Spoiler

Edited by Heavenfall, 14 August 2013 - 08:39 AM.

Please quote my post or include @Heavenfall in your post if you are replying to me, it helps me see your reply.
 
My mods

#8 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 14 August 2013 - 11:25 AM

I've posted an updated API Examples mod! Sorry for the delay. But that should provide you with some fun... :)



#9 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 14 August 2013 - 11:33 AM

@Heavenfall I'll have a look at this later today. Nothing immediately comes to mind that would be causing these...



#10 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 14 August 2013 - 01:06 PM

I have a recipe with a placer, but the graphics for the placer do not appear unless the animation has already been loaded for an existing, placed prefab nearby the player. Suggestions? Try building the Chaotic Wormhole in this mod https://dl.dropboxus.../HF_Summons.rar without a wormhole nearby your start and you'll see what I mean.

 

Edit: I am also having another issue that maybe you can take a look at (new in 20th aug preview). I have an action handler that makes it so you can right-click these summons to make them stay in one place instead of following you. This is handled through a switch where the player gets the option to either "order to stay" or "order to follow" depending on its current state. This used to work, but now when I right-click the summons once both states gets flipped immediately (as if I clicked twice). If I click and hold on the summon it works as it should. Any idea why this "double click" is happening

 

The issue with the placers: The recipes are being registered too late so their assets aren't being force-loaded. Move all your recipe definitions out of GamePostInit into the global scope of modmain.

 

The issue with the "stay" command: This is a bug, apparently right now it's trying to perform actions both on click-down and click-up. I'll get in a fix for this.



#11 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 14 August 2013 - 01:45 PM

We've opened up Workshop Beta Testing! See this thread for details!



#12 _Q_

    _Q_
  • Dark Power



  • 2150 posts

Posted 15 August 2013 - 01:20 AM

I still need to overwrite forest_map.lua to add new values to TRANSLATE_TO_PREFABS and MULTIPLY tables.

 

And did you look into prefab distribution?

It is like if count of prefab is below 1 it is not distributed at all even if its not set to never.


Edited by _Q_, 15 August 2013 - 01:39 AM.

Just one more fight about a lot of things
And I will give up everything
To be on my own again, free again
Yeah, this time I'ma let it all come out
This time I'ma stand up and shout
I'ma do things my way
It's my way, my way or the highway


#13 Heavenfall

    Heavenfall
  • Senior Member



  • 1114 posts

Posted 15 August 2013 - 02:11 AM

The issue with the placers: The recipes are being registered too late so their assets aren't being force-loaded. Move all your recipe definitions out of GamePostInit into the global scope of modmain.

 

The issue with the "stay" command: This is a bug, apparently right now it's trying to perform actions both on click-down and click-up. I'll get in a fix for this.

 

Thank you so much for looking into this.


Please quote my post or include @Heavenfall in your post if you are replying to me, it helps me see your reply.
 
My mods

#14 tehMug

    tehMug
  • Only an Alt

  • 90 posts

Posted 15 August 2013 - 03:42 AM

Can you stick this for the next week so we can find it again?


Alt of the handsome tehMugwump :whistle:


#15 _Q_

    _Q_
  • Dark Power



  • 2150 posts

Posted 15 August 2013 - 01:52 PM

[font="arial;font-size:12pt;font-weight:bold;color:#FF0000;"]@Ipsquiggle[/font]

Modders can now modify the TRANSLATE_TO_PREFABS and MULTIPLY worldgen tables.

How to use that thing?

I would be able to upload it to steam workshop after removing forest_map,lua form mod folder, workshop app for mods is up now.


Just one more fight about a lot of things
And I will give up everything
To be on my own again, free again
Yeah, this time I'ma let it all come out
This time I'ma stand up and shout
I'ma do things my way
It's my way, my way or the highway


#16 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 15 August 2013 - 02:07 PM

[font="arial;font-size:12pt;font-weight:bold;color:#FF0000;"]@Ipsquiggle[/font]

Modders can now modify the TRANSLATE_TO_PREFABS and MULTIPLY worldgen tables.

How to use that thing?

I would be able to upload it to steam workshop after removing forest_map,lua form mod folder, workshop app for mods is up now.

 

 local TRANSLATE_TO_PREFABS = GLOBAL.require("map/forest_map").TRANSLATE_TO_PREFABSlocal MULTIPLY = GLOBAL.require("map/forest_map").MULTIPLY

Will that work for you?


Edited by Ipsquiggle, 15 August 2013 - 02:32 PM.
typo in my code, removing for future reference


#17 _Q_

    _Q_
  • Dark Power



  • 2150 posts

Posted 15 August 2013 - 02:09 PM

 local TRANSLATE_TO_PREFABS = GLOBAL.require("map/forest_map.lua").TRANSLATE_TO_PREFABSlocal MULTIPLY = GLOBAL.require("map/forest_map.lua").MULTIPLY

Will that work for you?

 

Thanks, will try that now.

 local TRANSLATE_TO_PREFABS = GLOBAL.require("map/forest_map").TRANSLATE_TO_PREFABSlocal MULTIPLY = GLOBAL.require("map/forest_map").MULTIPLYMULTIPLY = {	["never"] = 0,	["rare(0.1)"] = 0.1,	["rare(0.15)"] = 0.15,	["rare(0.2)"] = 0.2,	["rare(0.3)"] = 0.3,	["rare"] = 0.5,	["default"] = 1,	["often"] = 1.5,	["mostly"] = 2.2,	["always"] = 3,		}TRANSLATE_TO_PREFABS = {	["spiders"] = 	{"spiderden"},	["tentacles"] = {"tentacle"},	["tallbirds"] = {"tallbirdnest"},	["pigs"] = 		{"pighouse"},	["rabbits"] = 	{"rabbithole"},	["beefalo"] = 	{"beefalo"},	["frogs"] = 	{"pond"},	["bees"] = 		{"killerbee", "beehive"},	["grass"] = 	{"grass"},	["rock"] = 		{"rock1", "rock2", "rock_flintless"}, 	["rocks"] = 	{"rocks"}, 	["sapling"] = 	{"sapling"},	["reeds"] = 	{"reeds"},		["trees"] = 	{"evergreen", "evergreen_sparse"},		["evergreen"] = {"evergreen"},		["carrot"] = 	{"carrot_planted"},	["berrybush"] = {"berrybush", "berrybush2"},	["maxwelllight"] = {"maxwelllight"},	["maxwelllight_area"] = {"maxwelllight_area"},	["fireflies"] = {"fireflies"},    ["mushrooms"] = {"red_mushroom", "green_mushroom", "blue_mushroom"},    ["cave_entrance"] = {"cave_entrance"},	["flowers"] = {"flower"},}

You must add them without .lua or game will crash.

Also doing this like in the code above don't have any effects on prefab count.

Using that form modmain maybe I need to put this in worldgenmain?


Edited by _Q_, 15 August 2013 - 02:27 PM.

Just one more fight about a lot of things
And I will give up everything
To be on my own again, free again
Yeah, this time I'ma let it all come out
This time I'ma stand up and shout
I'ma do things my way
It's my way, my way or the highway


#18 Ipsquiggle

    Ipsquiggle
  • Entropy Wrangler


  • 457 posts

Posted 15 August 2013 - 02:33 PM

Thanks, will try that now.

 

You must add them without .lua or game will crash.

Also doing this like in the code above don't have any effects on prefab count.

Using that form modmain maybe I need to put this in worldgenmain?

 

Whoops, that's for pointing that out. Edited the original post for reference.

 

And yes, because this affects world gen, it must be in a worldgenmain.



#19 _Q_

    _Q_
  • Dark Power



  • 2150 posts

Posted 15 August 2013 - 02:37 PM

Whoops, that's for pointing that out. Edited the original post for reference.

 

And yes, because this affects world gen, it must be in a worldgenmain.

Didn't get any effects from woldgenmain also.

Must be missing something.


Just one more fight about a lot of things
And I will give up everything
To be on my own again, free again
Yeah, this time I'ma let it all come out
This time I'ma stand up and shout
I'ma do things my way
It's my way, my way or the highway


#20 debugman18

    debugman18
  • Arbitrary Title




  • 2484 posts

Posted 15 August 2013 - 03:08 PM

With the new preview, I get a crash every time I try to spawn a particular prefab. It worked fine before the update, so I don't know what's happening. On top of that, my log.txt tells me nothing about it. There are no errors or anything.

 

This is the entire prefab contents:

Spoiler

 

Excuse the messiness.


Edited by debugman18, 15 August 2013 - 03:09 PM.

With all the world there is to see, and all the thoughts to think, it's no small wonder our minds come to know boredom.