• Content Count

  • Joined

  • Last visited

Community Reputation

7 Neutral

About FleurDuSoleil3

  • Rank
    Junior Member

Recent Profile Visitors

1126 profile views
  1. @Yakuzashi Hi, there. I haven't had too much of an in-depth look at your mod (I haven't loaded it up in the game, basically), but I noticed: In the becometaern function, you have written inst.AnimState:SetBank("taern") It should be inst.AnimState:SetBank("wilson") If this doesn't work, let me know and I'll have a proper fiddle with your mod.
  2. Credit goes to the Bigby Wolf mod for the health threshold activator; however, there are other options available to you. I will preface this by saying I'm not a very good coder; most of this was discovered by asking for help or digging through the game files. With that said, here we go. It will also be needlessly prolix. What we'll be achieving here is having you make your character become any other mob in the game via a transformation that can be triggered by health, the full moon, or by eating an item. For custom-made mobs, I don't know. The principles probably remain the same. For creatures without any action handlers in their stategraphs, I don't know. This is an amateur hour tutorial. I simply don't have the knowledge as of yet as I have not needed it. Firstly, you'll need to post the following code in your character's prefab file: local function BecomeYour_Custom_Character(inst) inst.your_custom_werewolf = false inst.AnimState:SetBank("wilson") inst.AnimState:SetBuild("your_custom_character") inst:SetStateGraph("SGwilson") end local function BecomeYour_Custom_Werewolf(inst) inst.your_custom_werewolf = true inst.AnimState:SetBank("your_custom_werewolf's_anim_bank") ----- You can find the bank of whatever creature you are using in its prefab. inst.AnimState:SetBuild("your_custom_werewolf's_anim_build") ---- You can find the animation for x's _build in your creature's prefab. inst:SetStateGraph("SGyour_custom_werewolf") ------- See stategraph below end So, let us take a look at becoming a Bunnyman to see an example of this. local function BecomeRabbitman(inst) inst.wererabbit = false inst.AnimState:SetBank("wilson") inst.AnimState:SetBuild("rabbitman") inst:SetStateGraph("SGwilson") end local function Become_Wererabbit(inst) inst.wererabbit = true inst.AnimState:SetBank("manrabbit") inst.AnimState:SetBuild("manrabbit_build") inst:SetStateGraph("SGwererabbit") end Now we need to make sure the game knows when to start this transformation. Health-based transformation: Moon-based transformation: inst:ListenForEvent("nighttime", function(global, data) if GetClock():GetMoonPhase() == "full" and not inst.your_custom_werewolf then becomeyour_custom_werewolf(inst) end end, GetWorld()) inst:ListenForEvent("daytime", function(global, data) if GetClock():IsDay() and inst.your_custom_werewolf then becomeyour_custom_character(inst) end end, GetWorld()) Food-based transformation: inst:ListenForEvent("oneat", function(inst, data) if data.food.prefab == "whatever_you_want" and not inst.your_custom_werewolf then becomeyour_custom_werewolf(inst) --- turn into your werewolf when you eat a carrot or something elseif data.food.prefab == "whatever_you_want" and inst.your_custom_werewolf then becomeyour_custom_character(inst) --- turn back into your character when you eat another one end end) Stategraph: You are going to need to find whatever creature you are using's stategraph (located in the game's data folders). You will need to replicate it and rename it, then create your own stategraph folder in your mod character's scripts folder and put your new renamed stategraph in there. So the path will be YourMod/scripts/stategraphs/SGyour_custom_werewolf The stategraph will need some editing. On a basic level, such as turning into a bunnyman or pig, you will need to remove any instance of the term 'follower' from the stategraph (more often than not by just getting rid of the entire line it is contained in). This will prevent crashes if you equip an item such as a hat. For most creatures, such as the Deerclops, death will cause a crash. I don't know why because I'm an untalented hack, but I removed the following line from the Deerclops and it stopped crashing: inst.components.lootdropper:DropLoot(Vector3(inst.Transform:GetWorldPosition())) You can also add in actions (you can find a list of actions in the game's data folder under 'actions.lua'). For instance, you may want to add in the action PICK and PICKUP using one of the creature's existing animations to avoid any crashes when you attempt to pick things up. Here is an example of making a bunnyman able to pick objects such as grass and flowers: local actionhandlers = { ActionHandler(ACTIONS.GOHOME, "gohome"), ActionHandler(ACTIONS.EAT, "eat"), ActionHandler(ACTIONS.PICKUP, "pickup"), ----- The bunnyman can already pick up items ActionHandler(ACTIONS.EQUIP, "pickup"), ActionHandler(ACTIONS.ADDFUEL, "pickup"), ActionHandler(ACTIONS.PICK, "pickup"), ---------- So we added in the PICK action using the bunnyman's "pickup" animation } Here is a demonstration using the Bunnyman. Bunnyman's stategraph before we use it: And after: There is a little bit more you can do with the transformation. Just as with your custom character, you can customise the werecreature: There is a lot more, but those are just some examples. Don't forget to revert anything you do in the transformation to the werewolf in the transformation back to your character. For instance: And that should be all. Good luck, everyone! I hope this helps.
  3. Hi, This is actually really easy to do. Insert the following under your character's prefab file under local functions: inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.1) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.2) Edit the digits as you like to adjust the speed at which they travel. Hope this helps.