drug effect?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

drug effect?

Post by bongobeat »

Hello,
has anyone created somekind of drug (screen) effect? Is that possible to do?
e.g. after drinking some wine bottle or eating a special mushroom, the vision became trouble or colored, or the screen fade in/out rapidetely during a certain time.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: drug effect?

Post by Azel »

What a fun idea. Should be easy enough, something like:

1) Activate a timer that calls the FadeOut script

2) Activate a timer that calls the FadeIn script (executed after the above FadeOut call)

Rinse and repeat for a specific duration (eg, spell or potion duration)
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: drug effect?

Post by Isaac »

Xanathar did one in ORRR2. You saw the effect if your PC ate one of his special mushrooms.

https://youtu.be/mu33I-CHwP4?t=33m
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: drug effect?

Post by bongobeat »

aow! that's pretty nice! :D
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: drug effect?

Post by bongobeat »

I looked about the source in the ORR2 but I decided to make something easy for me, that may not be so nice, but here is a "psychedelic" potion:
SpoilerShow

Code: Select all

defineObject{
	name = "strange_flask",
	baseObject = "base_item",
	components = {
		{
			class = "Model",
			model = "assets/models/items/flask.fbx",
		},
		{
			class = "Item",
			uiName = "Strange Flask",
			gfxIndex = 144,
			weight = 0.3,
			traits = { "potion" },
		},
		{
			class = "UsableItem",
			--emptyItem = "flask",
			sound = "consume_potion",
			onUseItem = function(self, champion)
party.party:playScreenEffect("RGBscreen")
			end,
		},
	},
}
SpoilerShow

Code: Select all

defineParticleSystem{
	name = "RGBscreen",
	emitters = {
		-- flames
		{
--			spawnBurst = true,
			emissionRate = 1000,
			emissionTime = 20,
			maxParticles = 4000,
			sprayAngle = {0,360},
			velocity = {0,0.3},
			boxMin = {-1.1,-0.9,1},
			boxMax = {1.1,0.9,1},
			objectSpace = true,
			texture = "assets/textures/particles/flame.tga",
			frameRate = 35,
			frameSize = 32,
			frameCount = 50,
			lifetime = {0.3, 0.5},
			color0 = {2, 0, 0},
			opacity = 0.5,
			fadeIn = 0.001,
			fadeOut = 0.15,
			size = {0.4005, 0.425},
			gravity = {0,0,0},
			airResistance = 0.5,
			rotationSpeed = 2,
			blendMode = "Additive",
		},

		{
--			spawnBurst = true,
			emissionRate = 500,
			emissionTime = 20,
			maxParticles = 4000,
			sprayAngle = {0,180},
			velocity = {0,0.3},
			boxMin = {-1.1,-0.9,1},
			boxMax = {1.1,0.9,1},
			objectSpace = true,
			texture = "assets/textures/particles/slime.tga",
			frameRate = 35,
			frameSize = 32,
			frameCount = 50,
			lifetime = {0.3, 0.5},
			color0 = {0, 2, 0},
			opacity = 1,
			fadeIn = 0.001,
			fadeOut = 0.15,
			size = {0.4005, 0.425},
			gravity = {0,0,0},
			airResistance = 0.5,
			rotationSpeed = 2,
			blendMode = "Additive",
		},
		{
--			spawnBurst = true,
			emissionRate = 1500,
			emissionTime = 20,
			maxParticles = 4000,
			sprayAngle = {45,90},
			velocity = {0,0.3},
			boxMin = {-1.1,-0.9,1},
			boxMax = {1.1,0.9,1},
			objectSpace = true,
			texture = "assets/textures/particles/glow.tga",
			frameRate = 35,
			frameSize = 32,
			frameCount = 50,
			lifetime = {0.3, 0.5},
			color0 = {0, 0, 2},
			opacity = 1,
			fadeIn = 0.001,
			fadeOut = 0.15,
			size = {0.4005, 0.425},
			gravity = {0,0,0},
			airResistance = 0.5,
			rotationSpeed = 2,
			blendMode = "Additive",
		},

		-- glow
		{
--			spawnBurst = true,
			emissionRate = 1,
			emissionTime = 20,
			maxParticles = 10,

			boxMin = {0,0,1},
			boxMax = {0,0,1},
			sprayAngle = {0,30},
			velocity = {0,0},
			texture = "assets/textures/particles/glow.tga",
			lifetime = {0.5, 1},
			colorAnimation = false,
			color0 = {0, 0, 2},
			opacity = 0.8,
			fadeIn = 0.001,
			fadeOut = 0.1,
			size = {4.5, 4.1},
			gravity = {0,0,0},
			airResistance = 1,
			rotationSpeed = 2,
			blendMode = "Additive",
			objectSpace = true,
		}
	}
}
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Post Reply