|
Ammo Triggers And Other Fun Things
#4465 posted by Preach on 2005/11/14 04:14:30
Triggers that give ammo are possible with the notnull trick. Make a brush entity with these fields
classname info_notnull
think InitTrigger
nextthink 0.3
touch ammo_touch
weapon 2
aflag 30
netname nails
Weapon determines the ammo type, 1 to 4 for shells up to cells. Aflag is the amount of ammo to give. Netname is the text that goes after "You got the" that's printed in the top left, it doesn't have to correspond with the usual phrase. If you wanted to print "You got the ammo pack", that would work.
This trigger will only work once. If you want it to be reusable, then you'll need to do a bit more. Add these fields
targetname ammotrigger
use SUB_regen
Then have something target the ammotrigger once it's been used to reset it. You can have a trigger_relay targeted by the ammotrigger that targets it back after a delay to replicate respawning as in deathmatch, for example.
I think you can get around the style toggling restriction with QC if you are careful, but it's not easy. Quake has 64 possible light styles, controlled by a command like so:
lightstyle(3, "aja");
The first number tells the engine which lightstyle to change, and the string defines a kind of "animation" of the light. Each character in the string sets the brightness of the light for one frame, a being the darkest and z lightest. So this command would make any light with style 3 flicker on and off rapidly.
The style key you can set on a light gives it one of a predefined set of styles from world.qc. But any light that you make switchable is also assigned a style from 32 - 62 by the light program. The way the light is toggled is by changing the style between:
lightstyle(self.style, "a");
and
lightstyle(self.style, "m");
So if you were to toggle one light with a predefined style, you'd in fact turn off all lights with the same style. So to get round it, you'd need to make sure that your light gets toggled between off and the correct style.
The way I'd do that is something like:
void() light_use =
{
if (self.spawnflags & START_OFF)
{
lightstyle(self.style, self.netname);
self.spawnflags = self.spawnflags - START_OFF;
}
else
{
lightstyle(self.style, "a");
self.spawnflags = self.spawnflags + START_OFF;
}
};
/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
Non-displayed light.
Default light value is 300
Default style is 0
If targeted, it will toggle between on or off.
*/
void() light =
{
if (!self.targetname)
{ // inert light
remove(self);
return;
}
if (self.style >= 32)
{
if (!self.netname)
self.netname = "m";
self.use = light_use;
if (self.spawnflags & START_OFF)
lightstyle(self.style, "a");
else
lightstyle(self.style, self.netname);
}
};
Replace the corresponding bit of code in misc.qc with that chunk of code. Then make the targetable light as normal without setting a style, but set the light's .netname to the sequence of lights you wish to display. You'll probably have to look these up in world.qc, for instance to get style 3 set
netname mmmmmaaaaammmmmaaaaaabcdefgabcdefg
The added bonus is you aren't restricted to the preset styles, you could define a new custom light style in this way, and it could be toggled.
Cool, Thanks!
#4466 posted by negke on 2005/11/14 07:42:29
and does the item trick work with health and armor (possibly artifacts), as well? if it does, how can the different sizes be determined with touch_health and touch_armor?
Healthy Body And Mind
#4467 posted by Preach on 2005/11/14 09:27:40
The same kinda trick works with health_touch, the important fields are:
healamount 20
healtype 2
noise items/health1.wav
along with the ones for setting up the weapon touch, the think and nextthink ones should be as before. Healamount is the amount of health that should be healed. Healtype 2 means the healing ignores the maximum 100 health, like a megahealth does, and will rot down again afterwards. However, be warned that the entity is now keeping track of when to count the player's health down, so don't allow it to be touched again/do anything else until enough time has passed for the health to rot away, ie 1 second for each hp you give the player plus 5 seconds start time. Setting healtype to anything but 2(including 0) will result in normal healing - none if the player is at full hp. Noise should be a sound that's already precached somewhere else.
Armor_touch cannot be exploited in this way, as the function relies on the classname of the entity, and there's no way round that if you're using an info_notnull. Key_touch is wide open, but doesn't make a lot of sense. Sigil_touch will also work.
Interesting aside...if you set flag one on a trigger_multiple, you can give it a touch field and not have it reset when it spawns. I can't see any obvious advantages of this over just making an info_notnull trigger, except that this doesn't use the think field. But somebody might be able to use this creativly...
And One Last Question For Today:
#4468 posted by negke on 2005/11/14 11:07:48
regarding the triggerable trigger_changelevel trick czg posted in the progs.dat thread:
can a similar method also be applied to other triggers? e.g. to activate a trigger_once for a teleport ambush in an area the player has already passed before.
Who Triggers The Triggers?
#4469 posted by Preach on 2005/11/14 11:22:06
This is possible. Make an brush entity info_notnull with the following fields
touch multi_touch
wait -1
targetname trig
use InitTrigger
target event
This trigger will not be spawned until trig is targetted. From then on it will act like a trigger_multiple when touched, although things like shootable triggers or triggering by targetting(like a trigger relay) will not. You can add all the usual fields like wait time. If you want sounds, you can't set the sounds field like usual, but if you set noise to the sound you want, it'll work assuming something else precached it.
You can probably adapt this to work for other kinds of trigger as well, not sure exactly which are possible though.
So You Know.
#4470 posted by Drew on 2005/11/14 11:42:21
I've figured it out. thanks for all the help.
Preach
#4471 posted by negke on 2005/11/16 10:51:03
thanks again. how could we ever map without you...
Senn Textures
#4472 posted by Elvis on 2005/11/17 03:05:50
where can i find senn's green textures? seems like daz has used them in his crdm3 map
Map Conversion
#4473 posted by JPL on 2005/11/17 11:50:52
I've just downloaded some prefabs for Q2, HL, Q3, and I would like to convert them in Q1 map format. Is there a tool that can do that ? If yes: where can I download it ?
This Is Embarassing
#4474 posted by Blitz on 2005/11/18 01:59:37
It's been a while since I messed with Q3:A, but was tonight just for fun.
How do you rotate textures on a patch or a bevel? I've searched all over the place but have come up with nothing.
Map Conversion.... The Soluce...
#4475 posted by JPL on 2005/11/18 02:56:03
FYI...
After a quick look to the 4 prefabs .map I downloaded yesterday, it sounds that one of the Q2 model has a problem of map format... Normally, a brush face is described like this (it's a copy paste of http://www.gamers.org/dEngine/quake/QDP/qmapspec.html part 2.1.2...)
{
( 128 0 0 ) ( 128 1 0 ) ( 128 0 1 ) GROUND1_6 0 0 0 1.0 1.0
( 256 0 0 ) ( 256 0 1 ) ( 256 1 0 ) GROUND1_6 0 0 0 1.0 1.0
( 0 128 0 ) ( 0 128 1 ) ( 1 128 0 ) GROUND1_6 0 0 0 1.0 1.0
( 0 384 0 ) ( 1 384 0 ) ( 0 384 1 ) GROUND1_6 0 0 0 1.0 1.0
( 0 0 64 ) ( 1 0 64 ) ( 0 1 64 ) GROUND1_6 0 0 0 1.0 1.0
( 0 0 128 ) ( 0 1 128 ) ( 1 0 128 ) GROUND1_6 0 0 0 1.0 1.0
}
That's probably just a bit confusing when you first see it. It defines a rectangular region that extends from (128,128,64) to (256,384,128). Here's what a single line means:
( 128 0 0 ) ( 128 1 0 ) ( 128 0 1 ) GROUND1_6 0 0 0 1.0 1.0
1st Point 2nd Point 3rd Point Texture
Now, you're probably wondering what those last five numbers are. I've listed what they do below:
x_off - Texture x-offset (must be multiple of 16)
y_off - Texture y-offset (must be multiple of 16)
rot_angle - floating point value indicating texture rotation
x_scale - scales x-dimension of texture (negative value to flip)
y_scale - scales y-dimension of texture (negative value to flip)
But taking a look to the Q2 map file I found 8 values after the 3 parenthesis section, instead of 5 as described above ... o_O ... I can understan a 6th value if the texture has been rotated differently on its 2 axis, but 8 !!!.. What does it mean?? So I heavily suppose the issue is coming from there: i.e I have a TxQBSP error stating map file have an error... and it correspond to the line where the first brush coordinates is written...
Well, the prefab has only 26 brush, so I think it's not a big deal to change it manually in any text editor.... and made a quick test to see if I'm right or not... ;)
Q2 To Q1 Conversion Tool
#4476 posted by Spirit on 2005/11/18 03:25:19
Conversion To Q1
#4477 posted by aguirRe on 2005/11/18 03:56:11
can also be made using my ConvMap utility or QuArK. If you just want to compile a Q2/Q3 map, just add the -q2map qbsp option.
Spirit / AguirRe
#4478 posted by JPL on 2005/11/18 04:52:13
Thanks ! I will try all the stuf this evening ;)
Blitz
#4479 posted by BlackDog on 2005/11/18 08:17:51
Select the patch, bring up the patch inspector (shift+S) and hit the rotate up/down thingy. That's for gtk1.4, but other radiant versions should behave the same.
Triggering Problems.
#4480 posted by Drew on 2005/11/18 13:15:45
I'm making a quoth map, and I've got a counter triggered by 2 "bob"s. They don't seem to trigger it, and I'm not sure why. I have the same problem at another part of the map where an Ogre is supposed to trigger a door. And he doesn't...
Anyone have any ideas as to why this is?
Doesn't Work In GTK 1.5 Latest Build BlackDog
#4481 posted by Blitz on 2005/11/18 19:01:38
[nt]
I Cant Do Shit
#4482 posted by p.d on 2005/11/18 19:13:25
i need help! every time i try to do a quake level, i get as far as 3/4 rooms or so. i have tons of unfinished shit lying around. i tried more than 100 times to put these chunks together into one fucking map, but i cant do it! im stuck.
sometimes i get all these ideas or im really inspired, but i still cant finish anything. i only got one map finished, a really small base map. and i got reviewed! hehe but man, i cant do this! :-'(
what should i do? give up? destroy and smash? like hulk? gahea?E?
Sounds Like...
#4483 posted by necros on 2005/11/18 19:18:18
you're right one track! ^_^;
seriously, i have maps that i started a year ago that are just sitting until i can get the urge to finish them.
i think, as a purely hobby mapper, that this is usually how things go.
if you're doing it for a job, well, then, you don't get that kind of luxury. :P
in fact, i'm kind of curious:
pro mappers: how much do you throw away and restart, and how often? or are time constraints so tight that you can't even afford to do that, and have to continue something that you'd rather restart?
Good Question
#4484 posted by Drew on 2005/11/18 21:42:40
Also, I wonder... what about my question. I'm feeling woeful and uncared for.
Aaaw
#4485 posted by Kell on 2005/11/18 22:31:24
I've got a counter triggered by 2 "bob"s.
I just built this setup. Twice; one in GtkR using the .def and one in WC using the .fgd
Both worked fine.
Could be the "count" value you used..?
Nope.
#4486 posted by Drew on 2005/11/19 12:08:39
Count *is* at 2.
No Lettee Passee
#4487 posted by Mike Woodham on 2005/11/19 13:39:34
What can I use as a barrier that will allow monsters through but block players
Okee Dokee
#4488 posted by Mike Woodham on 2005/11/19 13:45:37
Never mind. Opened mouth without engaging brain. Got it sorted now.
(took me longer to ask the question than find the answer)
Drew
#4489 posted by necros on 2005/11/19 15:43:08
have you checked what you are targetting with the trigger_counter? maybe the triggered entity is broke?
|
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|