Rain does not show in cutscenes

Rain does not show in cutscenes

Postby anne10 » 12 Jul 2017, 08:26

Hello I'm a new member to this forum. I want to contribute and have already built the game which is running. The issue is that rain does not show in cutscenes and it was suggested to me by @samuncle. The link to the issue is
https://github.com/supertuxkart/stk-code/issues/2874

Since I'm new to this, it'll be very helpful to be given some direction as to how I should proceed. Awaiting your reply..
Thanking you
anne10
 
Posts: 5
Joined: 06 Jul 2017, 21:56

Re: Rain does not show in cutscenes

Postby QwertyChouskie » 12 Jul 2017, 20:59

Related (though fixed): https://github.com/supertuxkart/stk-code/issues/1704
Might have some useful info.
User avatar
QwertyChouskie
 
Posts: 107
Joined: 29 Jun 2016, 14:57

Re: Rain does not show in cutscenes

Postby MTres19 » 12 Jul 2017, 21:41

Yes, most likely the particle emitter needs to follow the cutscene camera rather than the kart.
User avatar
MTres19
 
Posts: 150
Joined: 17 Aug 2015, 20:15

Re: Rain does not show in cutscenes

Postby Auria » 14 Jul 2017, 23:26

Another hint, take a look at Dm_sky_particles in file tracks/track.cpp and m_sky_particles_emitter in karts/controller/local_player_controller.cpp . It is indeed attached to a kart at this time
Image
User avatar
Auria
STK Moderator
 
Posts: 2812
Joined: 07 Dec 2009, 03:52

Re: Rain does not show in cutscenes

Postby anne10 » 15 Jul 2017, 11:35

Hey Auria, thanks for your suggestion..
Here what i find is "m_sky_particles_emitter" is getting initialized over here:

{l Code}: {l Select All Code}
m_sky_particles_emitter =
            new ParticleEmitter(track->getSkyParticles(),
                                core::vector3df(0.0f, 30.0f, 100.0f),
                                m_kart->getNode(),
                                true);


so i think, i need to pass instance of cut scene or the cut scene camera in place of "m_kart".
Am I right ? if so then please let me know which exact instance i need to pass over here ?

(edit by charlie/mod - wrapped the code in appropriate tags)
anne10
 
Posts: 5
Joined: 06 Jul 2017, 21:56

Re: Rain does not show in cutscenes

Postby MTres19 » 15 Jul 2017, 14:26

Sorry this isn't exactly an answer to your question, but I suggest looking at http://supertuxkart.sourceforge.net/doxygen/. You might find useful documentation there.
User avatar
MTres19
 
Posts: 150
Joined: 17 Aug 2015, 20:15

Re: Rain does not show in cutscenes

Postby Auria » 15 Jul 2017, 23:07

anne10 {l Wrote}:Hey Auria, thanks for your suggestion..
Here what i find is "m_sky_particles_emitter" is getting initialized over here:
m_sky_particles_emitter =
new ParticleEmitter(track->getSkyParticles(),
core::vector3df(0.0f, 30.0f, 100.0f),
m_kart->getNode(),
true);
so i think, i need to pass instance of cut scene or the cut scene camera in place of "m_kart".
Am I right ? if so then please let me know which exact instance i need to pass over here ?


I have not actually tried looking at the issue in detail, but from the top of my head what you are suggesting seems right

You can get the camera using Camera::getActiveCamera()->getCameraSceneNode() (graphics/camera.hpp)
Image
User avatar
Auria
STK Moderator
 
Posts: 2812
Joined: 07 Dec 2009, 03:52

Re: Rain does not show in cutscenes

Postby anne10 » 23 Jul 2017, 18:52

Hey Auria
Could you please tell me how do I test the cutscenes if I've been successful in adding rain in that or not?
Kindly reply to the question..
anne10
 
Posts: 5
Joined: 06 Jul 2017, 21:56

Re: Rain does not show in cutscenes

Postby QwertyChouskie » 23 Jul 2017, 21:06

Add:

{l Code}: {l Select All Code}
<weather particles="rain.xml" lightning="true" sound="rain"/>


to the scene.xml of a cutscene, then run the cutscene. The easiest way is to add it to the GPwin cutscene, create a custom GP in the game that just has one lap of a short race e.g. mathclass, the win that "GP" to trigger the GPwin scene.
User avatar
QwertyChouskie
 
Posts: 107
Joined: 29 Jun 2016, 14:57

Re: Rain does not show in cutscenes

Postby Auria » 23 Jul 2017, 23:43

QwertyChouskie {l Wrote}:Add:

{l Code}: {l Select All Code}
<weather particles="rain.xml" lightning="true" sound="rain"/>


to the scene.xml of a cutscene, then run the cutscene. The easiest way is to add it to the GPwin cutscene, create a custom GP in the game that just has one lap of a short race e.g. mathclass, the win that "GP" to trigger the GPwin scene.


That's right, to elaborate a bit more, cutscenes are found under the "tracks" folder in the data folder, for instance tracks/gpwin. Another way to test without having to race every time is to edit file states_screens\main_menu_screen.cpp and change "#define DEBUG_MENU_ITEM 0" to "#define DEBUG_MENU_ITEM 1", this will enable debug options on the main menu screen that make it easier to trigger cutscenes from the main menu
Image
User avatar
Auria
STK Moderator
 
Posts: 2812
Joined: 07 Dec 2009, 03:52

Re: Rain does not show in cutscenes

Postby anne10 » 30 Jul 2017, 08:09

i'm trying to add "m_sky_particles" (i.e ParticleSystem) in cutscene_world.cpp (as they are in local_player_controller.cpp), now to setup this particle system i need a camera instance to get current scene node, and a current particle kind which i have manually set to rain for now.

Here is constructor signature of "ParticleEmitter":

new ParticleEmitter (const ParticleKind* type, const Vec3 &position, scene::ISceneNode* parent = NULL, bool randomize_initial_y = false, bool important = false);

And here how i'm calling it (from CutsceneWorld::init() in cutscene_world.cpp):

Camera* stk_cam = Camera::createCamera(NULL);
m_sky_particles_emitter = new ParticleEmitter(ParticleKindManager::get()->getParticles("rain"),
core::vector3df(0.0f, 30.0f, 100.0f),
stk_cam->getCameraSceneNode(),
true);
So basically i think i need to setup this stk_cam first, based on camera of CutsceneWorld.
can anyone help to figure out how i can get the current camera over here ? and also let me know my approach is correct or not ?
anne10
 
Posts: 5
Joined: 06 Jul 2017, 21:56

Re: Rain does not show in cutscenes

Postby QwertyChouskie » 30 Jul 2017, 18:13

Maybe make the emitter a part of the camera rather than the world?
User avatar
QwertyChouskie
 
Posts: 107
Joined: 29 Jun 2016, 14:57

Re: Rain does not show in cutscenes

Postby Auria » 30 Jul 2017, 23:33

anne10 {l Wrote}:i'm trying to add "m_sky_particles" (i.e ParticleSystem) in cutscene_world.cpp (as they are in local_player_controller.cpp), now to setup this particle system i need a camera instance to get current scene node, and a current particle kind which i have manually set to rain for now.

Here is constructor signature of "ParticleEmitter":

new ParticleEmitter (const ParticleKind* type, const Vec3 &position, scene::ISceneNode* parent = NULL, bool randomize_initial_y = false, bool important = false);

And here how i'm calling it (from CutsceneWorld::init() in cutscene_world.cpp):

Camera* stk_cam = Camera::createCamera(NULL);
m_sky_particles_emitter = new ParticleEmitter(ParticleKindManager::get()->getParticles("rain"),
core::vector3df(0.0f, 30.0f, 100.0f),
stk_cam->getCameraSceneNode(),
true);
So basically i think i need to setup this stk_cam first, based on camera of CutsceneWorld.
can anyone help to figure out how i can get the current camera over here ? and also let me know my approach is correct or not ?


I have not actually tried it, but at a first glance your approach seems basically correct. Is there an issue? I don't think you mentionned what is the problem you're bumping into right now, if any
Image
User avatar
Auria
STK Moderator
 
Posts: 2812
Joined: 07 Dec 2009, 03:52

Re: Rain does not show in cutscenes

Postby anne10 » 31 Jul 2017, 06:27

I'm getting many errors when I try this approach.. After these changes are made, I encounter an error in the function:
void CutsceneWorld::createRaceGUI()
{
m_race_gui = new CutsceneGUI();
} // createRaceGUI
anne10
 
Posts: 5
Joined: 06 Jul 2017, 21:56

Re: Rain does not show in cutscenes

Postby Auria » 02 Aug 2017, 00:06

okay, can you be more specific about what the error is? I can't really help you much from such a vague description, can you use a debugger to see why it crashes?
Image
User avatar
Auria
STK Moderator
 
Posts: 2812
Joined: 07 Dec 2009, 03:52

Who is online

Users browsing this forum: No registered users and 1 guest