Jump to content

Recommended Posts

I'm trying to make an item that should have a different build while playing as a certain character.

 

I've put this in his prefab:

inst.AnimState:SetClientSideBuildOverrideFlag("demoman", inst:HasTag("demoman"))

And this in quickiebomb.lua:

inst.AnimState:SetClientsideBuildOverride("demoman", "quickiebomb", "stickybomb")

Both banks are named the same, animation names are the same as well, so about switching builds everything should work correctly.

 

No matter what it won't work correctly, though. I found out that some things disappear based on where I load the assets - in modmain.

 

If both animations aren't loaded in modmain, then Clientside Build works correctly, but regular one is invisible.

If both animations are loaded in modmain, then Clientside Build is invisible, but regular one works correctly.

 

When Serverside Build isn't loaded in modmain and Clientside is loaded, then Serverside is visible, but Clientside Build is not.

When Clientside Build isn't loaded in modmain and Serverside is loaded, then Clientside is visible, but Serverside Build is not.

 

What am I missing...? I'm probably doing something wrong, but I don't exactly know what. Any help is appreciated!

Edited by PanAzej
Link to comment
https://forums.kleientertainment.com/forums/topic/68835-clientside-build-override/
Share on other sites

1 hour ago, DarkXero said:

Try loading them both in the assets of quickiebomb.

Also, SetClientSideBuildOverrideFlag should also be run by the inst if inst == ThePlayer.

Also post the mod with your code so I can look at it. Maybe it has to be implemented differently.

They're both loaded in quickiebomb, the thing is I noticed that weird things happen if assets are loaded in modmain.

I added ThePlayer check, but it didn't change anything.

 

I've attached the mod to this post, with *.scml files and animation frames as well. Thank you for taking a look at it in advance!

DEMOMAN.zip

 

(the fastest way to test it is to use quickiebomblauncher, otherwise bombs will disappear right away)

Edited by PanAzej

SetClientsideBuildOverride is triggered on clients, so I moved it to the common_postinit. But same problem. I removed the ClientsideBuildOverride part, even, and stuff is invisible. The invisible stuff is because one asset replaces the other: there are two animation banks with the same name. Symbols should have the same name, which isn't the case here. When I inspected the anim.bins, they were different between the zips of quickiebomb and stickybomb.

 

I imagine the way to go would be to have two folders with the same scml, same bomb folder, and have the quickie bombs in one and the sticky in the other, all named the same (folders and pngs). The difference would be in the scml name, which makes the build name. Same result, two zips with build, atlas, anim. Anim should be common.

 

Or generate all the same, just switching the images, and then using the build renamer.

 

19 hours ago, DarkXero said:

SetClientsideBuildOverride is triggered on clients, so I moved it to the common_postinit. But same problem. I removed the ClientsideBuildOverride part, even, and stuff is invisible. The invisible stuff is because one asset replaces the other: there are two animation banks with the same name. Symbols should have the same name, which isn't the case here. When I inspected the anim.bins, they were different between the zips of quickiebomb and stickybomb.

 

I imagine the way to go would be to have two folders with the same scml, same bomb folder, and have the quickie bombs in one and the sticky in the other, all named the same (folders and pngs). The difference would be in the scml name, which makes the build name. Same result, two zips with build, atlas, anim. Anim should be common.

 

Or generate all the same, just switching the images, and then using the build renamer.

 

Thank you for the reply!

 

I've moved the DoTaskInTime to common_postinit.

 

I made a new anim, called 'quickiebomb_demo' for clientside view.

 

First try:

I copied quickiebomb.zip, changed name to quickiebomb_demo and renamed its build to quickiebomb_demo in Build Renamer:

 

Didn't change anything.

 

Second try:

I tried to compile a new spriter project, with everything named the same as quickiebomb (but build):

 

Still doesn't work.

 

Third try:

I changed build and bank name (to quickiebomb_demo) and compiled them:

 

Aaand it's still invisible.

 

Damn.

 

Nevermind, finally got it working. Thank you very much for the help!

Edited by PanAzej

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
×
  • Create New...