Displaying images mid-game

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Displaying images mid-game

Post by nichg »

It seems like you can only start and end the game with cinematics. So if you want to do things like display a level heading as someone enters the level, or have 2D art displayed on screen, it seems like a different trick is needed.

My thought on this was to use the ability of the game to render a 'screenEffect' for certain spell effects. For instance, the full-screen flames you see when you're hit with a fireburst. So the idea is to make a new particle system for a screenEffect that would display text, and attach it to a spell effect that can produce a screenEffect (preferably without causing damage, but that can be gotten around using disable tricks or an OnDamage hook).

Here screen1.tga (screen1.dds) is a texture I've defined to display some text headings.

Code: Select all

defineParticleSystem{
   name = "flash_screen_1",
   emitters = {
		{
			spawnBurst = true,
			emissionRate = 1,
			emissionTime = 0,
			maxParticles = 1,
			boxMin = {0,0,2},
			boxMax = {0,0,2},
			sprayAngle = {60,60},
			velocity = {0,0},
			texture = "mod_assets/textures/screen1.tga",
			lifetime = {5.0, 5.0},
			colorAnimation = false,
			color0 = {1, 1, 1},
			opacity = 1.0,
			fadeIn = 1.0,
			fadeOut = 5.0,
			size = {2.3, 2.3},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 0,
			blendMode = "Translucent",
			objectSpace = true,
		}
	}
}

defineObject{
	name = "textburst1",
	class = "BurstSpell",
	screenEffect = "flash_screen_1",
	particleSystem = "torch",
	lightColor = vec(0.75, 0.4, 0.25),
	lightBrightness = 40,
	lightRange = 4,
	sound = "fireburst",
	attackPower = 0,
	damageType = "fire",
	--cameraShake = true,
	tags = { "spell" },
}


So far so good, I've managed to render the custom screenEffect. The problem is, it always seems to occur at a random angle. This is true regardless of what I set sprayAngle to. Any idea how to pin down the angle and make it fixed, or is this a dead end?
Decayer
Posts: 65
Joined: Sat Oct 13, 2012 3:19 pm

Re: Displaying images mid-game

Post by Decayer »

Has anyone found a solution to this?
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Displaying images mid-game

Post by Neikun »

Can you post a screenshot of that particle in action?
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
Decayer
Posts: 65
Joined: Sat Oct 13, 2012 3:19 pm

Re: Displaying images mid-game

Post by Decayer »

I didn't make the original post, but the texture is rotated randomly on creation, like if you picked one of the frames in this gif at random: http://www.fmsinc.com/microsoftaccess/c ... g-text.gif
nichg
Posts: 48
Joined: Thu Oct 11, 2012 12:38 pm

Re: Displaying images mid-game

Post by nichg »

Yeah, sorry, didn't get to this till now. Here's a shot from the dungeon editor.

http://steamcommunity.com/sharedfiles/f ... =103953124

Edit: I've made some progress. There's an undocumented function playScreenEffect in Party that you can use to directly display a screen-space particle system without requiring e.g. a burst spell to cause damage. Its still rotated though. Another interesting effect is if you turn off objectSpace, you can have text that floats in the air right between two tiles. Would be good for shimmering curtains of runes if we could get the orientation correct.
Post Reply