Jump to content

emissive problems in unity/ ModuleAnimateHeat not working


Recommended Posts

Hi all I am having problems with emissives for some engines I am making, I have never had any problems with emissives before but have never done them for an engine/ ones that are triggered by a module before so I am probably just going wrong somewhere down the line and haven't realised, although I have revisited CardBoardBoxProcessor's tutorial, followed it step by step, and still come out with the same result, basically the problem is that the engine emissive is always at the frame that the animation is on when it is written in unity, so if it's at the start of the animation then nothing appears, if it's at the end its always at its most intense glow, this is with "always animate" unticked and the animation on the root GameObject at the top of the hierarchy. this is what my unity screen looks like:

tumblr_nn0gvw28x81r0o48lo1_1280.png

and this is what my config looks like:

PART{

// Kerbal Space Program - Part Config

// LiLFA

//

// --- general parameters ---

name = 1.25mLiLFA

module = Part

author = Squiggsy

// --- asset parameters ---

mesh = model.mu

rescaleFactor = 1

// --- node definitions ---

node_stack_top = 0.0, 0.0 , 0.0, 0.0, 1.0, 0.0, 1

node_stack_bottom = 0.0, -1.0, 0.0, 0.0, 1.0, 0.0, 1

// --- FX definitions ---

fx_exhaustFlame_blue = 0.0, -0.0, 0.0, 0.0, 1.0, 0.0, running

fx_exhaustLight_blue = 0.0, -0.0, 0.0, 0.0, 0.0, 1.0, running

// --- Sound FX definition ---

sound_vent_medium = engage

sound_rocket_hard = running

sound_vent_soft = disengage

sound_explosion_low = flameout

// --- editor parameters ---

TechRequired = ionPropulsion

entryCost = 16000

cost = 7500

category = Propulsion

subcategory = 0

title = LiLFA EPS125

manufacturer = SquiggsySpace Research

description = The LiLFA (Lithium Lorenz Force Accellerator) uses what the boys in the lab describe as "some kind of magic, or plasma, we're not sure" to propel ships at high levels of thrust for such an efficient engine, with the trade off of extemely high energy usage. Designed for use in a vacuum

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision

attachRules = 1,0,1,0,0

// --- standard part parameters ---

mass = 0.05

dragModelType = default

maximum_drag = 0.2

minimum_drag = 0.2

angularDrag = 2

crashTolerance = 7

maxTemp = 3600

RESOURCE

{

name = LiquidLithium

amount = 500

maxAmount = 500

}

RESOURCE

{

name = ElectricCharge

amount = 350

maxAmount = 350

}

MODULE

{

name = ModuleEngines

thrustVectorTransformName = thrustTransform

exhaustDamage = False

ignitionThreshold = 0.1

minThrust = 0

maxThrust = 24

heatProduction = 600

fxOffset = 0, 0, 0.21

PROPELLANT

{

name = LiquidLithium

ratio = 0.5

}

PROPELLANT

{

name = ElectricCharge

ratio = 3

}

atmosphereCurve

{

key = 0 4077

key = 1 4077

}

MODULE

{

name = ModuleAnimateHeat

ThermalAnim = lilfaengineemissive

}

}

if anyone has any ideas I would be so very grateful I have put off posting on here and tried multiple times to find the solution to this myself but after countless combinations of different attempts at fixes I am no closer to finding the solution :\

Edited by Squiggsy
Link to comment
Share on other sites

ok so there is definitely something wrong here and I cannot for the life of me figure it out, decided to try with FXModuleAnimateThrottle instead to see if it was something wrong with my code for ModuleAnimateHeat but it still has the same problem, the animation doesnt play, it is just permanently on whatever frame it was on when I write the model and textures in parttools :\ I have tried every combination I can possibly think off and just always get the same result

Link to comment
Share on other sites

Ah sorry for the late reply I had given up on this post haha

I am using version 4.2.2 and yes in the morning when I have the time I will definitely share the unity assets if thats ok, thanks for the reply :)

your tutorials are amazing and have helped me so much thank you for making them by the way!

Link to comment
Share on other sites

There is a way to force the latest versions of Unity (4.3+) to use the legacy animation method for animated emissives:

I'm using the latest version of Unity, and in order to get animated emissives to work, I had to hack up the animation files with a text editor to force it to use the legacy (i.e. not the new mecanim) animation system:

http://answers.unity3d.com/questions/622005/legacy-animation-system-cannot-animate-colors.html

Since I could get this hack to work consistently in my projects, I should probably write a proper tutorial for this - maybe this weekend.

With a text editor? I tried and all I see are random symbols
Whoops, missing bit of critical info!

In Unity, go to Edit > Project Settings > Editor - in the Inspector window/dialog/pane that appears, set the Asset Serialization mode to Force Text. This forces Unity to recompile all the animation files to use plain text rather than the default binary setting.

Ok, finally managed to fix it

  1. Open Unity
  2. Click the little menu icon to the right of the Inspector tab
  3. Select the Debug option
  4. Select your animation in the Project Tab
  5. In the Inspector change Animation type from 2 to 1
  6. Go to Edit > Project Settings > Editor
  7. In the Inspector tab set Asset Serialization mode to Force Text
  8. Browse your PC for the .anim file and open it with a plain text editor, notepad will do
  9. Change all ClassID from 23 to 21
  10. Remove all material. prefixes from the attribute: sections but leave the rest (ie "material._EmissiveColor.r" becomes "_EmissiveColor.r")
  11. Save the file
  12. Export your project
  13. Remember to assign the animation in the config file

Thanks to Sumghai for the help

Link to comment
Share on other sites

There is a way to force the latest versions of Unity (4.3+) to use the legacy animation method for animated emissives:

ohh thanks for that bit of info I might try that out today and see if it fixes my problem, got some new stuff im working on for a project and a couple of engines are included into the command pod for it (dragon v2 style):

ULSpVju.png

Link to comment
Share on other sites

  • 2 weeks later...

I FINALLY GOT IT TO WORK

sorry i keep completely forgetting about this post and getting sidetracked, i have NO IDEA what I did right this time which is a shame but I know the steps I took so I guess I just have to repeat them painstakingly from now on..

Link to comment
Share on other sites

Welcome to KSP/Unity modding, It won't be the last time. :)

haha it wasn't the first time either ;) god unity does my head in sometimes, although in truth it is invariably not unitys fault but my own , I just hope I can repeat these good results in future. I finally got moduleanimatethrottle to work the other day too so i must be doing something right!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...