Page 3 of 6

Re: [Models] Captivated by Captive

Posted: Mon Jan 14, 2013 9:09 pm
by BuzzJ
Well, to be fair, I need to make edits in both objects.lua and wall_sets.lua, and the exact nature of those changes isn't covered in the tutorial.

I'm still owrking out some strange problems I found, but the model is showing up now.

my objects.lua looks like this:

defineObject{
name = "CaptiveWall001",
class = "Decoration",
model = "mod_assets/models/CaptiveWall001.fbx",
placement = "wall",
replacesWall = true,
editorIcon = 50,
}

and my wallsets looks like this:

defineWallSet{
name = "Captive",
randomFloorFacing = true,

floors = {
"assets/models/env/temple_floor_01.fbx", 30,
"assets/models/env/temple_floor_drainage.fbx", 1,
},

walls = {
"mod_assets/models/CaptiveWall001.fbx", 50,
"assets/models/env/temple_wall_01.fbx", 50,
"assets/models/env/temple_wall_drainage.fbx", 1,
},

pillars = {
"assets/models/env/temple_pillar.fbx", 1,
},

ceilings = {
"assets/models/env/temple_ceiling.fbx", 1,
},

ceilingShafts = {
"assets/models/env/temple_ceiling_pit.fbx", 1,
},

floorDecorations = {
},

wallDecorations = {
"assets/models/env/metal_hooks_wall.fbx", 1,
"assets/models/env/metal_hooks_chain_wall.fbx", 1,
},

pillarDecorations = {
"assets/models/env/metal_hook_pillar.fbx", 1,
"assets/models/env/metal_hook_chain_pillar.fbx", 1,
"assets/models/env/metal_ring_pillar.fbx", 1,
},
}

however there is more to do. At present, when I place these, they seem to show me the invisible backside in the direction that they should be facing the front. When I go around them it displays nortmally at least, so the model is correct. Now I just need to see what changes need to be made in the object.

Re: [Models] Captivated by Captive

Posted: Mon Jan 14, 2013 9:38 pm
by hyteria
i had the same prob with wall , i dunno why but they need to be reversed ( well the front must be the back) dunno if i m clear haha

Re: [Models] Captivated by Captive

Posted: Mon Jan 14, 2013 9:58 pm
by BuzzJ
Yep, I flipped it 180 on the Z axis in blender after I knew everything else worked, and it worked like a charm.

Now I'm working out how to avoid there being automatic pillars placed.

Re: [Models] Captivated by Captive

Posted: Tue Jan 15, 2013 3:14 am
by Neikun
You could use a model with a transparent texture for generated pillars.

Re: [Models] Captivated by Captive

Posted: Tue Jan 15, 2013 9:20 pm
by BuzzJ
Could anyone explain to me how a wall decoration, where I don't want the back wall to be replaced, but just add the decoration on top of the wall model is scripted?

I mean, I have a power outlet that is a seperate model from the wall it goes onto, and I'd like it to be placed on top of the wall, not instead of it.

Re: [Models] Captivated by Captive

Posted: Tue Jan 15, 2013 9:27 pm
by msyblade
Believe u can just add a line to the def that says

replacesWall = false,

Re: [Models] Captivated by Captive

Posted: Tue Jan 15, 2013 9:44 pm
by Sutekh
I'd do it the same way you'd add a bench to the wall. For example:

Code: Select all

defineObject{
   name = "northern_dungeon_bench",
   class = "Decoration",
   model = "mod_assets/models/northern_dungeon/northern_dungeon_bench.fbx",
   placement = "wall",
   editorIcon = 92,
   }

Re: [Models] Captivated by Captive

Posted: Wed Jan 16, 2013 3:02 am
by Neikun
msyblade wrote:Believe u can just add a line to the def that says

replaceWall = false,
*replacesWall = false,

Re: [Models] Captivated by Captive

Posted: Wed Jan 16, 2013 5:39 am
by BuzzJ
Thanks for the prompt replies. I am usually asking questions in advance. Acyually, I've been on a modelling kick, that desk was a short diversion to keep from being bored; so far I have almost enough assets to do an entire tileset; so that's why I'm not really scripting them in, UVmapping takes a bit of time.

But here is another in advance question:

I want to make a wall decoration emit light, sort of like how the torch emits light; but in a persistent way, where you can't remove the torch. Sort of like how the healing crystal emits light. Any leads on the script code that allows this? Yes, I could just look into the scripts, but when I ask questions like this I figure that somebody reading later will come across it, and be like "a-ha!", so it might be useful in that way.

I'm really looking forward to being able to share the sci-fi themed assets with you all, but there are a bunch of assets I want to have in and functional before I move onto phase 2: the scriptening

Re: [Models] Captivated by Captive

Posted: Wed Jan 16, 2013 11:51 am
by Komag
probably the simplest "quick and dirty" way would be to just define a light source object (in your objects.lua) and then place one near each of your decorations:

Code: Select all

defineObject{
	name = "my_decoration_light",
	class = "LightSource",
	lightPosition = vec(0, 2, 0), -- x,y,z, center of square, 2 meters up; if you want near wall, adjust x and z
	lightRange = 12, -- this is in meters I believe, so about four squares
	lightColor = vec(1,1,1), -- RGB, white; temple lamp is (0.35, 0.98, 1.5)
	brightness = 25,
	castShadow = false,
	flicker = false, -- torches are set to true for the wavering light effect
--	particleSystem = "my_decoration_particles", -- if you want to set something up in your particles.lua
	placement = "floor",
	editorIcon = 88,
}
I'm not sure how to set it up for the decoration object itself to serve as a light source so you don't have to place separate lights. If you are going to do a LOT of them, that might be worth finding out, but for just a few, this method is easy