Page 1 of 1

Completing a Mod - Cinematics/Ending [Solved]

Posted: Wed Apr 01, 2015 2:12 pm
by Slayer82
I require some assistance in getting the proper ending to complete my mod.
I am using an unlocked portal to instigate the cinematic sequence to complete the game. It works, as it should, except I do not wish to have the default LoG2 ending.

I have created more simple epilogue scroll for the game's end, but cannot get it to function.

I have also converted it to an .ivf file and tested in-game using the GameMode.playVideo(filename) function and it does work (once exported).
In addition, I have added the correct pathname using the GameMode.completeGame(filename) function. The path mod_assets/cinematics/"myexampleofanending".ivf is correct too.
Looking at the portal.lua file, I can see where it looks to commence the ending sequence, but I cannot get it to work.

Once this is solved I will be able to complete testing and finally release it.

Hopefully, this is the last time I will need to bother people here by asking for help.

Re: Completing a Mod - Cinematics/Ending

Posted: Wed Apr 01, 2015 2:37 pm
by Isaac
Slayer82 wrote:The path mod_assets/cinematics/"myexampleofanending".ivf
Is this a forum typo (as I expect), or a copy/paste from the script?

Could you paste the actual script you are using?

I just tried this myself:

Code: Select all

function complete()
GameMode.completeGame("mod_assets/video/custom.ivf")
end
... and it works when called.

(But it would work whatever the path; so long as it exists within the mod_assets folder; or subfolders)

Re: Completing a Mod - Cinematics/Ending

Posted: Wed Apr 01, 2015 3:25 pm
by Slayer82
What I typed before was just an example.
Here is the script I'm using
SpoilerShow
function ending()
GameMode.completeGame("mod_assets/cinematics/creditsending.ivf")
end
Both the name of the .ivf file and the path are correct. Do you know what the issue is?

Re: Completing a Mod - Cinematics/Ending

Posted: Wed Apr 01, 2015 4:57 pm
by Isaac
The portal has a portal component with an 'onArrival' hook present. This hook plays the end-game video.

Either change the onArrival hook function to play your own video instead, or you can disable the portal component in the editor, but then you won't get the fade to white effect, done automatically. Good if your video starts out solid black.

Re: Completing a Mod - Cinematics/Ending

Posted: Thu Apr 02, 2015 2:43 am
by Slayer82
Thank you for taking the time to assist me.
However, I am confused as to how the onArrival hook function works. If I uncheck the portal component on the portal object, then the players walk through it as it is not engaged. Therefore, there is no ending.
If it is checked, then the players will walk through triggering the default ending.
How will the game read my script_entity if there is nothing to trigger it?
It makes sense what you are saying, I'm just finding it difficult to comprehend.

Is there a need to edit the objects/portal.lua file?

It must be frustrating trying to convey a simple concept, but I do put in a lot of hours before asking for help.
Cheers.

Re: Completing a Mod - Cinematics/Ending

Posted: Thu Apr 02, 2015 3:51 am
by minmay
PortalComponent has an onArrival field which is a function executed when the party passes through the PortalComponent. Look at objects/portal.lua and define a new version of whichever portal you want, with an onArrival hook that plays the video you want.

Re: Completing a Mod - Cinematics/Ending

Posted: Thu Apr 02, 2015 4:11 am
by Isaac
minmay wrote:Look at objects/portal.lua and define a new version of whichever portal you want, with an onArrival hook that plays the video you want.
This is also what I would recommend. However, it is certainly possible to place a floor trigger on the spot past the portal, and use that to trigger the script instead. You'll lose the automatic portal fade effect though.

Alternatively, you could redefine the portal component at runtime:

Code: Select all

portal_1:createComponent("Portal")
		:addConnector("onArrival", self.go.id, "arrivalHook");

function arrivalHook()
	GameMode.completeGame("mod_assets/cinematics/creditsending.ivf")
end

Re: Completing a Mod - Cinematics/Ending

Posted: Thu Apr 02, 2015 6:16 am
by Slayer82
Excellent! Thanks for the help.
Finally, after more than four months I have completed my mod!

If it weren't for people like you assisting and pointing others in the right direction, then I'm sure many mods would still be incomplete.

Thanks, again.