Jump to content

Recommended Posts

Hello, if someone can help me with this question that would be great, my structure has symbol called "art" and I have art-0, art-1, art-2, ect. would it be possible for my object to switch to a different art image with " inst.AnimState:OverrideSymbol() "?

I have no idea how to use OverrideSymbol so if someone can help me with that and tell me how it works that would be great :)!  help would be very appreciated thanks :D!!

Edited by SuperDavid

Alright so for making the structure an obstacle it is what you mentioned:

MakeObstaclePhysics(inst, 2) --but the second argument is rectangular meaning its 2x2

next structures use another animstate as the one your referring to is usually used heavily in character clothing. What you want it is usually:

inst.AnimState:PlayAnimation("hit")

inst.AnimState:PushAnimation("idle")

usually pushanimation is used when a quick animation is being done along with the looping animation (playanimation) like placing a structure, hammering it down, and so forth. But if you're in doubt on which to use then use playanimation and assign the appropriate animation (assuming your file can do animations) along with the function.

 

5 minutes ago, K1NGT1GER609 said:

next structures use another animstate as the one your referring to is usually used heavily in character clothing. What you want it is usually:

inst.AnimState:PlayAnimation("hit")

inst.AnimState:PushAnimation("idle")

usually pushanimation is used when a quick animation is being done along with the looping animation (playanimation) like placing a structure, hammering it down, and so forth. But if you're in doubt on which to use then use playanimation and assign the appropriate animation (assuming your file can do animations) along with the function.

So structures can't use OverrideSymbol to just swap the texture of one part of it? My structure has many different "styles" so I would have to make an animation for every single style :(?

For example my structure is a canvas thing, and it has a image on the canvas I would have to make an animation for every different image on my canvas which is like over 20+ image :(?

Edited by SuperDavid

Overridesymbol uses three arguements(this is a guess) one for which part is going to be modified, what its going to be overidden with(outside source usually), and override that part. But id stick with what the developers formula and make animations and play them when certain events happen. Plus im not sure if you want to juggle around parts name (assuming you know them) and clearing them(as its needed or ull get a lot of different pictures cluttering one part) when something new happens. Last note is the propegator (hopefully im spelling it right) tells how much space the structure takes and makes other structures not able to be built next to.

Edited by K1NGT1GER609
6 minutes ago, K1NGT1GER609 said:

the propegator (hopefully im spelling it right) tells how much space the structure takes and makes other structures not able to be built next to.

My structure is a large propegator, if I did something like adding component "deployable" and something like this in it would it be able to place anywhere? " inst.components.deployable:SetDeploySpacing(GLOBAL.DEPLOYSPACING.NONE) "

 

so I tried overridesymbol in game and couldn't switch the art, "art" is what a folder is called with symbols in it for the structure, I have 2 images in it art-0 & art-1, the structure by default it's art-0 I tried switching it to art-1 and it just became invisible did I do it wrong maybe?

inst.AnimState:OverrideSymbol("art", "art_1", "art_1")

I used this as an example in previous thread "owner.AnimState:OverrideSymbol("swap_object", "swap_buckler", "swap_buckler")"

Also do you know I get clear the overridesymbol I know there's a way to do it but I don't know how nor where I can find it :)..and thanks for your help :D!

Well right now im using the top of my head as im not on my computer. So if you set the spacing to none you'll have to account the obstacle physics as if something else tries to be built (and it succeeds)there you wont be able to access the structure and the land will be unaccess able. Hmm using global in a argument may lead to a crash. Again if ur wanting to keep using overridesymbol then happy modding(cause i dont remember finding the symbol name in any scml file), otherwise i think the clear goes like:

Inst.animstate:ClearOverrideSymbol("art") 

So ill be more helpful in the morning (assuming ur problem still isnt solved) as going by memory takes way too long and is inaccurate.

Edited by K1NGT1GER609
correction on override symbol

Alright here we go for propagator:

MakeMediumPropagator(inst) --you can change medium to Small,Large, tiny(maybe)

as for deployable its used in walls, turfs, plant(idk don't ask me), and default. I don't know have full knowledge of this component but I think the code will go something like this:

inst:AddComponent("deployable")
        inst.components.deployable.ondeploy(inst,pt,deployer,0) --what is this?It seems really...manual.
        inst.components.deployable:SetDeployMode(DEPLOYMODE.DEFAULT)

Its blurry on what is going on in deployable, other wise ill give more of a look into animstate.

Edited by K1NGT1GER609

So can someone confirm if this is how OverrideSymbol is supposed to be used or tell me how I can use it :)?

I looked through other prefab like "spear" for ect. and I see this

owner.AnimState:OverrideSymbol("swap_object", "swap_spear", "swap_spear")

I realize that for player they have swap_object animated in their animations but it's removed and these other swap_something is then added on them with OverrideSymbol, does this mean I cannot change one part of my structure's texture & Instead of having a art-1, art-2, art-3 for my canvas structure I would have to make those separate textures with separate anim to be able to use overridesymbol?

inst.AnimState:OverrideSymbol("art", "art_1", "art_1")

 

All I want to do is swap 1 texture to another texture then I don't have to have 20+ texture with duplicate parts when only 1 texture is being changed, or I don't want to have to make 6 animation (breaking, being, placed, getting hit, & being idle) for every single different picture that can be on the canvas... why does the game make this so hard to change individual part of the entire texture build :(...

Edited by SuperDavid

Hmm you can use overridesymbol in structures but the arguments make little sense to me:

its what im trying to decode:

inst.AnimState:OverrideSymbol("plain"..data.slot, "winter_ornaments", data.item.winter_ornamentid)

What i think it is:

inst.AnimState:OverrideSymbol(get the slot thats going to be modified, override the slot with the build of the outside source being called, get the outside source's id?)

just food for thought. sometimes the third argument is the same as the first argument but at this point I can't be of any further help.

Thank you @K1NGT1GER609 for all your help you gave me :D!!

So, I think I solved my problem, so what I had to do was I had to copy paste my structure, with just the art image and everything else deleted, then I used overridesymbol to swap my canvas image with the anim containing only another art image & it swapped & everything seemed to work fine, so now I can make my structure have different style and image with overridesymbol hopefully ,thanks again for your help kingtiger :D!

On 12/25/2017 at 2:51 PM, K1NGT1GER609 said:

MakeMediumPropagator(inst) --you can change medium to Small,Large, tiny(maybe)

Hey so I changed my structure to different size propagators but still I can't place close to other structures? Am I doing something wrong? No matter how tiny I put propagator and MakeBurnable or MakeObstaclePhysics always distance is same to place.

Anybody know what I am doing wrong or how I can allow custom structure prefab to be built closer to other structures :D?

You can change it from the AddRecipe part of the code.

It's the 6th parameter, after the placer parameter

AddRecipe("item", {ingredients}, recipetab, tech, "placeritem", min_spacing) setting min_spacing to 1 should do it

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...