Aller au contenu

Photo

Elven lamppost model and placeable


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Phaenan

Phaenan
  • Members
  • 315 messages
Long story short, I'm trying to get my lil' hands on a lit elven light placeable. The placeable available by default refers to the plc_elvenlight_0 model, but since I saw another kind of lamp in the west part of the Brecilian forest, I supposed there would be an asset, or non-placeable thingy (pardon my french, I'm a coder and 3D modeling stuff/terminology isn't exactly one of my fortes :?) for this lit lamppost.
Basically that's the placeable :
Image IPB
And that's what we can see here and there in-game :
Image IPB

So I read around a bit, finally got my hands on DATool and started looking for an another model I could make a lit lamppost placeable with. And so far, I pretty much browsed through all the props, and a large bunch of other stuff without any luck. So I'm starting to doubt my method.

I opened the West Brecilian area in the toolset and saw nothing. The lamppost is shown already lit so there's obviously no script involved, nor any VFX applied at the right place, yada yada.
Has anyone some pointers ? Or is it simply impossible to recover this thingy and extract/reuse its model ?

Modifié par Phaenan, 14 février 2010 - 02:29 .


#2
BioSpirit

BioSpirit
  • Members
  • 261 messages
For me it looks like it's the one and the same model in both pictures. It's only effected by different kind of lighting environment. Sorry, I can't understand what's the actual problem. If the problem is in how light is effecting to the model it could be possibly fixed by re-texturing a copy of the model.

What is wrong in the elven light placeable ? Why won't it work ?

Modifié par BioSpirit, 14 février 2010 - 10:05 .


#3
Phaenan

Phaenan
  • Members
  • 315 messages
The problem is I want to get my hands on a "lit placeable" or at least being able to create one. The placeable version is simply not lit, and considering I have to generate it on the go (and thus can't rely on the area editor lights tools) I'm just looking for some kind of solution. VFX not being an option because they are hooked at the base of the model. But that, I can prolly change by editing the model or the VFX, I suppose. (no idea how, but if need be I will find)



Basically, if I understand correctly what you're saying, it's the same model but the "lit version" just have some lighting applied to it. I suppose it's some kind of pre-processed light and there is nothing much to be done about it ? Not sure I actually understand, truth be told.

#4
BioSpirit

BioSpirit
  • Members
  • 261 messages
Ok, I think I got it.  So, if the upper image is what you have now and the lower image is what you want. Since, the object is a placeable you need a VFX to lit it. Atleast I don't know any other way to create a light source using scripting. Of course, it would be better to have a placeable that woud include the light source but I don't think it's possible.

Since, a placeable do have a script. That script could create the light source (VFX) when the placeable is spawn.  You may need to create a dummy (unvisible) object in a position where you want the VFX to appear.  But the problem is the nVFXId, There is a lot of VFXs listed in VFX_Base.xls but it could be difficult to find a good one. So, you may need to create the VFX you need. Creating a VFX is easy but I don't know how to make them appear in a game. If someone could explain that it would help us both. 


case EVENT_TYPE_SPAWN:
  object oDummy = CreateObject(...);
  ApplyEffectVisualEffect(OBJECT_SELF, oDummy , nVFXId, EFFECT_DURATION_TYPE_PERMANENT, 1.0);
  break;

#5
hunharibo

hunharibo
  • Members
  • 126 messages
"static" type light should effect placeables just fine, only baked type lights dont.

#6
Phaenan

Phaenan
  • Members
  • 315 messages

BioSpirit wrote...
Of course, it would be better to have a placeable that woud include the light source but I don't think it's possible.


Cheers for clearing that up for me. I wasn't sure if I had to look for a model thingy solution, or not. As I said, I'm pretty ignorant when it comes to this "art" stuff. But well, if I wasn't clueless about it I guess I wouldn't ask for guidance. ^_^


Creating a VFX is easy but I don't know how to make them appear in a game. If someone could explain that it would help us both.


That, I know of and can answer if need be : we're back on my scripting domain. ^_~
I will have to create / modify a VFX however, as I couldn't find one placing the light right where it makes sense. Usually the VFX is applied at ground level. But there is a nice VFX creation tutorial on the wiki, so it won't be a problem.
And that way, I'll be able to make my lamp switchable through players clicks. Useless, hence indispensable. :o


case EVENT_TYPE_SPAWN:
  object oDummy = CreateObject(...);
  ApplyEffectVisualEffect(OBJECT_SELF, oDummy , nVFXId, EFFECT_DURATION_TYPE_PERMANENT, 1.0);
  break;


Yep, ApplyEffectVisualEffect() would work just fine. Among other possibilities one can also create a VFX structure with Effect() and use SetEffectEngineInteger() to specify which VFX to use, which in turn allow the utilisation of other routines such as Engine_ApplyEffectAtLocation() etc.
effect eLamplight = Effect(EFFECT_TYPE_VISUAL_EFFECT);
eLamplight = SetEffectEngineInteger(eLamplight, EFFECT_INTEGER_VFX, iEffectID);
Engine_ApplyEffectAtLocation(EFFECT_DURATION_TYPE_PERMANENT, eLamplight, Location(oArea, Vector(x,y,z), angle), 0.0f, oEffectCreator);

#7
BioSpirit

BioSpirit
  • Members
  • 261 messages
Looks like it's possible to define emissive materials in models and placeables. But this doens't solve the problem if you want the environment to be lighted by the elven light.

This is a material object of the lyrium_light:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Exported by Material Editor --><!-- dc:source=file:///c:/BioWareDrive/DragonAge/SourceControl/ArtContent/Art/Levels/Materials/OutsourcedProps11.matproj --><MaterialObject Name="Plc_LyriumLight">
    <Material Name="Prop.mat"></Material>
    <DefaultSemantic Name="Default"></DefaultSemantic>
    <Texture Name="mml_tDiffuse" ResName="p_lyrium_light_01d.dds"></Texture>
    <Texture Name="mml_tNormalMap" ResName="p_lyrium_light_01n.dds"></Texture>
    <Texture Name="mml_tSpecularMask" ResName="p_lyrium_light_01s.dds"></Texture>
    <Texture Name="mml_tEmissiveMask" ResName="p_lyrium_light_01e.dds"></Texture>
</MaterialObject>


#8
Phaenan

Phaenan
  • Members
  • 315 messages
I kinda managed to do it by creating a new VFX. The VFX editor is kinda scary tho, even with the tutorials at hand. I'll be happy to go back to my code after that. ^_~"
Hopefully the OC sources available on the project pages helped quite a lot.

Image IPB

The result isn't perfect yet, as from some angles the light is cut off by the placeable lamp itself, but I guess that's just a matter of a transparence/collision map somewhere on the placeable. I'll fix that when I'll get the time, and at last I'll have my totally not crucial lit tree lump. ^_^


Once again, cheers for your help !

Modifié par Phaenan, 16 février 2010 - 07:04 .


#9
BioSpirit

BioSpirit
  • Members
  • 261 messages
I desided to give a try to solve the problem. So, here is a mini-tutorial to create a lit elven light placeable.

Image IPB

Here are some files needed in the tutorial:  users.kymp.net/p501474a/Tutorial.zip

1. place VFX_elvenlight.GDA  in  .../YourModule/module/override/toolsetexport/
2. Open ElvenLight.vfxproj with the toolset and post to local
3. Create a new script and grap a content from elven_light.nss
4. Create a new placeable and select Appearance "Elven Light" and select the script you created (elven_light.nss)

Note that the light effect is not visible in a toolset.

Modifié par BioSpirit, 17 février 2010 - 06:06 .