Page 136 of 396

Re: Ask a simple question, get a simple answer

Posted: Sat Aug 06, 2016 7:50 pm
by bongobeat
Hey there,

is that possible to make a stair that did not show the fade in animation?

(it's for somekind of stair, used to go in a 2nd floor in the same level)

Re: Ask a simple question, get a simple answer

Posted: Sat Aug 06, 2016 7:56 pm
by THOM
I had the same question a while ago. The answer was: No! If not minm- ...erm, a tech-freak meanwhile found a solution...

Re: Ask a simple question, get a simple answer

Posted: Sat Aug 06, 2016 10:35 pm
by zimberzimber
THOM wrote:I had the same question a while ago. The answer was: No! If not minm- ...erm, a tech-freak meanwhile found a solution...
You could have an instant fade in apply once you go up/down the stairs.
Your party will jump a bit forward and there might be a single frame of blackness, but its something

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 12:08 am
by bongobeat
ok based on what you've say here what I 've done:

SpoilerShow
Image
2 floor_triggers (on the screenshot, one is just where I stay - 2nd floor, one is at the bottom of the stairs), that trigger a timer and which timer trigger a script:

timer is set to 0.01 in interval, disable self should not be set, so the timer repetively trigger the scripts, until it is stopped by others floor_trigger. In this case I have put those floor trigger plates all around the trigger plate that start the timer.

the script is about to fade quickly:
SpoilerShow

Code: Select all

function noBlackScreen()
	GameMode.fadeIn(0x0,0.001)
end
SpoilerShow
Image
(I did not use a timer on the first time, and place the trigger plates, directly on the first square of the stairs, but it seems that the stairs has priority against the floor trigger, and the game didn't take in count the fadeIn things. So finaly I use a timer which runs infinitely, this works.)

So, it runs perfect until the party come at the end of the stair, where a quick black screen is shown, immediately fading in by the timer.

The bottom stair is a model (used to go up), in fact there is the only model that is shown. The upper stair(used to go down) is just an invisible stair without model, there is also an invisible platform on the same height of the upper stair, or the party will run into big troubles.

bottom stair:
SpoilerShow

Code: Select all

defineObject{
	name = "stairs_up_open",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/stairs_up_open.fbx",
			staticShadow = true,
		},
		{
			class = "Stairs",
			direction = "up",
		},
		{
			class = "Obstacle",
			blockMonsters = true,
			blockParty = false,
			blockItems = true,
		},
	},
	placement = "floor",
	killHeightmap = true,
	editorIcon = 44,
	automapIcon = 96,
}
the bottom stairs block the items


upper stair:
SpoilerShow

Code: Select all

defineObject{
	name = "stairs_down_empty",
	components = {
		{
			class = "Stairs",
			direction = "down",
		},
		{
			class = "Obstacle",
			blockMonsters = true,
			blockParty = false,
			blockItems = false,
		},
	},
	placement = "floor",
	killHeightmap = true,
	editorIcon = 48,
	automapIcon = 100,
}
the upper stairs let the items pass.

the side wall at the entrance of the bottom stair are not real wall but wall_decoration, if not the stairs kill basic walls. So they have no occluders, well, I didn't try to use occluders on a wall decoration.
Also there is the issue with the ceilings, which are removed on top of the stairs.


I tryed with fake stairs and invisible teleporters to go up and down, but I like more the walking on stairs effect.

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 1:40 am
by zimberzimber
You can bypass stairs killing walls/floors/pillars by initially placing them somewhere else where it won't interfere with anything, then have a script run on game start that'll move them to where you need em'.

Image
There is a stairs model (from sx_towntileset) that functions as a platform for the tile above it, so the party won't fall down and cause some horrible issues.
script entity above left stairs:

Code: Select all

dungeon_stairs_up_1:setPosition(self.go.x, self.go.y, self.go.facing, self.go.elevation, self.go.level)
script entity above right stairs:

Code: Select all

dungeon_stairs_down_4:setPosition(self.go.x, self.go.y, self.go.facing, self.go.elevation, self.go.level)
script entity above the others:

Code: Select all

function stairsFade()
  GameMode.fadeIn(0, 0)
end
-- There is a timer (not shown in the screenshot) that triggers this function every 0.01 seconds
scripts set the stairs to their location, stairs have invisible models and a custom location. However, I assume this'll be problematic if a player is to save/load a game.

Here's what it looks like in game: (Model is from sx_towntileset)
(The black frame is not seen in this gif due to compression)
Image

As you can see, they party 'jumps' a bit forward when using this method, which is why I prefer having fade in/out.

Biggest issue is the stairs killing pillars/floors/ceiling.
Floor isn't a problem, can be added to the stairs up as their model, and set the material based on what you need,
Placing ceilings manually works fine.
Pillars though... I have no idea how to fix em without a custom model. I tried using a high pillar and just place them below/above the required location, but placing the upper one didn't work because it got removed by stairs_down. An impractical fix would be editing a pillars model to look like its where you need it, but its real location is on a lower height.

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 2:18 am
by Isaac
Have you tried setting a custom destination for the stairs-down object, to the cell where the stairs-up object is?

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 3:00 am
by zimberzimber
Same effect as having a teleporter teleport you to a teleporter that would teleport you to the previous teleporter :P

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 6:24 am
by zimberzimber
I remember reading somewhere that you can attach items(models) to monsters via script, but I can't find it anywhere, nor am I able to figure it out myself.
Anyone knows anything about this, or was I just hallucinating?

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 7:41 am
by minmay
The parentNode component property makes the component adopt the transform of a node in a ModelComponent on the same object (location, rotation, scale). For example, the air_elemental monster uses it to keep the SoundComponent at the same 3D position as the monster's head:

Code: Select all

		{
			class = "Sound",
			sound = "air_elemental_wind",
			parentNode = "head",
		},
and the eyctopus monster uses it so the particles for the ink cloud come out of the monster's nether regions:

Code: Select all

		{
			class = "Particle",
			name = "analParticle",
			parentNode = "anal",
			particleSystem = "eyctopus_fart",
			enabled = false,
			--debugDraw = true,
		},
It's also supported on ModelComponent, LightComponent, and probably more. This object in ORRR3 uses it to make a ratling NPC hold a piece of cheese, without needing any new models, just a new animation.

Code: Select all

defineObject{
	name = "or3_ratling_smith",
	placement = "floor",
	components = {
		{
			class = "Model",
			model = "assets/models/monsters/ratling3.fbx",
			boundBox = {pos=vec(0,0.9,0.2),size=vec(3,1.8,2.5)},
			materialOverrides = {pistol="nothing"},
		},
		{
			class = "Model",
			name = "cheese",
			model = "assets/models/items/cheese.fbx",
			parentNode = "sword",
		},
		{
			class = "Animation",
			animations = {
				idle = "mod_assets/core/animations/ratling3_anvil_idle.fbx",
				getUp = "mod_assets/core/animations/ratling1_idle.fbx",
				hit = "assets/animations/monsters/ratling/ratling3_get_hit_front_left.fbx",
			},
			currentLevelOnly = true,
			playOnInit = "idle",
			loop = true,
		},
	},
	editorIcon = 4,
}

Re: Ask a simple question, get a simple answer

Posted: Sun Aug 07, 2016 8:04 am
by zimberzimber
Attaching a model to a node for monsters with scaled down animations scales down the attached model, but the parent mesh gets resized to its original state :lol:
Rescaling models didn't help fixing it