Changing the "tipvids"?

HypergripHypergrip SuspectGermany Join Date: 2002-11-23 Member: 9689Members, NS1 Playtester, Contributor
edited March 2013 in Modding
Hi,

I just tried to play around with the new "tipvids" that show up after you die. I was thinking about using some "drill instructor" footage from the "Space Above & Beyond" series (you know, for "motivation")
However simply replacing the video files does not seem to do the trick. Anybody else had any success getting this to work as a mod?

The way I tried it:
- record some videos in the same resolution as the tipvids (720x480)
- convert the videos to webm format using Miro Video Converter
- rename the files to match the original vidtips
- create a mod with the /tipvideos/ directory containing the new videos

The mod installs fine however the videos will not play (the replaced videos will not trigger any kind of popup, the videos that are not replaced will however play just fine).

If any of you want to play around with it, I attached a zip with the 8 webm video files I wanted to use.

Comments

  • RioRio Join Date: 2005-01-28 Member: 38716Members
    There's a file called GUITipVideo_Data.lua which contains all the videos assigned to a table called gTipVideos. Because the table is global, you just need to add your videos to it:
    // MyGUITipVideo_Data.lua
    local tinsert = table.insert
    // key needs to be unique
    // videoUrl needs to contain the file name of the video
    // teamNumber is 1 for marines, 2 for aliens
    // playerClass can be Player or any life form like Gorge, Skulk, JetpackMarine
    tinsert(gTipVideos, {key = "TIPVIDEO_AWESOME_TIP", videoUrl = gTipVideoUrlPrefix.."AwesomeTip.webm", teamNumber=2, playerClass="Skulk"})
    
    This would add a video for the Skulk named AwesomeTip.webm.

    The video counter gets incremented every time the video plays and a video gets only played once. You can reset the counter in your options.xml which is located here:
    \Steam\your_steam_id\4920\remote\options.xml
    There should be entries like this:
    <TIPVIDEO_1_PLAYER_UPGRADESTRUCTURES>2</TIPVIDEO_1_PLAYER_UPGRADESTRUCTURES>
    
    Just set the value to 0 or delete the entry and the video will play again.
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    edited March 2013
    Currently it doesn't work in the way the Workshop mods work, it isn't using the folder structure to add or overwrite the tipvids. I've asked Steven about this and he and Max will probably have a look at how the folder system is handled for the tip videos. Or I'm doing something completely wrong, I want to test Rio's lua next up.

    It would be nice if the GUITipVideo_Data.lua would be excluded from consistency checking, while still checking for valid tipvids data. I've got it working btw and want to create a few trolltips as a parody of the official ones, while still being informative. Here's a test video showing that it can be done

    However consistency checking needs to be off to allow the GUITipVideo_Data.lua to be used. And currently, the *.webm files need to be located in the official "ns2/tipvideos/" folder



    The official videos are encoded as follows (res is the most important). I'm recording in 720p and downsize them to "720x480" before using Free WebM Encoder. Now this is not the same ratio of course, but that is what it says in the other tipvids lua file :P
    Video:

    Codec: Google/On2's VP8 Video (VP80)
    Resolution: 720x480
    Frame rate: 50
    Decoded Format: Planar 4:2:0 YUV


    Audio:

    Codec: Vorbis Audio (vorb)
    Channels: Stereo
    Sample Rate: 48000Hz
    Bitrate: 112kb/s
    Encoder: Lavc54.91.103

    Rio wrote: »
    The video counter gets incremented every time the video plays and a video gets only played once. You can reset the counter in your options.xml which is located here:
    \Steam\your_steam_id\4920\remote\options.xml
    There should be entries like this:
    <TIPVIDEO_1_PLAYER_UPGRADESTRUCTURES>2</TIPVIDEO_1_PLAYER_UPGRADESTRUCTURES>
    
    Just set the value to 0 or delete the entry and the video will play again.

    There is a console command for this as well, which resets all videos though. And it seems you don't have to add them manually to the xml file, Spark handles that for you.

    resettipvids
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    Kouji_San wrote: »
    However consistency checking needs to be off to allow the GUITipVideo_Data.lua to be used.
    You don't need to turn consistency checking off. Just need to add GUITipVideo_Data.lua to the list of excluded files in the settings like:
    {
    "check": [ "game_setup.xml", "*.lua", "*.screenfx", "*.surface_shader", "*.fxh", "*.render_setup", "*.shader_template", "*.fsb", "*.dds", "*.model", "*.material", "*.level", "*.cinematic", "*.fx" ]
    "ignore": [ "GUITipVideo_Data.lua" ]
    }
    
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    edited March 2013
    But wouldn't that open up the lua to, shady scripting though in that particular file? And it still requires servers to do this right :(
  • RioRio Join Date: 2005-01-28 Member: 38716Members
    edited March 2013
    I forgot to say, that the key of the tip video is also the language gamestring for the tip text, e.g.:
    // gamestrings/enUS.txt
    TIPVIDEO_1_EXOSUIT_EXOEGGS = "Exosuits may crush eggs by walking over them"
    
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    Kouji_San wrote: »
    But wouldn't that open up the lua to, shady scripting though in that particular file? And it still requires servers to do this right :(
    Yeah, but less so than simply disabling consistency checking. As a practical matter, as long as you aren't telling everyone which files you're excluding from the consistency checking, its unlikely someone would figure out which files are vulnerable. Its obviously not the desired, long-term solution, but it would work in the short term for people who want to make their server custom tipvid-friendly.
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
  • FuleFule Join Date: 2009-06-04 Member: 67683Members
    "tipvids" from Full Metal Jacket would be awesome :D
Sign In or Register to comment.