|
Posted by metlslime on 2005/08/30 18:28:13 |
You know about the info_notnull explosion hack. You know about making monsters drop weapons or alternate ammo using the .weapon and .ammo_whatever hacks. You know about making items float in the air by spawning them on a temporary platform. Let's have a thread where we talk about new ways to use existing behavior and get novel gameplay. If you're a "retired" mapper, this is a great time to do some armchair level design and suggest ideas you'll never have a chance to use yourself. |
|
|
As For Messages
#57 posted by czg on 2005/12/01 06:46:43
If anything that prints a message has an activator other than the player, the message won't be printed to the player.
You can see this at the end of terra5 where a trigger_counter counts the deaths of the fiends and wakes up chtohohothothton and prints some messages when they're all gone. However if you trick the fiends into jumping in the lava, there's a trigger_hurt there that kills them, and then the messages aren't displayed because the activator was the trigger_hurt.
Same thing with the logic gates you can build with trap_spikeshooter and doors in front of a button. You can't have the button print a message because it's activator is the trap_spikeshooter, not the player.
So I dunno if I'm quite following you up there, but if you are trying to prove a trigger was fired by something else than the player by printing a message, you should try something else. (Perhaps a light switching on of a door opening or something.)
Yes, You're Right
#58 posted by negke on 2005/12/01 09:11:52
i thought it would be fine if not the trigger itself had the message but some other entity that is fired by it.
i tried it with a light then and it worked.
to have a message displayed, i guess i would have to let it activate another trigger which spans over the entire room the player is in at that moment, or something like that...
Boo!
#59 posted by negke on 2005/12/01 09:29:46
gibs don't trigger it, either.
there goes my idea... :/
Monsters That Stick To A Defined Area
#60 posted by therealthan on 2005/12/13 21:01:16
I am not 100% sure this really does work or not, but I THINK that if you create a func_wall entity that surrounds a monster, and kill the func_wall when the level has loaded, the monster will stay in the same place as if the func_wall was still there, yet be able to see and shoot the player. If the monster has a jumping attack, then if it jumps toward the player, it will come out of the box and act as normal.
I am about 50% sure this works, as I remember doing this when I made apsp1, trapping some enforcers on a ledge. The func_wall may have been made from clips.
I've seen some other strange func_wall tricks used in other levels. RPG used some funny trick in one of his mini Ep1 maps, where there were some nights trapped apparently within func_wall brushes. that acted like statues, but came alive later in the level. I would be interested in how that works, RPG.
Woah
#61 posted by necros on 2005/12/13 22:40:34
holy fuck, does that work? :o can anyone check? i would, but, alas, no quake. :S
regarding the rpg trick, i think you could do it by using the func_wall with the model set, the killtargetting the func_wall and just teleporting in the real monster.
Func_wall Trick
#62 posted by negke on 2005/12/14 00:00:39
restrincting a monster to one are are does not work like that. also, having a func_wall with the clip textures let's qbsp stop with an error message.
the rpg trick is achived through func_walls with skip textures, and then killing them when the monsters are supposed to become active.
^
#63 posted by negke on 2005/12/14 00:03:52
oh, of course you can making monsters stay in a certain area by sealing it with trigger_monsterjumps (that should have height and speed set to "1", so it's less obvious), for example.
Posting Drunk
#64 posted by R.P.G. on 2005/12/14 03:33:49
the rpg trick is achived through func_walls with skip textures, and then killing them when the monsters are supposed to become active.
Exactly. Monsters behind func_wall made from skip (so it appears invisible), and then killtarget the func_walls when you want the monsters to activate. They suddenly "see" the player and come alive.
As Demonstrated In Neg!ke's Recent Doggy Map
#65 posted by mwh on 2005/12/14 05:04:22
we
As Demonstrated In Neg!ke's Recent Doggy Speedmap
#66 posted by mwh on 2005/12/14 05:04:37
when are we going to see the speedmap session based on tricks from this thread?
Skip
#67 posted by therealthan on 2005/12/15 03:34:03
Are you using tyrann's skip tool, or as aguire built it into his compilers. I think I have the skip tool, but I remember Tyrann saying it had some issues so I have steered clear.
This thread is awesome by the way.
Than
#68 posted by R.P.G. on 2005/12/15 09:54:51
I used Tyrann's skip tool. I've never had any problems with it.
Bump For MW
#69 posted by aguirRe on 2006/01/02 17:07:03
.
Been A While, Time For A Hack
#70 posted by Preach on 2006/06/19 07:33:13
There've been a few hacks posted in the mapping help thread since this thread last saw light of day, so if anybody saved them it'd be nice to have them here too. Today we're going to see how you can safely remove weapons and ammo from the player.
I discovered this trick looking for something quite different. Doors that require keys compare their items field to the player's items, and subtract off what they find if it matches. So I was experimenting by changing the .items field manually, rather than setting the gold/silver key flags. You can make a door that only opens if you have quad for instance, but the problem is the quad items flag gets subtracted once you open the door. This doesn't affect the powerup, you'll still do quad damage for 30 seconds, but it removes the icon from your screen. And once the 30 seconds is over the flag is subtracted again, which causes an overflow of the items field and all the icons start lighting up - it's bad.
However, the nice thing about the door is that it safely removes weapons, as these are just stored in the items field. So the simple way to remove a weapon from the player would be just to have a door with an item set to that weapon's item number. You can also sum weapon numbers, and if the player has all of those weapons, it removes them all. Two problems exist for this niave approach:
One: Just removing the weapon from the player's item doesn't force the player to change weapons, so if they are currently using a weapon you want to remove they will still be able to use it until they switch away from it.
Two: If you're removing weapons later in a map, you may not know if a player found the grenade launcher or not. The removal is all or nothing, if the player doesn't have all the weapons you want to remove then none of them get removed and the door remains locked (also it sends the message "you need the gold key"...)
We can solve both these problems at once, whilst at the same time removing ammo from the player. The trick here is to use BackpackTouch to give the player all the weapons they need to open the door, then instantly take them away. At the same time, we give the player full ammo, then take it away with another BackpackTouch, this time with negative ammo counts. And when the ammo count is updated, quake checks which weapon the player should be using, so you won't end up using a weapon you don't have.
So, here's the entities you need to add. I'm assuming you want to remove every weapon except the axe(see below), which gives an items field of 128.
First, a brush based info_notnull with the following fields
touch BackpackTouch
think InitTrigger
nextthink 0.2
ammo_shells 100
ammo_nails 200
ammo_rockets 100
ammo_cells 100
items 127
Then another info_notnull with
touch BackpackTouch
think InitTrigger
nextthink 0.2
ammo_shells -100
ammo_nails -200
ammo_rockets -100
ammo_cells -100
Finally, add a regular func_door with
items 127
You want to ensure that the player hits all of these entities in this order, in as quick sucession as possible, and don't let them avoid any of them. So dropping the player onto the func_door through the other triggers is probably best. Putting the two info_notnulls on exactly the same region of the map is wise, as long as the one with positive ammo counts is higher on the entity list. If you still have problems, the following extra entity can help - an info_notnull with
touch teleport_use
think InitTrigger
nextthink 0.2
This trigger sets force_retouch to 2, which means all objects retouch everything next frame. Presumably this means you retouch it, which resets force_retouch again and over again while you stand in it. Oh well.
So, why is the axe exempted from this? Well, it's quite annoying really. There are sections of the code dedicated to what to do if the player doesn't even have an axe, and these all work well and good, but then there's one lazy line in client.qc that always switches you to the axe if you have no ammo, without checking if you have an axe first. Grrr. So you can't completely disarm the player, but you can get fairly close.
A few other things. One is the annoying messages saying "you recieved -100 shells etc.." that you can see in the console. Add an extra info_notnull in the same spot, with the following fields
touch powerup_touch
think InitTrigger
nextthink 0.2
noise misc/null.wav
netname \n\n\n\n\n
This spams some newlines so the messages are only visible in the console. Creative types might include a message here explaining where all your weapons went.
And A Final Word Or Two
#71 posted by Preach on 2006/06/19 08:02:12
I split up this post, since it was getting quite long. The trick relies on just the function door_touch, so you might feel using a full blown door is overkill. Couldn't we just make a further info_notnull with touch set to door_touch? Well, yes and no. You can do it, and it's obviously nicer in terms of level design to remove weapons with a hidden trigger, but it's more work than you'd think. The code for linking doors means that you'd need to set the info_notnull's owner field to point to itself, which requires mucking around with entity numbers. Just using a door simplifies the explanation, and keeps the focus on the trick to remove the weapons, rather than the fiddly details of faking a door trigger.
My final comment is, after all that, it is possible to make a door that opens based on having certain items, by adapting some of the tricks here. For the purposes of this example we will use a red armour(items bit 32768), but it should work for powerups too.
The important thing here is that you know exactly what flag is being removed by the door, so you can add it straight back on with another
call to BackpackTouch. The difference here is that we don't spawn the trigger until after the door opens, and we use the teleport_use function to force the player to retouch the newly spawned trigger. I guess iD didn't see Init_trigger being used outside the spawning sequence, as it would make a lot of sense just to put force_retouch 2 into that piece of code. Still, we make do, here's the deal:
Add a func_door with
items 32768
target restore
Surround that with a larger brush info_notnull with
touch teleport_use
think InitTrigger
nextthink 0.2
Finally add an info_notnull again larger than the door with
touch BackpackTouch
items 32768
use InitTrigger
targetname restore
netname \n\n\n\n\n
Notice that we call InitTrigger with use, not with think. The netname is for neatness once you open the door.
The door will always give the message "You need the gold key", this is hardcoded and unavoidable, plus quite misleading for the player. So you'll also want a trigger_multiple spamming out "You must have red armour to proceed..." on the door. Remember to remove it once the door opens.
A final word of caution, be careful how you impliment these into a map. The player cannot lose a key, so it's always possible to progress. The same is not true of armour, or even less so a quad. So what do you do if the player takes the armour, but doesn't get back to the door with any left? Should that be game over? And if so, can you at least automatically tell the player they've failed (perhaps an exercise for the enthusiastic reader, how to use this hack for a general armour detection trigger rather than a point check at a door. The corresponding check for a powerup is much easier :-) )Perhaps the best thing a door like this could be used for is not allowing them forward until they have a certain weapon...
And that brings us full circle I guess. Have fun!
.
#72 posted by necros on 2006/06/19 09:46:03
am i right in guessing that would work for runes? they have bitflags, iirc, so you could use those for extra keys..?
Not Exactly
#73 posted by Preach on 2006/06/19 10:46:54
The runes don't actually set anything on the player, they set the bits of a global float called serverflags. So this can't be caught directly by a door. There is a roundabout way of using runes to trigger things, but it involves a system of "logic gates". You have a trigger_multiple at the door that targets the following info_notnull:
use func_episodegate
spawnflags [1-15]
This info_notnull is positioned as a blocker in the first logic gate. This is then inputted into a NOT gate that will target the door open. Kinda round the houses though, as you could basically do the same thing by using a spawnable trigger for the door (using the info_notnull hack) that is spawned when you pick up the rune.
However, it is still possible to make extra keys, they just won't have an indicator on the HUD. Simply use item flags that don't indicate any weapons. 128 represents IT_EXTRA_WEAPON, so it's unused. You can also go a few powers of 2 higher than 4194304(IT_QUAD). So just making a BackpackTouch that gives you one of these dummy items will give you a new key.
The main edge this method has over the two ways of doing runes is that it'll work properly in coop, ie. only players who have taken the key will be able to open the door. The downside is that if they die, the key may be lost forever, as the BackpackTouch works only once.
The way round this is, strangely enough, to use the actual key_touch function instead of BackpackTouch. Just set the items, netname and noise as you desire, and it'll just work.
You'll probably need to have a seperate entity to represent the key visually, that gets removed when the key_touch info_notnull is fired, but not in coop mode. So that's a combination of the coop trigger hack, and one of those dynamic func_illusionary things from the mapping help thread. Phew, and all that to get things working in coop.
If you don't care about coop, you might as well just go down the route of spawning the door's trigger when you "pick up" the key, it's easier and fewer entities for the same result.
Quick New One
#74 posted by Preach on 2006/06/19 16:46:21
For those of you who want to emulate Half-Life, here's how to make monsters mad at one another. You really need to script fights carefully though, you aren't creating alliances between groups of monsters, you're just selectively annoying them as if they shot one another. So after they kill their one target, they'll just stand around unless attacked again, even if others are fighting.
Perhaps a good way to choreograph a bigger brawl would be something like
ogre 1 gets mad at fiend 1
fiend 1 gets mad at ogre 2
ogre 2 gets mad at fiend 2
fiend 2 gets mad at ogre 3
...
fiend n gets mad at ogre 1
that loop should make sure everyone fights.
Anyway, getting ahead of myself, what you do:
Set up your monsters, run the map, type edicts in the console and note down the entity numbers of the monsters you want to fight.
Add a brush over each monster, and convert to info_notnull with the following settings
owner n
use InitTrigger
targetname que1
touch spike_touch
where n is the edict number of the monster you want it to get mad at.
Then two more triggers to set the thing going, a trigger_once with target que1, and an info_notnull with
use teleport_use
targetname que1
In fact, this is such a minor thing, you could even tag it onto the info_player_start you use and save an entity.
Of course, the way it works is that the triggers behave like a nail fired from the monster in the owner field into the target monster, so it gets mad according to the infighting code. You don't have to use trigger brushes, spike_touch and teleport_use if you don't want - voreball and ogre grenade explosions set off from point info_notnulls with owner set have the same effect, if more dramatic in execution. Be warned, this will fail on monsters of the same type - for a minute there I used two knights to test it and thought the hack wasn't gonna work!
New Style Trigger?
#75 posted by Mike Woodham on 2006/06/26 11:09:38
I want a trigger_once that is not 'switched on' for use until some other pre-defined action has taken place; perhaps by a monster dying or a button being activated. This trigger will be in an oft' used area and may be 'touched' many times before I want it to become a trigger_once. The player must remain unaware of the trigger.
I don't want to use doors or buttons, or add any extra brush work, so no 'logic-gate' scenarios.
Is this achievable through some clever use of the trigger_once fields or spawnflags. Or will I need to resort to QC?
Mike
#76 posted by negke on 2006/06/26 12:00:49
#77 posted by negke on 2006/06/26 12:05:12
hmm, on a second thought i always used
"use" "trigger_once"
"touch" "SUB_Null"
probably just another way (without apparent downsides).
Neg!ke
#78 posted by Mike Woodham on 2006/06/26 12:34:17
Thanks for the speedy reply, I'll get on to it.
Neg!ke/Preach
#79 posted by Mike Woodham on 2006/06/26 12:51:09
Great stuff!
Mike:
#80 posted by metlslime on 2006/06/26 13:26:00
Surely logic gates are a better choice than creating a new progs.dat for this one thing.
But I am curious to know if there is a simply one-entity hack to do this; that would be useful.
Oops...
#81 posted by metlslime on 2006/06/26 13:27:41
I must have had this page open for like an hour before commenting :P
|
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|