Jump to content


Photo

Tree Transparency


  • Please log in to reply
44 replies to this topic

#1 _Haldir_

_Haldir_

    Mapper

  • Project Team
  • 1,181 posts
  • Location:Australia
  • Projects:The Dwarf Holds, The Elven Alliance: Community Edition
  •  T3A Team Chamber Member

Posted 16 July 2010 - 03:25 PM

I'm making a map for BFME2, and i'm wondering how i'd be able to add a fade effect to a tree in my map.ini.

I'm trying to give ObjectReskin TreeF02 GenericInteractableOptimizedTree the same fading effect as is received by some of those large Lothlorien trunks (e.g Object TreeLothlorien12. As in the object fades as the camera draws closer to the object.

The code for the camera fading seems to be this:

StaticSortLevelWhileFading = 2
	AlphaCameraFadeOuterRadius = 600
	AlphaCameraFadeInnerRadius = 200
	AlphaCameraAtInnerRadius = 10%

  End

which is under **ART PARAMETERS** in the lothlorien tree code.

Trying to paste this part of code into a map.ini under the different tree object causes a crash which says that "StaticSortLevelWhileFading" is an unknown field.
Removing that line still causes a crash though.

Could someone please point me in the right direction? I'm pretty useless at coding, but i thought that Add_ModuleTags etc were only needed for behaviours (which i didn't think it was).. :mellow:

Posted Image Posted Image


#2 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,470 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 17 July 2010 - 12:44 AM

CODE

Object TreeF02
ReplaceModule ModuleTag_01
Draw = W3DScriptedModelDraw ModuleTag_01NEW

StaticModelLODMode = yes


DefaultModelConditionState
Model = FPTree02
End

ModelConditionState = PASSENGER CLUB
Model = None
End

ModelConditionState = PASSENGER
Model = FPTree02
End

AnimationState = PASSENGER CLUB
EnteringStateFX = FX_TreeBecomeClub
End

AnimationState = PASSENGER
EnteringStateFX = FX_TreePickUp
End

; These are the model conditions and animation states required for trees that can burn.
ModelConditionState = BURNED
Model = FPTree02D2 ; use default nondeath model in place of this.
End

AnimationState = AFLAME ;Currently on fire
ParticleSysBone = None FireTreeSmall
ParticleSysBone = None TreeEmbers
End

AnimationState = DYING BURNED ;Currently on fire
ParticleSysBone = None FireTreeSmall
ParticleSysBone = None TreeEmbers
End
; End of stuff required for burn.

StaticSortLevelWhileFading = 2
AlphaCameraFadeOuterRadius = 600
AlphaCameraFadeInnerRadius = 200
AlphaCameraAtInnerRadius = 10%

End

End

End


This may do the trick .. it replaces the W3DScriptedModelDraw MODULE with a new one that has the fade code
I hope it works for you

#3 _Haldir_

_Haldir_

    Mapper

  • Project Team
  • 1,181 posts
  • Location:Australia
  • Projects:The Dwarf Holds, The Elven Alliance: Community Edition
  •  T3A Team Chamber Member

Posted 17 July 2010 - 08:58 AM

Hmm, it didn't quite work. I also fiddled around with some of the obects names, and tried commenting out various parts of the code, but with no luck. It ended up replacing my trees with the model of a different tree, which wasn't fading anyway.

Though it did get me thinking along the right lines, and i eventually managed to do it in a sort of opposite way. I've just used the code for the fading Lothlorien trees, and used the map.ini to swap the model to the tree i want.

Here's the code in case anyone else is interested:

Object TreeLothlorien12

ReplaceModule ModuleTag_01
	Draw = W3DScriptedModelDraw ModuleTag_Draw1

		DefaultModelConditionState
		Model	= FPTree02; now the mordor fort has a new sexy look
		End

		  StaticSortLevelWhileFading = 2
		AlphaCameraFadeOuterRadius = 600
		AlphaCameraFadeInnerRadius = 200
		AlphaCameraAtInnerRadius = 10%

	End
End 
End

Thanks very much for the help :mellow:

Posted Image Posted Image


#4 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 17 July 2010 - 12:08 PM

Interesting... would you mind trying that on a building like the Gondor Archery Range? I have been unable to get objects to fade using the code posted. Just change the model name from FPTree02 to the Gondor Archery Range one and tell me if it fades or not. I really appreciate it. :mellow:

signature_group1.gif

 

16821.png


#5 _Haldir_

_Haldir_

    Mapper

  • Project Team
  • 1,181 posts
  • Location:Australia
  • Projects:The Dwarf Holds, The Elven Alliance: Community Edition
  •  T3A Team Chamber Member

Posted 17 July 2010 - 03:12 PM

Hmmm, i tried it with a couple of different buildings, such as the barracks or farm, but none of them faded with the camera (though the model did change). I also tried a couple of different props that fade (e.g. the moria column or erebor mountain piece), but again, no luck with the barracks/archery range..

I was flicking through that interiors topic that you/Morgoth/Ed were discussing, and it would make sense that there's something to do with the models/skins that needs to exist before objects can use the alpha settings. All the trees seem to work fine though (probably as they used to fade in BFME 1).

I take it this is for your interiors in HDLH? Actually that reminds me, i made a nice audio script for Erebor which creates a echo/reverb in selected locations - something that might be a nice touch to your glitterring caves etc. I'll PM the details to you if you like :mellow:

Posted Image Posted Image


#6 Rob38

Rob38

    Believer of Hope

  • Hosted
  • 3,567 posts
  • Location:USA
  • Projects:Helm's Deep Last Hope
  •  One who is not afraid of new challenges

Posted 17 July 2010 - 09:30 PM

Yeah. Thanks for trying. :) And yes, please PM me the audio script whenever you get the chance. :mellow:

signature_group1.gif

 

16821.png


#7 Taralom

Taralom

    Self-proclaimed A**hole

  • Project Team
  • 1,519 posts
  • Location:Not here
  • Projects:Turned to Writing
  •  I R GOOGL'd

Posted 18 July 2010 - 03:13 PM

Model	= FPTree02; now the mordor fort has a new sexy look

Whahahahahahahaaaa :)
Did one of EA's coders write that? Man, I'd be ashamed of myself if I ever saw that back :mellow:
If the above post offended you in any way,
please take note that, until further notice, I don't care, so get lost.

#8 _Haldir_

_Haldir_

    Mapper

  • Project Team
  • 1,181 posts
  • Location:Australia
  • Projects:The Dwarf Holds, The Elven Alliance: Community Edition
  •  T3A Team Chamber Member

Posted 19 July 2010 - 03:10 AM

Haha whoops. Nah, I copied the bit of code from a map.ini of some map i downloaded, which replaced the mordor fortress with a different model. I just changed it around to work for trees instead :mellow:

That would be hilarious though.

Posted Image Posted Image


#9 Nertea

Nertea

    ...lo sa raptor!

  • Hosted
  • 3,349 posts
  • Location:Vancouver, Canada
  • Projects:Star Villains and Space heroes, The Dwarf Holds
  •  T3A Chamber Member
  • Division:BFME/Unity

Posted 19 July 2010 - 03:30 AM

When I modded Haegemonia a while back, I remember seeing some code referring to the largest explosion type as a "Big Fucking Explosion"...

Coders sometimes have senses of humor!

sig.png
I really don't do requests and my Arnor Soldier is not fit for BFME. Don't ask me for either.


#10 Fudge

Fudge

    title available

  • Project Team
  • 527 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 24 March 2013 - 12:57 PM

Does anybody know of a code that I can stick in a map.ini to stop the trees from fading?



#11 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 25 March 2013 - 12:12 AM

So trees automatically fade once units are behind it or something?


Ridder Geel

#12 Fudge

Fudge

    title available

  • Project Team
  • 527 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 25 March 2013 - 07:09 AM

Yes that's what they are doing but I want them to not fade at all.



#13 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 27 March 2013 - 03:01 PM

Try changing the kindof to something other than tree.. unless you are able to find some sort of fading line of code. See if that helps.


Ridder Geel

#14 Bofur

Bofur

    The Bolicious One

  • Hosted
  • 1,766 posts
  • Location:England
  • Projects:Age of the Firstborn
  •  The Bolicious T3A Team Chamber Member

Posted 27 March 2013 - 03:03 PM

Some trees fade, like the big Lorien ones, and some do not. So changing it from being a tree will not necessarily help...


left64_by_obsidianlake-d5ruayp.pngAotF.pngright64_by_obsidianlake-d5ruf44.png


#15 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 27 March 2013 - 05:24 PM

Well then lets compare the trees shall we?

        StaticSortLevelWhileFading = 2
    AlphaCameraFadeOuterRadius = 600
    AlphaCameraFadeInnerRadius = 200
    AlphaCameraAtInnerRadius = 10%

 

That hides the lothlorien trees... at least my guess...

Its located in the W3DScriptedModelDraw drawing behavior.

Also from what i see:

; KindOf           = SHRUBBERY IMMOBILE CLUB TREE SELECTABLE;
  KindOf           = SHRUBBERY IMMOBILE CLUB SELECTABLE;

they commented out the kindof types with the TREE in them, for some reason :p

 

Another thing to note is they use the

W3DScriptedModelDraw

instead of the

W3DTreeDraw

 

So...You now know the differences, try these things, see if it fixes your problem :)
If all the trees fade, use the W3DScriptedModelDraw without the fading code that is in the original Lothlorien trees


Edited by Ridder Geel, 27 March 2013 - 05:25 PM.

Ridder Geel

#16 Fudge

Fudge

    title available

  • Project Team
  • 527 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 28 March 2013 - 11:06 PM

Hey Ridder thanks for that but I don't even know how to implement what you said above without getting an error message, my understanding of ini is less than basic and generally I just copy Ea's original map.ini's. I hate to ask but could you post the same thing above except allow me to just paste it into my ini without requiring any more text?



#17 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 29 March 2013 - 12:36 AM

Oh.. Hm... Well I think then I might have to take some time to test the various theories and see which ones work.. that way i'm sure its done the way that I suggest :p

I'll put it on my list of things to do, perhaps i'll have some time tomorrow :)


Ridder Geel

#18 Fudge

Fudge

    title available

  • Project Team
  • 527 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 29 March 2013 - 08:16 AM

Thanks I really appreciate it and if you need anything worldbuilder wise I'd be happy to return the favour.



#19 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,837 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 30 March 2013 - 12:20 AM

K this seems to look like a solution if you have a tree that has transparency code in its draw module:

;------------------------------------------------------------------------------
Object TreeShire04
  ; *** ART Parameters ***
  Draw                  = W3DScriptedModelDraw ModuleTag_01
 
  StaticModelLODMode = yes
 
 
    DefaultModelConditionState
      Model             = SB_Tree04
    End

    ModelConditionState = PASSENGER CLUB
      Model = None
    End

    AnimationState = PASSENGER CLUB
      EnteringStateFX = FX_TreeBecomeClub
    End

    AnimationState = PASSENGER
      EnteringStateFX = FX_TreePickUp
    End
    
    ; These are the model conditions and animation states required for trees that can burn.  
    ModelConditionState = BURNED
      Model = SB_Tree04 ; use default nondeath model in place of this.
    End

    AnimationState   = AFLAME ;Currently on fire
      ParticleSysBone     = None FireTreeSmall
      ParticleSysBone     = None TreeEmbers
    End

    AnimationState   = DYING BURNED ;Currently on fire
      ParticleSysBone     = None FireTreeSmall
      ParticleSysBone     = None TreeEmbers
    End
    ; End of stuff required for burn.  

        StaticSortLevelWhileFading = 2
    AlphaCameraFadeOuterRadius = 600
    AlphaCameraFadeInnerRadius = 300
    AlphaCameraAtInnerRadius = 5%

  End
//stuff...
End

 

The code for in the map.ini would be this:

;------------------------------------------------------------------------------
Object TreeShire04
 ; *** ART Parameters ***
 ReplaceModule ModuleTag_01
  Draw                  = W3DScriptedModelDraw ModuleTag_01_New
 
  StaticModelLODMode = yes
 
 
    DefaultModelConditionState
      Model             = SB_Tree04
    End

    ModelConditionState = PASSENGER CLUB
      Model = None
    End

    AnimationState = PASSENGER CLUB
      EnteringStateFX = FX_TreeBecomeClub
    End

    AnimationState = PASSENGER
      EnteringStateFX = FX_TreePickUp
    End
    
    ; These are the model conditions and animation states required for trees that can burn.  
    ModelConditionState = BURNED
      Model = SB_Tree04 ; use default nondeath model in place of this.
    End

    AnimationState   = AFLAME ;Currently on fire
      ParticleSysBone     = None FireTreeSmall
      ParticleSysBone     = None TreeEmbers
    End

    AnimationState   = DYING BURNED ;Currently on fire
      ParticleSysBone     = None FireTreeSmall
      ParticleSysBone     = None TreeEmbers
    End
    ; End of stuff required for burn.  

  End
 End
End

Ridder Geel

#20 Fudge

Fudge

    title available

  • Project Team
  • 527 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

Posted 30 March 2013 - 12:08 PM

Right well I tried this out and I changed the object name to "F01" but unfortunately the tree still fades. Maybe the radius for the trees fade could be dramatically reduced?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users