Searching python code

this is more of a question …

is there a way to control the mist in bge by python ?.. cause animating it wont work
how can enable or disable or even control its dens and distance.

and also how can i control the sky color, cause also animating it wont work !!

Does Particle System Works?

particle system dosnt work bge ? or at least last i checked !

I Don’t Know But… Maybe Try Test Simple Particle System On 2.8 or Other Blender Version And Import In… If I’m Not Mistaken There’s A Different Way To Import Particle System Than Import A Typical Mesh :slight_smile: And Can Also Try Convert Particle System Into A Mesh And Import In :wink:

that sounds complected !!

Have You Try Convert The Particle System Into A Mesh? Because Hair Is Also A Particle System… I Try To Import Hair Once But Doesn’t Show But After Convert Into A Mesh It Can… There Is An Option When After You Made Your Particle System You Can Convert It Into A Mesh… That Options Also Have In Bge :slight_smile: But For Hair It’s Better Use Hair Cards… :slight_smile:

oh yeas… i use this when i want to create grass and trees ,
but how can i use it for mist and sky ?

I’m Not Gonna explain too details… But search tutorial on how to make smoke simulation or mist… Then Just make simple ones… If does not show in Bge… Try Convert it into Mesh including its animation :slight_smile: And Also Look For Tutorials on how to import a Particle System if your not doing it on Bge :slight_smile: Grass Is A Solid Matter… It’s The Same Thing Only That It’s Emission Or Non Solid… There Is A Node For That Which I Forgot The Name Which Achieve A Ghostly Effects :slight_smile: Owh And For Sky… You Need To Make A Sky Dome… If Your Planning On Making Day And Night Cycle You Need To Make Code To Rotate The Dome… But That Is Just One Way… :slight_smile: But If You Have A Video File That Simulate Day And Night U Can Use That As Moving Sky Textures :slight_smile:

1 Like

ill try and search that !

Are you looking for this? Here’s an example of world properties changed at runtime using Python.

import bge

def main(cont):
	
	own = cont.owner
	world = own.scene.world
	
	sens = cont.sensors[0]
	
	# Always running with positive pulse mode
	if sens.positive:
		
		# Enables mist if not already
		if not world.mistEnable:
			world.mistEnable = True
			
		# Decreases the mist distance
		if world.mistDistance > 0:
			world.mistDistance -= 0.1

exMist.blend (95.2 KB)

ok that seems a bit promising … let me see !

i just make my own mist with nodes “mistifyr”. and use a sky sphere for the back ground.

the blender i use doesnt allow changing actual world color so i had to get creative

take a look in the documentation
https://docs.blender.org/api/blender_python_api_master/bge.types.KX_WorldInfo.html?highlight=mistdistance#bge.types.KX_WorldInfo.mistDistance

i did used to do that. but i want to change the mist color with the environment light !!!

i dont understand python !!!

here, i made a simple setup so you can change stuff via logic bricks.
mist.blend (480.2 KB)
press space to see mist distance change and change color

ok that seems to work … thanks alot …
i will try to add to this