Jump to content

[Shipwrecked] Help. Stategraphs


Neu7ral

Recommended Posts

Boating stategraph is automatically handled in player_common.lua; modded characters do not need to worry about it.

 

Well. Actually i'm trying to do a new attack type. using the DST spearjab animation, and when you are on a boat doesn't work properly. And i'm thinking I should use the stategraph post init for both.

Link to comment
Share on other sites

Well. Actually i'm trying to do a new attack type. using the DST spearjab animation, and when you are on a boat doesn't work properly. And i'm thinking I should use the stategraph post init for both.

 

Modifying it is the same way as modifying other stategraphs. Simply pass SGwilsonboating instead of SGwilson.

Link to comment
Share on other sites

Boating stategraph is automatically handled in player_common.lua; modded characters do not need to worry about it.

no its does not.  

 

if you character has a custom stategraph it uses the one its told to load.which will result in them not getting on a boat if you didnt update the sg or do the following

 

the updated warfarin has a example of what to do in his prefab if you scroll through all of it you will see what im talking about near the bottom but its easier just to add it in the normal place without the if else string. if you do it that way its a SW only character or you can put the whole thing in your call

Link to comment
Share on other sites

@NoOne, I cannot speak for custom stategraphs, however, I know for a fact that it is automatically handled.

 

The following code shows exactly how it's handled automatically.

 

player_common.lua

inst:AddComponent("driver")inst.components.driver.landstategraph = "SGwilson"inst.components.driver.boatingstategraph = "SGwilsonboating"inst.components.driver.onStartDriving = function()

components/driver.lua Line 154 (OnMount function)

self.inst:SetStateGraph(self.boatingstategraph)

components/driver.lua Line 114 (OnDismount Function)

self.inst:SetStateGraph(self.landstategraph)
Link to comment
Share on other sites

@NoOne, I cannot speak for custom stategraphs, however, I know for a fact that it is automatically handled.

The following code shows exactly how it's handled automatically.

player_common.lua

inst:AddComponent("driver")inst.components.driver.landstategraph = "SGwilson"inst.components.driver.boatingstategraph = "SGwilsonboating"inst.components.driver.onStartDriving = function()
components/driver.lua Line 154 (OnMount function)
self.inst:SetStateGraph(self.boatingstategraph)
components/driver.lua Line 114 (OnDismount Function)
self.inst:SetStateGraph(self.landstategraph)

I'm inclined to agree. I converted Beatrice to run in SW with no change to stategraph and she can boat just fine. Only glitch is the row is invisible.

Link to comment
Share on other sites

Actually i did the stategraph post init, lol. Now, when i do the animation spearjab the boat turns invisible so, my super brain strategically thinked (just my idiotness and fix it fast) make this...

 

-----------------------

if weapon then
                inst.AnimState:PlayAnimation("spearjab")
inst.SoundEmitter:PlaySound("dontstarve/wilson/attack_weapon")
inst.components.driver:SplitFromVehicle()
print("get out of here! boat")
inst:DoTaskInTime(1.8, function()
inst.components.driver:CombineWithVehicle()
print("BOAT TO ME!")
end) 
 
end
--------------------
The SplitFromVehicle rids the animation sticked with the boat, but you get an graphical bug when you move from another side, i don't know how to explain this.
UQEgzTe.jpg
After that i tried to do the CombineWithVehicle some seconds later after use that attack, pretty works :p, yeah, quite a lazy form to fix it. I guess...
 
Sr0ZlcN.jpg
The spearjab.
Link to comment
Share on other sites

 

@NoOne, I cannot speak for custom stategraphs, however, I know for a fact that it is automatically handled.

 

The following code shows exactly how it's handled automatically.

 

player_common.lua

inst:AddComponent("driver")inst.components.driver.landstategraph = "SGwilson"inst.components.driver.boatingstategraph = "SGwilsonboating"inst.components.driver.onStartDriving = function()

components/driver.lua Line 154 (OnMount function)

self.inst:SetStateGraph(self.boatingstategraph)

components/driver.lua Line 114 (OnDismount Function)

self.inst:SetStateGraph(self.landstategraph)

if you over write the normal stategraph with a edited one for say normal dont starve it works with rog since they added no extra actions

 

if you use that same state graph for a character and load it into shipwrecked it wont be able to get on a boat. the player_common.lua doesnt have priority over a the stategraph. i dont know if either of you have actually looked through ship wrecked wilson state graph but his normal and boating are the same. he has to get on a boat when on land.

 

its a new action. the shipwrecked wilson state graph isnt normal dont starve state graph . you cant use SW sg in normal dont starve it crashes because the action doesnt have the all the rest of the code from other files to allow it to run. it maybe called the same thing but its not lol

 

Link to comment
Share on other sites

@NoOne, when you mentioned overwriting files I immediately stopped reading. Overwriting files is the wrong approach to modding Don't Starve and Don't Starve Together. You should be using the supplied API to hook into the state graphs to modify them, not overwriting the files because at any moment in time your mod could become incompatible with any version of the game.

Link to comment
Share on other sites

@NoOne, when you mentioned overwriting files I immediately stopped reading. Overwriting files is the wrong approach to modding Don't Starve and Don't Starve Together. You should be using the supplied API to hook into the state graphs to modify them, not overwriting the files because at any moment in time your mod could become incompatible with any version of the game.

true, but what an irony - at least two most popular addons doing it

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...