Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

I'm trying to make a cut scene with just a still camera. I'm using a func_cameraview and a target_null. I use scripts to activate the camera and teleport the player. The screen is switched to the new view but the AI refuse to move. They stand still in their paths and swing their arms like rubber. I have teleported the player in a close vicinity of the AI but still same problem. What am I doing wrong?

Link to comment
Share on other sites

I'm trying to make a cut scene with just a still camera. I'm using a func_cameraview and a target_null. I use scripts to activate the camera and teleport the player. The screen is switched to the new view but the AI refuse to move. They stand still in their paths and swing their arms like rubber. I have teleported the player in a close vicinity of the AI but still same problem. What am I doing wrong?

 

Do all the entities that are involved with the cutscene have "cinematic 1" spawnarg? Sounds like they don't...

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Ahh, ha! Shall test again. (I followed Graymans tut but tried to implement it in my main mission at once...)

 

 

 

Yes

 

 

Once more I'm defeated by the superiority of the forums :blush:

 

Thank you!

Edited by Fieldmedic
Link to comment
Share on other sites

I did a search but only a year old question from Sotha appeared on how to make epilogues. I couldn't find any real answer on this issue so I decided ask here about it, since I bet others may find it interresting.

 

In essence an epilogue is a "halt-from-showing-mission-completed-and-statistics" and instead show a cutscene and/or readables.

 

My goal:

 

The player has finished the mission and then I want the game to fade to black, a GUI shall appear, then a cutscene and THEN, the Mission finished shall come.

 

How and where do I add the scripts so that the mission goes to this events on completing?

Link to comment
Share on other sites

The player has finished the mission and then I want the game to fade to black, a GUI shall appear, then a cutscene and THEN, the Mission finished shall come.

 

How and where do I add the scripts so that the mission goes to this events on completing?

 

Could you have it:

  • Player goes to mission finish location
  • Fade to black
  • Cutscene
  • Mission completed, statistics

If this would work for you, you could reverse engineer Grayman's Somewhere Above the City. That mission has that kind of epilogue. It is as simple as showing an ordinary cutscene, but only after player has completed all the visible objectives. You must have one objective not checked off to keep the mission running and not completing before cutscene.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Haha, just girlfriend atm ;)

 

I'm thinking of an invisible objective that has the finished script set to the script that starts the epilogue, then, after the epilogue is done, the scripts triggers a change_objective_state that completes the visible "Go here when done"-objective, and the mission should finish with the statistics.

 

So, yes, as you say, Fidcal.

 

This may be a killer mission! :)

Link to comment
Share on other sites

Mission completed videos will be possible with greebo's new Campaign code in 1.06. It's as easy as inserting the name of the video and sound file you want to use. The video is played as soon as the mission is completed, but before the Mission complete stat screen.

 

A Score to Settle will demonstrate its use.

Link to comment
Share on other sites

Is there any way to make a command in a script that requires the player to press a button to make the script continue? Like a waitforkeystroke, next...

 

 

 

Another question

 

I get a warning; GetPointOutsideObstacles: no valid point found

 

What exactly does this imply? It feels like some AI is trying to go where he don't belong. I do have animal_patrol 1 on one AI, but removing him does not remove the problem...

Edited by Fieldmedic
Link to comment
Share on other sites

I dunno about the warning but if you keep getting it then first killmonsters in the console to see if that stops it. That will confirm it is an AI thing. If so then delete AI one by one (or in groupls) in a copy of the map until the error stops. Then tail him to see where the error comes up.

 

AFAIK there is no script event to await a special key press but I could be wrong of course. What I would do is create a global variable called say float g_keypressed; then in the script put a loop that keeps testing if that is 1 say something like....

 

while (g_keypressed ==0)
{
sys.wait(0.5);
}

 

Then create another script function to set it to 1 and call that from a lever or button in the game.

Link to comment
Share on other sites

Okay...but the player is out of control, it's a readable I want to put into the epilogue. As it is now, it's two GUI:s that displays text, with a sys.wait between them so the player can read. But it would be more slick if the player could control the flow by pressing a key or something...

Link to comment
Share on other sites

If it's a gui you could easily have a "next" button you click to progress. There's already multiple guis that do this now that give you a model.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

If it's a gui you could easily have a "next" button you click to progress. There's already multiple guis that do this now that give you a model.

 

Or even next, previous and exit buttons, which are exactly what my button controlled briefing does.

 

I don't know how to show (or stop showing) guis to the player ingame, but I can explain the principle the gui works with, if you choose to go with that.

 

For static text, buttons are always better than an arbitrary delay which is either too long or too short.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I thought about the button controlled briefing, but couldn't figure out exactly which arguments I should extract from the button controlled briefing-gui and add to mine, and so I hoped for a more easy solution. rolleyes.gif

 

Perhaps we gould work something out, Sotha :)

Link to comment
Share on other sites

I thought about the button controlled briefing, but couldn't figure out exactly which arguments I should extract from the button controlled briefing-gui and add to mine, and so I hoped for a more easy solution. rolleyes.gif

 

Perhaps we gould work something out, Sotha :)

 

Okay. It works like this. Imagine the readable as stages. You if you have three 'screenfulls' of text, you have three stages: page one, page two and page three.

 

Imagine what must be visible at each stage to make the readable work.

Stage 1 must have the following visible:

  • Page 1 text
  • Next button 2 (the button that takes the user from stage 1 to stage 2)
  • The exit button

Stage 2 must have:

  • Page 2 text
  • Next button 3 (from page 2 to page 3)
  • Previous button 1 (from page 2 to page 1)
  • The exit button

Stage 3 must have:

  • Page 3 text
  • Previous button 2 (from page 3 to page 2)
  • The exit button

Now you have everything you need to build the logic. In principle your gui is a mess, which contains everything on top of each other. The gui has all the text and all the buttons in there all the time. The trick is to control what is show at which time. When you start, you define everything into your gui using the normal gui coding.

 

Here's an example of what might be your page 1 text box.

	
windowDef BriefingText1
{
	rect 45,20,550,200
	visible	1
	forecolor	1, 1, 0.8, 0.7
	font		BRIEFING_TEXT_FONT
	textscale	BRIEFING_TEXT_SCALE
	text "text here"

}

You place all your pagefuls of text using these

 

Here's an example how to make the buttons:

	
windowDef NextButton1 {
	rect	330,435,42,15
	visible 1
	background	"guis/assets/next_arrow"
	onAction {

			set "BriefingText2::visible" "1";
			set "NextButton2::visible" "1";
			set "PrevButton1::visible" "1";
			set "BriefingText1::visible" "0";
			set "NextButton1::visible" "0";

			set "BriefingMovingPicture1::visible" "0"; 
	}

	}

You define the location in rect-part. Visibile toggles visibility of THIS object. background is the image what the button looks like. onAction means what happens when the button gets pushed. Important things are the set "something::visible" "1"

Pay attention to these. These control the visibility of other objects in this gui.

set "BriefingText2::visible" "1"; Makes the briefingtext2 object visible.

set "BriefingText1::visible" "0"; Makes the briefingtext1 object invisible.

 

When the readable initializes, you need to reach stage 1. To reach that stage you must hide everything except the things that must be seen in stage 1.

Initialization:

  • Hide everything
  • Show page 1 text
  • Show Next button 2
  • Show exit button

You have all your gui objects in the gui all the time. To do the intialization, you set the visible param in each of the objects so that when the briefing stars evertyhing else has visible 0, but the stage 1 objects have visible 1.

 

To move to the next stage, the player needs to click the next button. Pressing the next button must do the following to reach the stage 2.

  • Hide everything in stage 1.
  • Show page 2 text
  • Show nextbutton 3
  • Show previousbutton 1

So basically the onAction block for nextbutton 2 (the one that takes the player from stage 1 to stage 2) would look like

			set "BriefingText1::visible" "0";
			set "NextButton2::visible" "0";

			set "BriefingText2::visible" "1";
			set "PrevButton1::visible" "1";
			set "NextButton3::visible" "1";

The button goes from stage 1 to stage 2. What it does is:

Hide the briefingtext1 and the nextbutton2. (hide the stuff which was shown in stage 1)

Show briefingtext2, previousbutton1 and nextbutton3 (show the stuff which must be shown in stage 2.)

 

Nextbutton 3 should then

  • Hide evertyhing
  • Show page 3
  • Show previous button 2
  • Show the exit button

So don't try to copy parts from the mainmenu_briefing.gui. There is a lot of unneeded stuff there and it is imperative that you understand what you're doing. Work the logic and the objects by yourself to avoid mistakes. I think you will avoid trouble since you know your own work. Write down what must be visible at which stage. Define the objects (textboxes, buttons) in the gui. Then adjust the onAction blocks to make the right things visible and invisible.

 

Remember, everything is in the gui at all times. You define all objects, but set everything invisible in the part where you define the objects. Stage 1 objects must be visible at start.

Then the buttons simply hide and show the things you want to be visible at a certain stage.

 

Good luck, lemme know if you didn't get something.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

We really need a good wiki tutorial on gui scripting. I was looking yesterday for backcolor and realized there is virtually nothing except perhaps related things like triggering a gui from script or the title loader gui in start map, etc.

Link to comment
Share on other sites

We really need a good wiki tutorial on gui scripting. I was looking yesterday for backcolor and realized there is virtually nothing except perhaps related things like triggering a gui from script or the title loader gui in start map, etc.

 

Aye. It also looks our gui scripting skills are fragmented. Not a single person knows it all, some know this topic, another something else.

 

I guess if Fieldmedic manages to pull this off, he's one of the guys who know the most about ingame guis...

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

It feels more like I'm venturing into the rectum at this moment as I try to pull of this cumbersome task :ph34r:

 

BTW (I just cannot let go of my easy-way-around-solutions :laugh:) but shouldn't it be possible to target a readable from the script and when that one is closed --> continue script/start another script with the rest of the tut...

 

I tried to add a readable and target it via a $epilogue_scroll.activate($player1);

 

 

It didn't work...:huh:

 

 

 

So, I'm inside the elephant's arse if you need me...!

Edited by Fieldmedic
Link to comment
Share on other sites

I don't know if a readable can be activated separate from the entity.

 

You might try making a static readable entity. Test if first normally. Then try activating it or triggering it as an entity to see if that works. But I'm sceptical because the code test if the player has turned away from a static readable and since it might be far away in a blue room I wonder what would happen.

 

Another approach might be to make a moveable readable, put it into the player's inventory, trigger it somehow (I don't know how) then when closed remove it from the inventory.

 

All horribly messy. I just don't know. What is the context? Why would the player suddenly be reading a readable?

Link to comment
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.


  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...