Jump to content

Home

Learning to build Doors - GtkRadiant 1.5.0


StaffSaberist

Recommended Posts

Yeah, it can help speed, but I think its possible to hinder it as well. Sometimes its good to block the vis.... you know so it doesn't draw all the crap behind it. The pillars aren't too big of a deal though, I think. I could be wrong.

 

Whilst placing everything in a task is not an error, it's unnecessary and will clutter the script. Only commands whose execution you intend to monitor are useful in tasks, like a move command if you want to know when the movement is finished. set_invisible is an instantaneous command, and thus placing it in a task doesn't actually profit anything. Unless you place a bunch of commands in the task and use the task multiple time inside the affect.

 

Yeah, thats true, I forgot about that. I started out always using tasks... and then eventually slowly started doing what your saying. Then I stopped scripting so... yeah.

Link to comment
Share on other sites

  • Replies 153
  • Created
  • Last Reply

Each NPC is given the key: NPC_target and a targetcounter is given a corresponding targetname. Set the counter count to represent the number of the NPCs with the particular NPC_target key.

 

Attention should be paid, however, to the peculiarity of the target_counter. The _counter's target is not often triggered, if the _counter is targeted directly to it. There oft needs to be a trigger_once (or _multiple if the _counter is reset) between the _counter and the intended target. Place this logical trigger for example inside an architectural detail brush so that no characters walks into it by accident.

 

OK, just to make absolutely sure I understand this, I'm going to list the steps I think you are telling me to do. Let me know if I got it or not.

 

1. I give all enemy NPC's the key NPC_target and give them all the same value for that key.

 

2. I create a Trigger_counter brush and place it anywhere I want. I set the key counter with the value equal to the number of NPC_targets (eg. if I have 13 enemies, key counter is set to 13)

 

3. I create a Trigger_once inside a detail brush of some kind and target it at the _counter.

 

4. I script the cutscene as desired.

 

I get the feeling I botched this one up big time...

 

The rift also has fog. That helps for ambience at distances. And by the way, if you set things to detail, they won't block the player's view, but will decrease the number of generated portals, which I believe helps speeds in itself.

 

Setting things to detail cut my compile time into 1/6 what in normally took (this was before I scrapped most of it), so I won't complain. And if structural brushes block whatever's drawn behind it... it would improve the framerate of the battle if I made the pillars structural! That right?

 

Yeah. That could be ambient. Enter it in worldspawn. I might also suggest _minlight key as well. Unlike ambient, it just makes sure no place has lighting below the given value, so it doesn't add to surfaces already having lighting. Well, at least that's how I've understood it. I used _minlight in Syndicate, instead of ambient.

 

Sounds good to me. I'll add that in GtkRadiant 1.5.0. I find myself going back and forth between the two versions. That's right: I never got rid of 1.5. The reason is that it is a heckuva lot easier in a few ways:

 

1 - I can select multiple faces at once with the press of a key. I may be doing it wrong, but I only seem to be able to do it one at a time with 1.4.

 

2 - I can select entities such as worldspawn much easier. It just works better for me.

 

My real gripe with 1.5 is that half the textures didn't load and show up as "shader image missing". AACK!

 

Is there a way to set the color of that _minilight? If there is, I may not need to use fog.

Link to comment
Share on other sites

Also, I am trying to make a simple script for a cutscene where a Jedi runs to am object_ref, walks to another, and so on. But the "Run to" and the "Walk to" mentioned in the manual isn't there. Do I need to do this in Notepad? If I do, I may never need BehavEd again...

 

Sorry for double-post, my computer locks up whenever I edit that last post.

Link to comment
Share on other sites

Setting things to detail cut my compile time into 1/6 what in normally took (this was before I scrapped most of it), so I won't complain. And if structural brushes block whatever's drawn behind it... it would improve the framerate of the battle if I made the pillars structural! That right?

In general, "major" structural elements like walls dividing two rooms or large structures that you generally won't be able to see around or through should be structural brushes, and everything else should be detail brushes. In your case, unless these pillars are humongous, they should be detail brushes within the structural hull of the map. For a good overview of the detail/structural brush distinction, check out this site: http://www.nibsworld.com/rtcw/tutorial_detail_and_hint_brushes_part1.shtml. It's for RTCW, but it's the same engine and the same principles.

 

Regarding ambient light: it's generally NOT a good idea to have any ambient light above a level of 15-20. Anything more than that washes out shadows and looks generally awful. If you want lighter shadows, you can use _minlight as lassev suggested. If you want to actually light the map, go with light entities or light-emitting shaders. The color can be set by adding the key "_color" and value "r g b" in normalized RGB. The lighting effects in t3_rift were enhanced by fog, which can be entered as a global fog in the worldspawn entity. The JA SDK comes with the t3_rift .map file, so you can jsut open it up, and check the worldspawn to see what was done!

Sounds good to me. I'll add that in GtkRadiant 1.5.0. I find myself going back and forth between the two versions. That's right: I never got rid of 1.5. The reason is that it is a heckuva lot easier in a few ways:

 

1 - I can select multiple faces at once with the press of a key. I may be doing it wrong, but I only seem to be able to do it one at a time with 1.4.

 

2 - I can select entities such as worldspawn much easier. It just works better for me.

 

My real gripe with 1.5 is that half the textures didn't load and show up as "shader image missing". AACK!

In 1.4.0, you can just hold CTRL+SHIFT and drag the mouse across all the faces you want to select ("paint-select" them) or hold CTRL+ALT+SHIFT and single-click each face to select or deselect it.

 

To select an entity, just SHIFT+click on it's bounding box in the editor, then you can press N to bring up the entity inspector. For the worldspawn (and ONLY for the worldspawn) you should press ESC a few times to make sure nothing is selected and then press N to bring up the entity inspector. That should be the worldspawn right there...if not, click on "worldspawn" in the list of entities given. So far as I know this functionality has not changed from 1.4.0 to 1.5.0.

Link to comment
Share on other sites

3. I create a Trigger_once inside a detail brush of some kind and target it at the _counter.

 

This is obviously wrong. It has to be the other way around. Target the counter to the trigger. The order of targeting is of fundamental importance, because the targeted entity gets the targetname key and the targeting entity gets the target key. After that target the trigger to a target_scriptrunner.

 

Also, I am trying to make a simple script for a cutscene where a Jedi runs to am object_ref, walks to another, and so on. But the "Run to" and the "Walk to" mentioned in the manual isn't there. Do I need to do this in Notepad? If I do, I may never need BehavEd again...

I'm positively sure I have no idea what you are talking about. I don't think there exists an entity called object_ref. And there certainly aren't commands called "walk to" and "run to". When you want an NPC to walk or run somewhere, you place a waypoint_navgoal to the desired target location and then in a script set the set_navgoal command to make the NPC move there. Also you can set in a script if you want the NPC to walk or run.

 

It sounds to me like you read a manual for some other game altogether...

Link to comment
Share on other sites

Sorry, it's ref_tag, and what I want is to have a character run to a specific point on the map, then continue to other points I set up. I saw in the BEHAVED MANUAL that RunTo and WalkTo were MACROS, meaning they have the [ and ] symbol. I'm pretty positive that rings a few bells, lassev. I know this, I play a lot of levels you took part in, and a lot of the action is walking.

 

An example - Syndicate: Initiation had characters walking, and voices playing. I get how to play voices; I want to know how to get an NPC to run from Point A to Point B! So far, that's all I need to know for now. Sorry if I confused you. I'll get back to work when I am sober. (j/k)

 

EDIT - I hit ESC a bunch of times and hit N. It brought up the info for the last thing I selected. So I said "select worldspawn" in the Entity list and it highlighted a brush. So, I hit N again, and I got the entity list for worldspawn. I set the key MINLIGHT and the vakue 10. The room was pitch-black when I loaded it.

 

EDIT II - lassev, sorry if I sound angry. The heat in this room is getting to me.

 

"Anger leads to hate, hate... leads to suffering"

 

-Yoda

 

Well, I'd sure as heck suffer if I lost my help with this level! ;)

Link to comment
Share on other sites

Macros can't contain any commands not otherwise supported. And furthermore, there aren't macros called RunTo or WalkTo (unless you make them youself). The default macros don't contain anything other than boolean commands (and a preset behavior_state, a special table command) - nothing to edit, that is.

 

There actually was a very nice waypoint / navgoaling tutorial, but it hasn't been online for a couple of years. It demonstrated some tricks of the process in a good way, and was also an otherwise proficient set of instructions. I have it on HD, locally, but I can't host it publicly anywhere as that would break copyrights.

 

Edit: The key is _minlight. The underscore probably isn't there just for extra kicks...

Link to comment
Share on other sites

Darn, that stinks! I looked on my tutorial page and it has waypoints, but not scripting. It also says that I need to script waypoints for a saber-wielding character, since it's scripts override the waypoints. Well, not even my Stormies follow the [flamin] waypoints, and the tut site is incomplete. I'll look as hard as I can. All I really should need is the command used to do this. I know it's possible, every level I see worth d/ling has it! Anyway, bring on Google!

Link to comment
Share on other sites

EDIT - I hit ESC a bunch of times and hit N. It brought up the info for the last thing I selected. So I said "select worldspawn" in the Entity list and it highlighted a brush. So, I hit N again, and I got the entity list for worldspawn. I set the key MINLIGHT and the vakue 10. The room was pitch-black when I loaded it.

The key should be "_minLight" with an underscore.

Link to comment
Share on other sites

Ordinary waypoints are totally passive entities used only by the game AI, automatically. You can't do anything with them via scripting. Waypoint_navgoals are used in scripts to set the target locations of NPC movement. However, when the NPC moves to a designated navgoal, it can use an existing waypoint network, if you have built one.

 

For the worldspawn (and ONLY for the worldspawn) you should press ESC a few times to make sure nothing is selected and then press N to bring up the entity inspector. That should be the worldspawn right there...if not, click on "worldspawn" in the list of entities given. So far as I know this functionality has not changed from 1.4.0 to 1.5.0.

I have never quite understood this. If you select any brush that isn't a part of an entity, aren't you accessing the worldspawn?

Link to comment
Share on other sites

I have never quite understood this. If you select any brush that isn't a part of an entity, aren't you accessing the worldspawn?

 

 

Yup.

 

An example - Syndicate: Initiation had characters walking, and voices playing. I get how to play voices; I want to know how to get an NPC to run from Point A to Point B! So far, that's all I need to know for now. Sorry if I confused you. I'll get back to work when I am sober. (j/k)

 

Hmmm... I basically told you already, use affect, task, command, do.

 

Set up your NPC_Targetname like before. Throw in your Nav_goals with targetname "whatever_you_want" (No " and im not sure if spaces work)

 

Affect npc_Targetname

task Walk

set navgoal "Navgoal's_targetname"

do walk

 

As for talking use the same setup, but throw in sound channel voice or something like that, with the path to the voice file.

 

Oh and a quick tip:

 

You can throw multiple "set" commands in a task group. For example I could put the set_navgoal and sound channel voice in the same task, and then do will do them at the same time (so the NPC would walk and talk)

 

Sometimes you can mix up animations aswell (for future reference) I would use set_anim_upper file while walking. For example I would use set_anim_upper and the animation when you put your hands behind your back, and tell the NPC to walk, that way he would walk with his hands behind his back (with the affect, task, command, do setup)

 

Hope this helps some...

Link to comment
Share on other sites

Sure did. Sorry if I didn't get it at first. Show me one way, it's a way to do that particular thing. Show me two ways, and I understand it all. OK. done. Though lassev, I believe, said somethin' about not needing to use a task. thanks, lu - WHOA! You're not luke! You're an impostor!

 

 

 

Either that or you changed your name. The second one's most likely. ;)

Link to comment
Share on other sites

Heh, yeah, changed my name :D

 

Well, theres certain things you need tasks for. Then theres certain things you don't need them for. I am sure walking requires task, but I could be wrong. Im not sure about talking though... :-\ I normally use tasks when I am not sure, just because as long as its set right its guaranteed to work... :D

Link to comment
Share on other sites

Here's the odd part: When I tried doing this in BehavEd, I got compile errors, but when I did it in Notepad, opened it up and re-compiled, it went down perfectly.

 

My days of using BehavEd may be shortlived after this point... but it is a wonderful tool to learn the language. Actually, it's not that complex, it's a watered down version of vB programming. Anyway, I'm going to playtest my new cutscene!

 

Edit: Hmm. the Jedi didn't go anywhere. Here's the coding I have now:

 

//Generated by BehavEd

camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );

affect ( "SceneJedi", /*@AFFECT_TYPE*/ FLUSH )
{
//$"walkOnly"@5
set ( /*!*/ "SET_BEHAVIOR_STATE", /*!*/ "BS_DEFAULT" );
set ( /*!*/ "SET_WALKING", /*!*/ "true" );
set ( /*!*/ "SET_RUNNING", /*!*/ "false" );
set ( /*!*/ "SET_IGNOREALERTS", /*!*/ "true" );
set ( /*!*/ "SET_LOOK_FOR_ENEMIES", /*!*/ "false" );
set ( "navgoal", "t2" );
}

wait ( $8000$ );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, $5000$ );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );

affect ( "SceneJedi", /*@AFFECT_TYPE*/ FLUSH )
{
//$"runOnly"@5
set ( /*!*/ "SET_BEHAVIOR_STATE", /*!*/ "BS_DEFAULT" );
set ( /*!*/ "SET_WALKING", /*!*/ "false" );
set ( /*!*/ "SET_RUNNING", /*!*/ "true" );
set ( /*!*/ "SET_IGNOREALERTS", /*!*/ "true" );
set ( /*!*/ "SET_LOOK_FOR_ENEMIES", /*!*/ "false" );
set ( "navgoal", "t3" );
}

wait ( $7000$ );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
wait ( $8000$ );
camera ( /*@CAMERA_COMMANDS*/ ZOOM, 30.000, 3000 );

affect ( "SceneJedi", /*@AFFECT_TYPE*/ FLUSH )
{
//$"runOnly"@5
set ( /*!*/ "SET_BEHAVIOR_STATE", /*!*/ "BS_DEFAULT" );
set ( /*!*/ "SET_WALKING", /*!*/ "false" );
set ( /*!*/ "SET_RUNNING", /*!*/ "true" );
set ( /*!*/ "SET_IGNOREALERTS", /*!*/ "true" );
set ( /*!*/ "SET_LOOK_FOR_ENEMIES", /*!*/ "false" );
set ( "navgoal", "t4" );
}

wait ( $9000$ );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

Link to comment
Share on other sites

Your using the wrong set and the wrong wait.

 

Use these:

script7bv.jpg

 

EDIT: Oh... and about your compile errors... you might have BehavEd set up wrong as well. Its sorta tricky to get it right in JKA...

 

heres my config (load behavEd, click "pref"

 

Script Path:

C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\base\scripts

 

SourceSafe Script Path:

$/StarTrek/BaseQ3/real_scripts

 

SourceSafe INI File location:

\\RAVEND\VSS\SRCSAFE.INI

 

Location of IBIZ.EXE

C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\Radiant-1.4\Tools\IBIze.exe

 

Command Description File

C:\Program Files\LucasArts\Star Wars Jedi Knight Jedi Academy\GameData\Radiant-1.4\Tools\behavEd.bhc

 

Source File Path:

C:\projects\JEDI_Academy_SDK\Tools\SourceForBehavEd

 

 

My days of using BehavEd may be shortlived after this point... but it is a wonderful tool to learn the language. Actually, it's not that complex, it's a watered down version of vB programming. Anyway, I'm going to playtest my new cutscene!

 

Yeah, theres only around 100 commands or so... I wish other languages like C++ would have a program like BehavEd that you could drag and drop that code in easy... :-\ All of that typing leads to typos and needless errors... :-\

Link to comment
Share on other sites

OK, I had errors, I closed it, and re-opened. Holy cr@p, it organized it! I'm unsure of how to use the other "set". I'm gonna look at that manual.

 

Just as I've had it with 1.5 Radiant, I've had it with BehavEd. Guess what? My problem isn't not knowing what to script; it's how to use the [flamin] program! Well, forget that. I've got an excellent ICARUS manual. I will do it, erm, manually, from now on.

Link to comment
Share on other sites

Well, you drag and drop stuff. You can also double click commands, and use drop down menus. The programs lists are a little unorganized but they get the job done. The problem with doing it manually is you don't know all the commands... the manual only covers the basics.

 

In the other set command you just stick it into your script, use the menu to scroll down to the command you need and type the variable in the 2nd blank...

Link to comment
Share on other sites

OK, I fixed up the scripts, but he still won't move. Darn Jedi, move your kester! Here's the script now. All of the set commands were re-done in Notepad, not BehavEd.

 

//Generated by StaffSaberist

rem ( "Opening" );
camera ( /*@CAMERA_COMMANDS*/ ENABLE );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam1", ORIGIN)$, 0 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam1", ANGLES)$, < 0.000 0.000 0.000 >, 0 );
Affect ( "SceneJedi", FLUSH )
set( "SET_BEHAVIORSTATE", "BS_DEFAULT" )
set( "SET_WALKING", "true" )
{
task( "walk to t2" )
{
set( "SET_NAVGOAL", get( STRING, "SET_t2" ))
}
task( "walk to t3")
{
set( "SET_NAVGOAL", get(STRING, "SET_t3"))
}
task( "walk to t4")
{
set( "SET_NAVGOAL", get(STRING, "SET_t4"))
}
}
wait ( 8000.000 );
rem ( "From Camera I to Camera II" );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam2", ORIGIN)$, $5000$ );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam2", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
wait ( 7000.000 );
rem ( "From II to III" );
camera ( /*@CAMERA_COMMANDS*/ MOVE, $tag( "cam3", ORIGIN)$, 5000 );
camera ( /*@CAMERA_COMMANDS*/ PAN, $tag( "cam3", ANGLES)$, < 0.000 0.000 0.000 >, 5000 );
camera ( /*@CAMERA_COMMANDS*/ ZOOM, 30.000, 3000 );
wait ( 8000.000 );
camera ( /*@CAMERA_COMMANDS*/ DISABLE );

 

Now, the manual may not be perfect, but it actually has an example of a character walking from point A to point B to point C. Sound familiar? Anyway, BehavEd treated it like it was created there. All the stuff was in place. Everything was perfect - except it didn't work. Also, I need to work on my timing, now... all the camera movements happened at once. :lol:

Link to comment
Share on other sites

You Affect has a misplaced opening brace, which might cause problems. And on the other hand, it's not enough to just place commands in a task. You must also launch the task by using the DO("task") command (or DOWAIT("task")). And remember that you must execute a task inside the same affect where you declared them.

 

And what is this: set( "SET_NAVGOAL", get(STRING, "SET_t4"))

Did you store the navgoal's targetname to a variable called: "SET_t4"?

 

Well, theres certain things you need tasks for. Then theres certain things you don't need them for. I am sure walking requires task, but I could be wrong. Im not sure about talking though... :-\ I normally use tasks when I am not sure, just because as long as its set right its guaranteed to work...

Well, basically there are only two cases when they can be useful: To monitor the execution of a command that takes time to complete (like move, set_navgoal) or to group a bunch of commands you intend to use many times and thus it saves some space to just DO the task multiple times instead of copy-pasting the group of commands separately. But there are no commands that require tasks (other than DO("task") and WAIT("task"), but since those aren't doing anything independently, it's a weak point).

 

It should be noted, however, that not all commands taking time to execute are compatible with WAIT("task") monitoring. A prime example is a sound file playing. It should never be placed in a task in order to monitor it with a WAIT("task"), because the game cannot reliably monitor the duration of a sound file. Otherwise sound files can of course placed in tasks and just launched with DO("task") (without waiting("task")).

Link to comment
Share on other sites

You know, the scripts from the game are full of examples of characters moving. It might be an idea to look there before asking here (because they actually work).

 

And advice given here doesn't work, eh?

 

But I'm not going to argue with you. It was a mistake on my part not to remember to mention that very same thing. Usually I do, but for some reason I forgot it this time...

Link to comment
Share on other sites

Umm... I really don't know where to get scripts from the game. I'll look around. Right now, I'm looking in the assetsX.pk3 files...

 

EDIT - I found them, but only the .IBI files so far. They are basically unreadable. Here's just a sample:

 

 

 

IBI ÃõÈ? SET_CINEMATIC_SKIPSCRIPT t1_sour/intro_skip rocket_crate_dan `B SET_INVINCIBLE true SET_HEALTH A npc_fakeKyleIntro `B SET_MORELIGHT true SET_WEAPON WP_NONE SET_CAMERA_GROUP introCamGroup1 SET_WALKING true SET_NAVGOAL

introNav1 npc_fakePlayerIntro `B SET_MORELIGHT true SET_WEAPON WP_NONE SET_CAMERA_GROUP introCamGroup1 SET_WALKING true SET_NAVGOAL

introNav1 # xB# hB –B # lB1 DB

introCam1 XB # dB1 DB

introCam1 TB `A # hB *B # ˆB introCamGroup1 úD# lB1 DB

introCam2 XB # dB1 DB

introCam2 TB `A # hB ‚B " npc_fakePlayerIntro npc_fakeKyleIntro2 `B SET_MORELIGHT true SET_WEAPON WP_NONE SET_WALKING true SET_NAVGOAL introNav1c €»D & Well I'll be... the Millennium Falcon ) falcon CHAN_VOICE_GLOBAL sound/chars/kyle/07kyk002.mp3 * falcon SET_LOOK_TARGET look_kyle01 @E SET_LOOK_TARGET none úD

Han, Chewie? ) han CHAN_VOICE_GLOBAL sound/chars/kyle/07kyk003.mp3 SET_LOOK_TARGET look_kyle02 . look at kyle2 * han han €;D I guess they're out. ) speak CHAN_VOICE_GLOBAL sound/chars/kyle/07kyk004.mp3 . cut to camera3 SET_LOOK_TARGET npc_fakePlayerIntro2 * speak speak SET_DYAW C SET_LOOK_TARGET none HC. goto introNav2b SET_NAVGOAL

introNav2 npc_fakePlayerIntro2 `B SET_MORELIGHT true SET_WEAPON WP_NONE SET_WALKING true SET_NAVGOAL introNav1b / look at kyle2 SET_LOOK_TARGET npc_fakeKyleIntro2 / goto introNav2b SET_LOOK_TARGET none /D SET_DYAW C –C SET_NAVGOAL introNav2b úD# dB1 DB introCam2b TB `A €»E# hB *B zE/ cut to camera3

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...