grymlahv

sample modmain

Jul 3rd, 2020
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. PrefabFiles = {
  2. "esctemplate",
  3. "esctemplate_none",
  4. }
  5.  
  6. Assets = {
  7. Asset( "IMAGE", "images/saveslot_portraits/esctemplate.tex" ),
  8. Asset( "ATLAS", "images/saveslot_portraits/esctemplate.xml" ),
  9.  
  10. Asset( "IMAGE", "images/selectscreen_portraits/esctemplate.tex" ),
  11. Asset( "ATLAS", "images/selectscreen_portraits/esctemplate.xml" ),
  12.  
  13. Asset( "IMAGE", "images/selectscreen_portraits/esctemplate_silho.tex" ),
  14. Asset( "ATLAS", "images/selectscreen_portraits/esctemplate_silho.xml" ),
  15.  
  16. Asset( "IMAGE", "bigportraits/esctemplate.tex" ),
  17. Asset( "ATLAS", "bigportraits/esctemplate.xml" ),
  18.  
  19. Asset( "IMAGE", "images/map_icons/esctemplate.tex" ),
  20. Asset( "ATLAS", "images/map_icons/esctemplate.xml" ),
  21.  
  22. Asset( "IMAGE", "images/avatars/avatar_esctemplate.tex" ),
  23. Asset( "ATLAS", "images/avatars/avatar_esctemplate.xml" ),
  24.  
  25. Asset( "IMAGE", "images/avatars/avatar_ghost_esctemplate.tex" ),
  26. Asset( "ATLAS", "images/avatars/avatar_ghost_esctemplate.xml" ),
  27.  
  28. Asset( "IMAGE", "images/avatars/self_inspect_esctemplate.tex" ),
  29. Asset( "ATLAS", "images/avatars/self_inspect_esctemplate.xml" ),
  30.  
  31. Asset( "IMAGE", "images/names_esctemplate.tex" ),
  32. Asset( "ATLAS", "images/names_esctemplate.xml" ),
  33.  
  34. Asset( "IMAGE", "images/names_gold_esctemplate.tex" ),
  35. Asset( "ATLAS", "images/names_gold_esctemplate.xml" ),
  36. }
  37.  
  38. AddMinimapAtlas("images/map_icons/esctemplate.xml")
  39.  
  40. local require = GLOBAL.require
  41. local STRINGS = GLOBAL.STRINGS
  42.  
  43. -- The character select screen lines
  44. STRINGS.CHARACTER_TITLES.esctemplate = "The Sample Character"
  45. STRINGS.CHARACTER_NAMES.esctemplate = "Esc"
  46. STRINGS.CHARACTER_DESCRIPTIONS.esctemplate = "*Perk 1\n*Perk 2\n*Perk 3"
  47. STRINGS.CHARACTER_QUOTES.esctemplate = "\"Quote\""
  48. STRINGS.CHARACTER_SURVIVABILITY.esctemplate = "Slim"
  49.  
  50. -- Custom speech strings
  51. STRINGS.CHARACTERS.ESCTEMPLATE = require "speech_esctemplate"
  52.  
  53. -- The character's name as appears in-game
  54. STRINGS.NAMES.ESCTEMPLATE = "Esc"
  55. STRINGS.SKIN_NAMES.esctemplate_none = "Esc"
  56.  
  57. -- The skins shown in the cycle view window on the character select screen.
  58. -- A good place to see what you can put in here is in skinutils.lua, in the function GetSkinModes
  59. local skin_modes = {
  60. {
  61. type = "ghost_skin",
  62. anim_bank = "ghost",
  63. idle_anim = "idle",
  64. scale = 0.75,
  65. offset = { 0, -25 }
  66. },
  67. }
  68.  
  69. -- Add mod character to mod character list. Also specify a gender. Possible genders are MALE, FEMALE, ROBOT, NEUTRAL, and PLURAL.
  70. AddModCharacter("esctemplate", "FEMALE", skin_modes)
  71. local food_stat_dict = {
  72. twigs = { sanity = 10 },
  73. monsterlasagna = { health = 25, sanity = -10, hunger = -10 },
  74. fishsticks = { health = 20, sanity = 20, hunger = 20 },
  75. --[[flint = { health = 1, sanity = 0, hunger = 15 },
  76. rocks = { health = 0, hunger = 5 },
  77. goldnugget = { hunger = 0 },
  78. nitre = { health = 5, hunger = 5 },
  79. moonrocknugget = { health = 0, sanity = 10, hunger = 5 },
  80. redgem = { health = 50, sanity = 0, hunger = 0 },
  81. orangegem = { health = 25, sanity = 0, hunger = 25 },
  82. yellowgem = { health = 0, sanity = 0, hunger = 50 },
  83. greengem = { health = 0, sanity = 25, hunger = 25 },
  84. bluegem = { health = 0, sanity = 50, hunger = 0 },
  85. purplegem = { health = 25, sanity = 25, hunger = 0 },
  86. opalgem = { health = 50, sanity = 50, hunger = 50 },
  87. thulecite = { health = 300, sanity = 50, hunger = 100 },]]--
  88. }
  89.  
  90.  
  91. for food_prefab, food_stats in pairs(food_stat_dict) do
  92. AddPrefabPostInit(food_prefab, function(inst)
  93. print(inst.components)
  94. print("test debug")
  95. inst.components.edible.healthvalue = food_stats["health"] or 0
  96. inst.components.edible.hungervalue = food_stats["hunger"] or 0
  97. inst.components.edible.sanityvalue = food_stats["sanity"] or 0
  98. end)
  99. end
Add Comment
Please, Sign In to add comment