ksaab

  • Content count

    72
  • Joined

  • Last visited

Community Reputation

53 Excellent

1 Follower

About ksaab

  • Rank
    Junior Member

Recent Profile Visitors

1,458 profile views
  1. 3) Check out the forum, there is a pinned thread about them; 4) I offer variants to you. How you will implement dependng on your preferences. The last variant doesn't requie a client stategraph; 5) How do you use dodge without weapon? GetPointSpecialActions? Or key binding? How do you realize cooldown on the client side? You can remove my AddComponentAction if you don't need them.
  2. 3) Yes... busy tag doesn't sync... hmmm. Net variable? Anyway it's required if you want to add a cooldown for dodge. 4) Yep. But with this implementation you don't use client ctategraph at all. 5) You've lost sg — inst.sg:RemoveStateTag("busy")
  3. 2) Did you add data as second argument for onenter function? 3) AddComponentAction functions. 4) I suppose a fix for this problem requires a dirty hook. I don't have a good solution for it. Try to add inst.Physics:Teleport(inst.Transform:GetWorldPosition()) to pre state. 5) It should.
  4. 1) Yep. Busy tag should help. 2) Dodge direction should be handled in the "pre" state with data.pos if data and data.pos then inst:ForceFacePoint(data.pos.x, 0, data.pos.z) end 3) Add conditions to action collectors. Something like this: if not inst:HasTag("busy") then
  5. AddAction("DODGE", "Dodge", function(act) act.doer:PushEvent("letsdododge", {pos = act.pos or Vector3(act.target.Transform:GetWorldPosition())}) return true end) ACTIONS.DODGE.distance = math.huge ACTIONS.DODGE.instant = true AddStategraphEvent("wilson", EventHandler("letsdododge", function(inst, data) inst.sg:GoToState("dodge_pre", data) end) ) I think you want something like this — use dodge while player is moving. It's a bit dirty-tricky and looks weird on clients. But the second could be fixed I suppose. Client-stategraph doesn't need any code at all. Other things from the previous post. Dodge direction should be handled in the "pre" state with data.pos. One more thing — pos = act.pos will work incorrect after RoT release. Klei has changed this filed. Check out bufferedaction.lua after update. Two more thing — 0.25 widnow is too short. Clients with high unstable ping will have problems (I did a parry spell with 0.5 seconds window in The Forge Battle Pack and recieved a lot of complaints)
  6. AddStategraphState("wilson", State { name = "dodge_pre", tags = {"doing", "busy", "evade", "no_stun"}, onenter = function(inst) inst.components.locomotor:Stop() inst.AnimState:PlayAnimation("parry_pre", false) end, events = { EventHandler("animover", function(inst) inst.sg:GoToState("dodge") end), } }) AddStategraphState("wilson", State { name = "dodge", tags = {"doing", "evade", "no_stun", "nopredict", "nomorph",}, onenter = function(inst) inst.AnimState:PlayAnimation("parry_loop", true) inst.components.health:SetInvincible(true) inst.components.locomotor:EnableGroundSpeedMultiplier(true) inst.last_dodge_time = GLOBAL.GetTime() inst.Physics:SetMotorVel(-20,0,0) --this should be moved to the action code ----------------------------------------- if GLOBAL.TheNet:GetServerGameMode() == "lavaarena" then COMMON_FNS.DoFrontAOE(inst, 5, 0, 3.25, "strong", nil) inst:DoTaskInTime(0.5, function() COMMON_FNS.DoFrontAOE(inst, 5, 0, 3.25, "strong", nil) end) if inst.laserdodge ~= nil then inst.laserdodge:Cancel() inst.laserdodge = nil end end ----------------------------------------- inst.SoundEmitter:PlaySound("dontstarve_DLC003/characters/wheeler/slide") inst:PerformBufferedAction() --not the best idea --because of latency character will dash for shorter distance then you're expecting --will be much better to calculate target postion and use onupdate until character reaches it; --after fire your custom event and catch it in EventHandler("yourevent", function() place code from ontimeout end) inst.sg:SetTimeout(0.25) end, events = { EventHandler("animqueueover", function(inst) --this happens only after inst.AnimState:PlayAnimation("parry_pst", false) will be complete if inst.AnimState:AnimDone() then inst.sg:GoToState("idle") end end), }, ontimeout = function(inst) inst.Physics:SetMotorVel(0, 0, 0) inst.components.health:SetInvincible(false) inst.components.locomotor:EnableGroundSpeedMultiplier(false) inst.AnimState:PlayAnimation("parry_pst", false) end, onexit = function(inst) --need to double this code — case when we will leave the state before timeout inst.Physics:SetMotorVel(0, 0, 0) inst.components.health:SetInvincible(false) inst.components.locomotor:EnableGroundSpeedMultiplier(false) end, }) AddStategraphActionHandler("wilson", ActionHandler(ACTIONS.DODGE, "dodge_pre")) AddStategraphState("wilson_client", State { name = "dodge_pre", tags = {"doing", "busy", "evade", "no_stun"}, onenter = function(inst) inst.components.locomotor:Stop() inst.AnimState:PlayAnimation("parry_pre", false) inst.AnimState:PushAnimation("parry_loop", true) inst:PerformPreviewBufferedAction() inst.sg:SetTimeout(2) end, onupdate = function(inst) if inst:HasTag("doing") then if inst.entity:FlattenMovementPrediction() then inst.sg:GoToState("idle", "noanim") end elseif inst.bufferedaction == nil then inst.sg:GoToState("idle") end end, ontimeout = function(inst) inst:ClearBufferedAction() inst.sg:GoToState("idle") end, } ) AddStategraphActionHandler("wilson_client", ActionHandler(ACTIONS.DODGE, "dodge_pre")) --actions collectors, dodge will work with any equipped weapon. Not good but it's just an example --I'm not sure overriding onlocomote event handler is a good idea --check out the wortox prefab if you want use dodge like wortox's soul hop AddComponentAction("EQUIPPED", "weapon", function(inst, doer, target, actions, right) if right then table.insert(actions, ACTIONS.DODGE) end end) AddComponentAction("POINT", "weapon", function(inst, doer, pos, actions, right) if right then table.insert(actions, ACTIONS.DODGE) end end) don't forget to rename animation
  7. Your character moves after dodging because of inst.Physics:SetMotorVelOverride(20,0,0). Client draws fake position for character, but real doesn't change (actually it doesn't work at all). Any client state should contain animation and tag things only. AddStategraphState("wilson_client", State { name = "dodge", tags = {"busy", "evade", "no_stun"}, onenter = function(inst) inst.components.locomotor:Stop() inst.AnimState:PlayAnimation("slide_pre", false) --only pre animation, the slide animation command must come from server inst:PerformPreviewBufferedAction() --this thing says to server "hey man, I'm doing something" inst.sg:SetTimeout(2) end, --[[I use this chunk, but I don't have idea what it really does. Sometime state doesn't work without "onupdate". It requires "doing" tag for server and client states onupdate = function(inst) if inst:HasTag("doing") then if inst.entity:FlattenMovementPrediction() then inst.sg:GoToState("idle", "noanim") end elseif inst.bufferedaction == nil then inst.sg:GoToState("idle") end end, ]]-- --timeout happens only if player have a lag ontimeout = function(inst) inst:ClearBufferedAction() inst.sg:GoToState("idle") end, ) I think the second state is not requied for the client stategraph.
  8. There is "wilson_client" stategraph. The game uses it if lag compenstion is enabled on client (when you're playing as host without caves you are actually not a client and don't use this stategraph). It is almost the same but doesn't contain any game logic. The solution for the problem — you need to add lightweight versions of your states to "wilson_client".
  9. Version 1.0.3

    1,035 downloads

    First: TFBP features require the «Green!». Spells will not work without it! Second: This mod is in development — issues are expected! Do you miss you favorite weapon or suit from The Forge event*? Then this is what you need! Almost all weapons (no Lucy); All hats and helms; 5 types of armor/clothes. All spells and item bonuses are implemented *Fossil effect replaced by freezing. Items, which shares sprites with skins, were recolored. All recipes require Prestihatitator (first magic tier). Steam version: Here
  10. Green!

    Version 1.2.0

    561 downloads

    First: this mod doesn't have any gameplay content — it is the basis for other mods! Second: This mod is in development. Errors and issues are expected! Green! is a framework which improves magic in the game, adding a lot of roleplay features: Spells with skillshot-mechanic and cooldowns; Status effects (buffs and debuffs); Affixes (diablo-style modificators for items and creatures); More cool stuff like drinks, enchants, caster-creatures, etc. What can be done with this? The Forge-style weapon; Character with active spells (go away, boring passive perks!); Bleeding, deseases, poison and more dangerous (or useful) things; Spider-mages with meteors. Mods based on the Green!: Green World; The Forge Battle Pack. Steam vesrsion: here
  11. Custom Farming

    It's not a bug, I'm just too lazy to rename variables. Check ca_veggies.lua line 289
  12. Custom Farming

    No, basic farms and crops have different chances. When you change a weight for a crop, It does not impacts farms.
  13. Custom Farming

    Yeah, but I need to examine it first (never used it before) It has high chance to replace carrot or corn with a new vegetable for a usual farm. It doesn't affect other seed-products (well, I've broken vanilla chances in the last update, not critically, but late noticed) New farming is a weighted system now, so you can change a chance for any crop you want (not as an option, from the code only) Thanks for your feedback.
  14. Custom Farming

    Version 1.2.0

    1,267 downloads

    Grow vegetables and fruits without a farm! How to do it? Create a hoe; Till the ground; Fertilize the soil; Plant a seed! It is possible to grow vanilla plants too! Cook new vegetables in a crockpot. New recipes: Bread (4 wheat); Fruit muffin (fruit, egg, wheat, honey) Tomato soup (2 tomato, veggies, no meat); Onion soup (2 onion, veggies, no meat); Meat soup (2 garlic, 1 additional veggie, 1 meat); Fish soup (2 potato, 2 fish); Pumpkin soup (pumpkin, 1 honey, wheat, no meat) Fruit pie (2 wheat, fruits, no meat) Vegetable pie (2 wheat, veggies, no meat) Meat pie (2 wheat, meat) Fish pie (2 wheat, fish) Sweet turnip (2 turnip, 2 honey, no meat) How to get new seeds? It's pretty simple — new vegetables can be grown from usual seeds. Also you can get specific seeds using a birdcage. Don't like the new farming system? Disable the hoe recipe and grow new vegs on usual farms. Steam links: Together, Single