I am making a horror game and would like to do 3 things in my game using this:
minigames;
cameras;
A map that locates the monsters.
Maybe I think of other things, but for just that.
I would like to know if you can do some interaction like click on something that was being transmitted or am i asking for too much?
You can make MiniGames with Logic Bricks.
Cameras you can switch with the scene actuator.
Not possible without using Python.
Your looking for RenderToTexture function which displays Movies or live-camera-feed as a Movie.
Mouse-Over or Mouse-Over-Any sensor.
If you want more advice mouse-cursor interactions then use the Python function hitPosition (only works with Mouse-Over, Mouse-Over-Any, Ray, Radar, Near sensors)
Actually you can use 1 script (render to texture)
And the rest can be nodes
Use camera distance > x as a âswitchâ to make things appear differently for minimal camera using alpha antialiasing
You got it wrong, these are the things I want to convey.
There will be a camera in another part of the scene that will have the things I want to convey. As the minigame, which in a part of the scene that the player can not reach, goes to do some actions such as walking, jumping, among others. And the material has to transmit what is in this camera in real time.
how do i do it?
from bge import logic, texture
scene_main = logic.getSceneList()['Main']:
mapcam = scene_main.objects[âmapcamâ]
cont = logic.getCurrentController()
own = cont.owner
matID = texture.materialID(own, âIMmapâ)
map_png = texture.Texture(own, matID)
source = texture.ImageRender(scene_main, mapcam)
source.background = (20, 20, 20, 255)
map_png.source = source
def main():
map_png.refresh(True)
main()
What is your main scenes name?
The other camera name?
The name is Game1
Edit the script so the scene name, and camera 2 name are correct
If this does not work, open the py console and print screen the error messages
Lol, this is a simple typo of @BluePrintRandom (it happens to the best of us)
Remove the -
:
In -
scene_main = logic.getSceneList()[âMainâ]:
So now I removed the typo & the line looks like this -
scene_main = logic.getSceneList()[âMainâ]
Full script without typo -
from bge import logic, texture
scene_main = logic.getSceneList()['Main']:
mapcam = scene_main.objects[âmapcamâ]
cont = logic.getCurrentController()
own = cont.owner
matID = texture.materialID(own, âIMmapâ)
map_png = texture.Texture(own, matID)
source = texture.ImageRender(scene_main, mapcam)
source.background = (20, 20, 20, 255)
map_png.source = source
def main():
map_png.refresh(True)
main()
âCameraNameâ
not
CameraName
are you using quotes ? ?
it looks like you may be using something else by the error
also you may want to work on performance / scene handling that rasterizer usage is very high
paste the code here not a image
ok
from bge import logic, texture
scene_main = logic.getSceneList()[âGame1â]
mapcam = scene_main.objects[mapcam]
cont = logic.getCurrentController()
own = cont.ownermatID = texture.materialID(own, âIMmapâ)
map_png = texture.Texture(own, matID)source = texture.ImageRender(scene_main, mapcam)
source.background = (20, 20, 20, 255)map_png.source = source
def main():
map_png.refresh(True)
main()
from bge import logic, texture
scene_main = logic.getSceneList()["Game1"]
mapcam = scene_main.objects["mapcam"]
cont = logic.getCurrentController()
own = cont.owner
matID = texture.materialID(own, "IMmap")
map_png = texture.Texture(own, matID)
source = texture.ImageRender(scene_main, mapcam)
source.background = (20, 20, 20, 255)
map_png.source = source
def main():
map_png.refresh(True)
main()
yeah you were using some weird symbols not quotes