Jump to content

Client-side issue: stategraph


Recommended Posts

Hi all, 

I've expanded on the spawner system of the eye plant, creating a new component which some what mirrors the original but is adjusted for specific states on spawn,

The component summons in specific modified instances of tentacles. Although this works rather cleanly on a host, the client side crashes on the first spawn of a minion. I've isolated the bug to the stategraph system, although I'm struggling to find a clear explanation as to how to implement it for the client side. Any assistance would be greatly appreciated. ^^

Sample image from host(without error):

dMN0WLC.png

Error produced by clientside:

325: attempt to index field 'sg' (a nil value)
LUA ERROR stack traceback:
scripts/components/tentaclespawner.lua:325

Line in question - minion.sg:GoToState("rumble") -- [[ I assume I need to tell the client which Stategraph it needs to use, though unsure how ]]

Link to comment
Share on other sites

13 hours ago, MorickClive said:

Error produced by clientside:

Don't implement it client side.

Put inst:SetStateGraph("SGminion") after the TheWorld.ismastersim check.

The only client side stategraphs are the player related ones, since those are useful to determine in advance the animations a client with movement prediction is going to do.

Link to comment
Share on other sites

Yep, that seems to have cleared the issue; thank you so much :D.

All I need to do is shift the spawned tentacles to a different prefab name (for description and reference purposes) and apply the overlay colour for client creatures.
 

-- This line causes the clients to freeze (fixed)
    minion:SetPrefabName("shadowed_tentacle")
-- fixed, minion:SetPrefabNameOverride successfull re-allocates the name so characters can uniquely comment on it.

-- These lines do no apply to clients.

    minion.AnimState:OverrideMultColour(0.1, 0.1, 0.1, 0.85)
    minion.name = "Shadowed Tentacle"

I'll hammer away at these, thank you for the support! ^^

-- Edit:

  • Solved an issue with prefab overriding.
  • Solved the issue with colour and naming issue: though only through creating an edited version of the tentacle file, maybe inefficient?
Edited by MorickClive
New development/edit success
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...