Jump to content

Home

Opening doors in the right way


[ASJN] Balboa

Recommended Posts

hi, i'm currently working on a castle map, and i saw in one of the sp levels t3_rift maybe? where your in that trench, that theres this door that opens by going outwards. hard to explain, but first after you kill three reborns, you see this door. you use seeing, and then pull, and it opens towards you, like the entire door is changing. how do i make something like that? not the force part, just a door that opens outwards like that? is it even a func_door?

Link to comment
Share on other sites

It's a func_static with an origin brush at one edge of it. You use icarus to tell it to rotate

 

affect("func_static_name", FLUSH){
//rotate 90 degrees on Z axis over a period of 2 seconds
rotate (<0 0 90>, 2000);    
}

//wait 3 seconds
wait(3000);

affect("func_static_name", FLUSH){
//rotate back to origin over a period of 2 seconds
rotate (<0 0 0>, 2000);
}

 

Knowing my luck I probably put the 90 in the wrong place now ^.^

Link to comment
Share on other sites

Here's a little picture to remind of the angles (as they are sometimes hard to remember, even for me, and I have rotated God knows how many items over time):

 

angles.jpg

 

Just think of the rectangles with letters as flags winding around the axes. And then imagine your object to be rotated to replace one of the flags :)

 

In this case a door would most obviously be B, just like Wade said. Yeah, take note of the Axes names in my pic. You must imagine it as a 3D image, not like 2D as in Radiant XY view. That is, the Radiant standard 2D is in my image the surface that recedes (goes farther away from the beholder).

 

The most important thing to remember with rotate command is that it doesn't actually rotate anything from its current position, but rather it sets the absolute facing direction every time you set a new value. It is equivalent to setting angles in Radiant entity properties.

Link to comment
Share on other sites

Well, first of all you must make the func_static. You will make that by first making the door itself (but don't yet turn it into a func_static, you'll that a little later). After that's finished, you must place there an origin brush (that's a piece of brush wholly textured with system/origin, and ugly orange shader-texture). The origin can be a piece of brush of any size; it won't even show in game. Just place it so that the exact middle of the origin brush will be the axis of rotation (hinges) of your door. Then select the actual door brush(es) and the origin brush. When they are all selected, turn them into a func_static.

 

Bring up entity properties for the func_static and enter:

 

script_targetname

rotadoor1

 

or whatever you want to call it ("func_static_name" in the script example above)... I don't remember with 100% certainty, but I think it's useless to enter a soundset, since those won't play while rotating. So, you must deal with the sound some other way.

 

Then place a target_scriptrunner somewhere near the door. Bring up the entity properties, enter:

 

count

-1

 

usescript

mymapname/myscriptname

 

Count -1 allows the script to be launched more than once. Mymapname is the name of your map. In your scripts folder you must create such a folder, and inside that you must create then the script .ibi file myscriptname. Don't add .ibi to the end of the usescript key value, though.

 

Then you must place a trigger in front of the door (if you want it to be automatic) or a button or something, and target it to the target_scriptrunner. You should also give the trigger some wait value so that the script can be launched only once per some sensible time. You can also give a wait value for the target_scriptrunner, if you want (I normally give 'em both, because I like to think it will spare some processor time :) ).

Link to comment
Share on other sites

ty thats extremely helpful

cept one thing how do i make a .ibi file?

i would of thought it would just be edited in notepad or something but when i open it in notepad it comes up with stuff like

IBI ÃõÈ? \B `A ´B €;E @œE `A €;E

\B `A ´B €;E @œE `A €;E

 

which is nice :confused:

Link to comment
Share on other sites

Right. The script Wade gave above is a script source. However, the game doesn't use script sources. You must make the script in BehavEd, which is the script editor. It's included in the editing tools. In BehavEd you first make the script like Wade described, then you hit the compile button (you'll find it easily enouh in the program. That will produce you the .ibi in the same place, where you saved the script (when you save the script, it'll be a text file). The .ibi file you must include with your level.

Link to comment
Share on other sites

ok i made the ibi file following the stuff wade said as closly as i could, this is the txt file i got tell me if this is done right please :)

 

//Generated by BehavEd

 

rem ( "comment" );

 

affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )

{

}

 

rotate ( < 0.000 0.000 45.000 >, 2000.000 );

wait ( 198000.000 );

 

affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )

{

}

 

rotate ( < 0.000 0.000 0.000 >, 2000.000 );

Link to comment
Share on other sites

bah guys its not working :(

ok what i got is....:

a finc_static that includes the origin covered brush for where i want it to rotate

the key/values for it are the following:

script_targetname / turntablearm1

 

ok also i got a trigger_multiple with these keys/values:

 

target / turntable1

wait / 203

spawnflags / 4 (use_button)

ok what else?

o yeah the target_scriptrunner which has these key/values...

spawnflags / 128 (inactive)

targetname / turntable1

count / -1

origin / 1600 -266 -595

usescript / vas_party/turntablearm

wait / 198

delay / 0

 

ok thats everything related in the map ill do the script now..

ok i put it in a .pk3 in the path scripts/vas_party/turntablearm.ibi

//Generated by BehavEd

 

 

affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )

{

}

 

rotate ( < 0.000 0.000 45.000 >, 2000.000 );

wait ( 198000.000 );

 

affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )

{

}

 

rotate ( < 0.000 0.000 0.000 >, 2000.000 );

 

i think thats everything hopefully thats all the infomation you need to tell me where ive gone wrong...

ty in advance:)

Link to comment
Share on other sites

Let's just compare our scripts again shall we?

 

Yours:

//Generated by BehavEd


affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )
{
}

rotate ( < 0.000 0.000 45.000 >, 2000.000 );
wait ( 198000.000 );

affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )
{
}

rotate ( < 0.000 0.000 0.000 >, 2000.000 );

 

Mine:

//Generated by BehavEd
rem ( "comment" );

affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )
{

rotate ( < 0.000 0.000 45.000 >, 2000.000 );

wait ( 198000.000 );

rotate ( < 0.000 0.000 0.000 >, 2000.000 );
}

 

You'll see, apart from the fact mine is simplified, that there is one thing that is quite important:

The location of the brackets - { and }

 

For the code to work, the rotate function must be inside the brackets that come after the affect line, you have

affect ( "turntablearm1", /*@AFFECT_TYPE*/ FLUSH )

{

}

Which is basically saying "Whatever is in the following brackets, run the commands on turntablearm1"...but then your brackets are empty!

 

You don't need to use behaveed here, I've created the correct code for you. Just paste it into your text file then compile using ibize.exe into the IBI file.

 

But take note of the way brackets work!

Link to comment
Share on other sites

Why is your target_scriptrunner inactive? That is not normally necessary. Basically the only time you want to inactive a scriptrunner is when you want to prevent the script from being run, or stop a script already running (as long as it's not affecting). If you inactivate it, you need a target_activate to target it first to be able to run the script in game.

 

Yeah, but I only got here to correct my previous statement that soundset wouldn't work while rotating. Maybe you had already noticed that information false. It seems to work alright, now that I tested it. I guess I had my mini-hifi system turned off the first time...

 

What comes to the scripts - many people find the Raven ICARUS manual pretty boring or even intimidating, but things like the error in your script are explained there quite nicely.

Link to comment
Share on other sites

[ASJN] Balboa? Remember me, from the Defenders of the Force where I was an admin? :)

 

Here's a little picture to remind of the angles (as they are sometimes hard to remember, even for me, and I have rotated God knows how many items over time):

 

http://www.student.oulu.fi/~lvaarisk/angles.jpg

 

Yeah, i know!!!! Its annoying :D Anyways... thanks for the pic. Ill be sure to check that when im scripting stuff. :whtsmile:

Link to comment
Share on other sites

ok thanks yay it works!

i made the script runner active i dont really know y i had it inactive

i made it wait 198 because the tuntable arm has to move onto a func_rotate which is a record

the trigger also links to a target_speaker that plays a song that happens to last 198 seconds.....

Link to comment
Share on other sites

Originally posted by [ASJN] Balboa

hmm you said to make a scripts folder, yet one already existed, so i put castle (which i named the script for the doors) in there, and it said ingame cannot open castle9/castle . any reasons for this? do i not use that script folder?

 

You indeed have the scripts root folder. Basically you could put your scripts right into that folder, but that would be inconsiderate and bad behavior, so that is why I said you should create a subfolder named after your map into the scripts folder. So, in the end you would have scripts/castle9. Scripts is the scripts root folder that already exists, and castle9 is obviously the name of your map. In your post the game searches for a script called "castle" located in scripts/castle9/.

 

Check that you have an .ibi file (compiled script of that name) in your castle9 subfolder. If it is there, the game should find it.

Link to comment
Share on other sites

well it would save as a txt file, so i thought, why don't i rename it .ibi? well that gave the same results and after scratching my head, i thought of something. a crucial step i must have missed: compiling! yeah, today is literally my first time for behavED and so i don't yet understand how it operates, but at least i know i should compile the script. thanks, i'll tell you if it works

 

hmm.... for some reason it still wont work. i'm missing something but i don't know what

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...