PDA

View Full Version : spawning and elevaters


yoda-the-wise
09-29-2002, 04:06 PM
i have two question's.

1.how do i make a group of npc spawn after you kill a group of other npc npc?

2.how do i make an elevater?!

JavaGuy
09-30-2002, 12:56 AM
The NPC_target is what an NPC fires when he dies. If you point this to another NPC, that other NPC will not spawn until the first dies.

If what you really want is for _none_ of NPC group B to spawn until _all_ of NPC group A is dead, one way to do it is this:

Create a target_count and set its count to the number of NPCs in group A. Let's say you give it a targetname of "group_a_deathcount" and give every NPC in group A an NPC_target of group_a_deathcount. Then set the target_count's target to "group_b" and give every NPC a targetname (that's targetname, not NPC_targetname) of group_b.

What will happen is that, because they all have a targetname, none of the NPCs in group B will spawn until something triggers them. Every time an NPC in group A dies, he'll fire his NPC_target, which is the counter. When the last NPC in group A dies--remember we set the target_counter's count to the number of NPCs in group A--the target_counter will reach its count and fire its target: group B. Then group B will spawn. Ta da!

Elevators seem to be a hotly debated topic. I favor an ICARUS script because no matter how simple an elevator you think you want, it will never do _exactly_ what you want it to do unless you script it and explicitly tell it what to do. You can always use a func_plat or a func_door that "opens" up or down, but you'll never be 100% satisfied--you'll always wish it did one thing or another that those entities don't do.

Bell
09-30-2002, 03:17 PM
woohooo thanks javaguy you just solved my problem!! i wanted to trigger a cin when the last of the npc's were killed. sweeeeeeeeet.

yoda-the-wise
09-30-2002, 06:00 PM
taget_count?i don't have a target_count.:confused:

JavaGuy
09-30-2002, 07:34 PM
Oops, it's target_counter.

yoda-the-wise
09-30-2002, 09:03 PM
please tell me one more time how you trigger another group of npc's after you kill the first batch.:confused: :confused: :confused: :confused: :confused: :confused:

Bell
09-30-2002, 09:56 PM
awesome just did it; works way khewl; if ya don't mind i'll chime in and see if i can eloborate . . .

k i threw 3 npc's in my test map. this would be group A.

key:NPC_target
value: deathcount
(for all 3 of them)

now i put in a target_counter
key:count
value:3

and

key:targetname
value:deathcount

and

key:target
value:spawnme

and you'll see the lines connect the npc's to the counter

then from here its different but will explain at end

i put in a scriptrunner

key:usescript
value:spawngroupb

and

key:targetname
valuespawnme

now you'll see the counter connect a line to the script runner.

i did it this way to test if it could run a script which it did. so . . .

i put in 3 more npc's. this is group B.

key:NPC_targetname
value:groupb

i did this for all 3 npc's in group B. also make sure its "NPC_targetname" and not just "targetname". or it won't work.

and my script did simply this(for now)
//Generated by BehavEd

rem ( "spawngroupb" );
use ( "groupb" );

so then i ran the map and when i killed the 3rd of the 3 npc's in no particular order the next three appeared. khewl huh!

yoda-the-wise
10-01-2002, 05:27 PM
thanks i think i just have to more question's.

1.is it targetcount and target deathcount or deathcounter and targetcounter?

2.how do you make locked doors?

JavaGuy
10-01-2002, 08:00 PM
The target_counter is the entity that does the counting. Its name, i.e. its targetname key, is deathcount.

There are probably as many different ways to make locked doors as there are stars in the sky. How exactly do you want the locked door to work?

yoda-the-wise
10-02-2002, 11:46 PM
i would like a door that is locked and has a key to open it please.

Bell
10-03-2002, 01:53 PM
go here and download the doors tut it is great
http://mapping.jediknightii.net/tutorials.htm

yoda-the-wise
10-03-2002, 07:15 PM
one more question and this has happened with all of my level's just when i'm about to finnish it they just start doing this stupid blinking thing.like when your level has a leak and it drive's me crazy!!!!!!!!!!!!!!!!!!!:mad: :mad: :mad: :mad: :mad: :swear: :swear:

Bell
10-03-2002, 08:19 PM
yes known as the HOM (hall of mirrors) effect. In radiant before you draw your first brush on a new map the 3d window is all grey. This is known as "the void". Your maps have to be like a space ship in space; completely sealed from the void. If there is the slightest leak or gap in the "hull" of your map then the leak occurs and the hom at the leak itself. Also if you have a brush that is against the void that is detail you could get the hom too. All brushes against the void have to be structural. Select the brush and choose selection/make structural. And they can also occur in strange circumstances if the above isn't the case.

A word on level design
Take heed, plan technique, throwing a bunch of brushes together and trying to fix all the bugs after is a pain in the @ss.
hints;
I usally start by blocking out the major rooms; i use the caulk texture on everything and place art textures on just the faces that will be seen by the player.
Use ctrl+D often; it toggles detail brushes on and off. As you build your level you can see if the basic structure is sealed from the void. Then I go back and add the fancy schmancy stuff.
I do my damnedest to make sure no brushes are occupying the same space, so if you make a giant cube and hollow it out to make a room, then drag the walls, floor and ceiling out a tad so the corners are touching and not overlapping.
Don't use csg subtract; it can cause bad poly's-not good. Its better to build brushes around eachother or use the clipping tool which is nifty.
Save your map in stages; mymapv1.map, mymapv2.map etc. And also do a bsp no light no vis, just to check that it will compile and has no major problems. Its easier to debug smaller maps rather than big ones. And i do my maps in sections, and slap them all together in one big one at the end. It saves time in many respects.
and also check these out
http://www.planetquake.com/spog/stuff/technical.html
http://www.qeradiant.com/faq/fom-serve/cache/17.html
http://lunaran.fragland.net/lsite.php?content=architecture
http://www.telefragged.com/teamtk/learning/teovgld-b1.htm

JavaGuy
10-03-2002, 10:10 PM
I second everything Bell said.

Blocking out the major portions first like he said will prevent a lot of headache and heartache. In software engineering we call this top-down design--build the skeleton of the whole system first, then fill in the details to make each part work.

yoda-the-wise
10-04-2002, 07:43 PM
that's not what i ment my level was fine.but then i and some crates and guns and it just started blinking in some places what does this mean:confused: .

Bell
10-04-2002, 08:05 PM
hmm can you be more specific?

yoda-the-wise
10-04-2002, 11:26 PM
all i did was add some guns and crates then played it and it just started blincking like it had a leak or something.

Bell
10-05-2002, 02:08 AM
k if ya want send me the map file and i'll take a look

yoda-the-wise
10-05-2002, 02:38 PM
how would i do that?:confused: :confused: :confused: :confused: :confused:

Bell
10-05-2002, 03:20 PM
attach the map file as an email
wpbellco@earthlink.net

yoda-the-wise
10-05-2002, 04:24 PM
i think its to big it's a fort after all.anyway i got a beter idea i have this code thing to this place where you can download it.but first join my ccccccrrrrrreeeeeewwwwwwwwww!!!!!!!!!please please please join my crew!!!!!!!!!!!!!!!!!!!!!!!!!!

Bell
10-05-2002, 05:56 PM
lol khewl lemme know i'll take a look at it.
actually i'm on a mod team already and we are just weeks away of releasing chapter one; i'm way busy but thanks!!! maybe in the near future:cool: i can help on a limited basis though

yoda-the-wise
10-06-2002, 12:15 AM
dddddddaaaaaaaaaaammmmmmmmmmmnnnnnnnnnnnnn!!!!!!!! !!!!!!!!!!!!!:crybaby:.k then i'll give you the code but after your done uesing it don't use it again.ok!:D

yoda-the-wise
10-06-2002, 12:20 AM
anyway what about you java guy will you help me with my map?

Gohan_Trunksss
10-06-2002, 11:00 AM
JavaGuy where do i get this ICARUS script for elevators?

JavaGuy
10-06-2002, 12:34 PM
yoda-the-wise: Sure. E-mail me a javaguy@sammckee.com.



Gohan_Trunksss: Search the tutorials or write your own (you'll probably end up changing it to customize behavior anyway). Here's one from a map I'm working on. Be advised it still has a couple of bugs, but the basic functionality works.

//Generated by BehavEd

rem ( "PARM1 - func_static, elevator, script_targetname" );
rem ( "PARM2 - ref_tag, up position, targetname" );
rem ( "PARM3 - ref_tag, down position, targetname" );
rem ( "PARM4 - func_usable, active button, script_targetname" );
rem ( "PARM5 - func_usable, inactive button, script_targetname" );
rem ( "PARM6 - Either up or down" );
sound ( /*@CHANNELS*/ CHAN_AUTO, "sound/movers/switches/switch1.mp3" );
rem ( "Start moving, so hide inactive button and show active button" );

affect ( $get( STRING, "SET_PARM4")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( "SET_FUNC_USABLE_VISIBLE", "true" );
}


affect ( $get( STRING, "SET_PARM5")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( "SET_FUNC_USABLE_VISIBLE", "false" );
}

rem ( "Move the elevator" );
declare ( /*@DECLARE_TYPE*/ STRING, "elevator_destination" );

if ( $get( STRING, "SET_PARM6") = "up"$ )
{
rem ( "Move elevator up" );
set ( "elevator_destination", $get( STRING, "SET_PARM2")$ );
}


else ( )
{
rem ( "Move elevator down" );
set ( "elevator_destination", $get( STRING, "SET_PARM3")$ );
}


affect ( $get( STRING, "SET_PARM1")$, /*@AFFECT_TYPE*/ FLUSH )
{

task ( "move_elevator" )
{
move ( $tag( get(STRING, "elevator_destination"), ORIGIN)$, 2000.000 );
}

dowait ( "move_elevator" );
}

free ( "elevator_destination" );
rem ( "Stop moving, so show inactive state button and hide active state button" );

affect ( $get( STRING, "SET_PARM4")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( "SET_FUNC_USABLE_VISIBLE", "false" );
}


affect ( $get( STRING, "SET_PARM5")$, /*@AFFECT_TYPE*/ FLUSH )
{
set ( "SET_FUNC_USABLE_VISIBLE", "true" );
}

Gohan_Trunksss
10-06-2002, 01:00 PM
thanks JavaGuy

yoda-the-wise
10-07-2002, 12:16 AM
thank you so much i don't think i can thank you guy's enough i will never forget this thank you thank you thank you!!!!!!!:D :D :D :D

Bell
10-07-2002, 03:24 PM
thanks java guy that taught me some khewl tricks:cool: