Jump to content
The Dark Mod Forums
demagogue

Newbie DarkRadiant Questions

Recommended Posts

Destined, the pauseGUI routine is worrisome. The tdm_events.script entry for it has this warning, that it interferes with execution of normal threads, but unfortunately gives no hint how to create a thread by "a special SDK method":

/**
 * Pauses the game. This should only be called for threads that are explicitly maintained
 * by a special SDK method, because ordinary threads won't get executed during g_stopTime == true.
 * Note: This is used by the objective GUI threads.
 * Note: Must be called on the player entity, not the sys entity.
 */

Share this post


Link to post
Share on other sites

Yeah, I saw that note, but if you start the GUI before in teh script, it might still work. Or you would have to teleport the player after all, but you could avoid using the whole camera and wall setup, which maybe would still make it easier.

Share this post


Link to post
Share on other sites

Regarding that thread note, the worry I have is not so much starting the GUI, but whether you could get the game to resume afterwards. Dunno.

Share this post


Link to post
Share on other sites

Pausing the game would probably be the most elegant solution, but you can probably get away with using the camera to freeze the player's controls and calling that video overlay which covers the whole screen. The player wouldn't know the difference.

If the cutscene should be shown in an area that AI can access it'd be best to teleport the player to a safe blue room while the cutscene is playing.

Share this post


Link to post
Share on other sites

Hm, I want to show a message during a cutscene (by using sys.trigger() on an atdm:gui_message entity) but as long as there's an active func_cameraview it doesn't show up, while outside of the cutscene it shows up fine.

This is despite cinematic 1 being set on the entity. Also tried force 1, which made it show for just a split second. Has anyone pulled this off before?

Share this post


Link to post
Share on other sites

IIRC, If your cam view is an overlay, as part of the request to create the overlay, you can give the overlay a layer number.

Perhaps you can look at the def of the message overlay to see if you can give it a higher layer number than the cam view?

  • Thanks 1

Share this post


Link to post
Share on other sites

@grayman thank you for the promising idea, but it doesn't seem to be what it takes.

I've started with cloning & renaming the message scriptobject + def, with the difference that it calls the message gui with layer 101 instead of 10 (and I set cinematic 1 inside DR). That didn't change things.

Then I lifted the bare essentials from the scriptobject and turned it into a map script. Tried layer 11, 16, 26, 51, 102, 250, 1002... works fine except when there's a func_cameraview active.

Spoiler

void message_cutscene()
{
	entity test_camera	= $test_camera;

	test_camera.activate($player1);						//start the camera

	float gui = $player1.createOverlay("guis/tdm_message.gui", 1002);	//create message and show for 6s
	$player1.setGuiInt(gui, "msg_lines", 1);
	$player1.setGuiString(gui, "msg_text", "text");
	sys.wait(6);

	$player1.callGui(gui, "doFadeOut");					//fade out & reset message
	sys.wait(1);
	$player1.destroyOverlay(gui);
	gui = 0;

	test_camera.activate($player1);						//stop the camera
}

 

I'd take a look at the func_cameraview's coding but that seems to be buried in the source code, which is a different beast from Doomscript.

I don't know... do you have an idea what's going wrong?

Share this post


Link to post
Share on other sites

No idea at all.

A quick glance through the player camera code indicates that the screen is simply taken over by the camera's viewport. No GUI involved. My suggestion is invalid if the camera doesn't use a GUI to paint the screen.

Looks like this is a dead end.

I can't think of another way to do it.

Share this post


Link to post
Share on other sites

Had another idea: tried calling the overlay on the camera instead of the player, since they both have their own viewports. Still no dice, so it looks like we've got a proper bug here. Also tried a different GUI, guis/underwater/underwater_greengrey_thickmurk.gui.

Having thought about this I can convey my meaning more than well enough by a change in sound and lighting alone - maybe that's the best way anyway. But it does feel like cutscenes would be a fairly common usage case for messages.

Share this post


Link to post
Share on other sites

I guess a "change in sound" could include voice-over audio, perhaps delivered by an off-screen narrator AI. Though lots more effort to do that well than a text message.

Share this post


Link to post
Share on other sites

How does one change a normal object and make it appear as if it is all gold, in my case a main objective is to be a gold plated object. Changing material definitions?

Share this post


Link to post
Share on other sites

You can make a skin that swaps all existing materials (~= textures) with a tiling gold material. Rename a .txt to .skin and create a skins folder in your fm, then put this into it:
skin name_of skin

{
model name_of_model

name_of_original_material name_of_new_material
}

 

Can have multiple models and material swaps in one skin definition.

Then in DR click on File -> Reload Skins and in TDM enter into the console reloadDecls (can bind that to a hotkey).

 

@Geep yes, that's still feasible. Voiceovers are generally prime solutions, but in this case it'd also be reasonable to go a more subtle route.

  • Thanks 1

Share this post


Link to post
Share on other sites

A small addition: In order to get all the "name_of_the_original_material"s for your skin, you can use "Create Model" in DR and select the model you want to create the skin for. On the lefter side there is a list with all materials used in that model.

Edited by Destined
Spelling
  • Thanks 1

Share this post


Link to post
Share on other sites

I was able to get an .mp4 video+.ogg audio to run as a briefing in my test map, by cloning the methods and assets used in Goldwell's Shadows of Northdale ACT II. (I'll be writing that up for the wiki. @Springheel, see my PM).

I'm now trying to get the same vid to play as a non-briefing full screen. Dragofer, at one point you seemed to imply that this could be done without a func_camera and videoWall, just using an GUI overlay. So I tried that, having a trigger call this target in <fm>.script:

void dovideo() {
  float overlayHandle = $player1.createOverlay( "guis/overlay_video.gui", 100 );
  sys.wait(5);
  $player1.destroyOverlay( overlayHandle );
}

Where the 5 second wait is just a placeholder for whatever would really be needed. Which in turn invokes my overlay_video.gui:
 

Spoiler

 

windowDef OverLayVid
{
    rect        0,0,640,480
    visible        0

#define MY_VID "video/briefing_video.mp4"

    windowDef Video
    {
        rect        0, 0, 640, 480
        background    MY_VID
        matcolor    1,1,1,1
        backcolor    0,0,0,1
        
        onTime 0
        {
            set "Video::background" MY_VID;
            resetCinematics ; // Reset Video to start
            set "Video::matcolor" "1,1,1,1" ; // Show video
        }

        onNamedEvent CinematicEnd
        {
            // Hide video
            set "HideBriefingVideo::notime" "0";
            resetTime "HideBriefingVideo" 0;
        }
    }
    
    // Utility windowDef to hide the video,
    // called when all video fragments are done playing
    windowDef HideBriefingVideo
    {
        noTime 1
        onTime 0
        {
            set "notime" "1";
        }
    }
}

 

I know the gui is being parsed, though whether I structured it correctly, don't know. But nothing happens in-game. So should I just move on to deploy a videoWall+func_camera? And forget about createOverlay call, just activate the camera pointing to a videoWall painted with overlay_briefing.gui?

Share this post


Link to post
Share on other sites

It would seem you can make an ingame video GUI overlay, but at this point you know more than I do. If this were me working on it I'd try to start with a standard message scroll GUI and convert it step by step into a fullscreen video.

Share this post


Link to post
Share on other sites

I'm going over to the func_cameraview and video-on-ingame-surface method now. Using a .gui more like Drumple's RoQ example, and generally sticking close to his method. No luck so far in getting video to appear on wall, though (either mp4 or roq).

Share this post


Link to post
Share on other sites

I want to activate torch flames through completion targets from the objectives editor.

The flame entities received the following properties:

grafik.png.bd16046e7d428be88bfab826f9ccc998.png

 

Result: triggering only activates the light texture, but not the particle effect. What is my mistake?

 

Share this post


Link to post
Share on other sites
10 hours ago, Dragofer said:

Might be because you have start_off 1 even though you only need extinguished 1 for a flame light?

I've tried your suggestion as well on both a combination of flame entity plus torch torch model  and one of the torch entities:

invisible_flames.jpg.9cf23cc2689b153cc272bde8faa5933c.jpg

 

After triggering, only the "light" (or whatever you call that) of the flame is visible, but not the flame particle effect itself.

:( :(

 

 

Share this post


Link to post
Share on other sites

Instead of a trigger you could use the S/R-system with a response effect "Turn extinguishable Light On". It is more effort than a simple trigger, but it is explicitly designed for extinguishable lights.

Share this post


Link to post
Share on other sites
1 hour ago, Dragofer said:

@JackFarmeralright one last thing before we descend into S/R, how does it work when you use start_off 1 and extinguished 0?

Then it looks like in the shot above plus the flame is visible.

I thought it would be possible to trigger torches like regular lights. :( :( :(

 

Edited by JackFarmer

Share this post


Link to post
Share on other sites

@JackFarmer If the flame entity is def_attached to a torch you can trigger the torch to toggle the flame. If it doesn't work for a torch, then I 100% know it will for an oil lamp like atdm:lamp_oil_wall_hanging_lit. Can start with that lamp entity and modify it to your liking.


If you want special properties on the flame, i.e. custom light_radius, you can use "set light_radius on flame" etc. spawnargs.

Check the name_attach spawnarg on the lamp/torch to see if the def_attached flame is really called "flame".

  • Like 1

Share this post


Link to post
Share on other sites
54 minutes ago, Dragofer said:

@JackFarmer If the flame entity is def_attached to a torch you can trigger the torch to toggle the flame. If it doesn't work for a torch, then I 100% know it will for an oil lamp like atdm:lamp_oil_wall_hanging_lit. Can start with that lamp entity and modify it to your liking.


If you want special properties on the flame, i.e. custom light_radius, you can use "set light_radius on flame" etc. spawnargs.

Check the name_attach spawnarg on the lamp/torch to see if the def_attached flame is really called "flame".

Thanks, will check and revert to you.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...