give health in MP


(Codey) #1

Hi, I have looked far and wide for something relating to what I’m trying to do and can’t find a solution, so maybe somebody here would be nice enough to help out.

I’ve been trying to get a scripted event to give the activator (player) a health pack.

First I tried target_give, but I can’t seem to get that to work, I targeted it to a item_health_small, but it doesn’t seem to show up activatable in the map and unfortunately the docs on that item are pretty thin.

In the ai scripting manual it mentions givearmour and giveinventoryitem but I’m assuming the ai scripting is for single player mode only???

hoping there is a way to do this?
thanks for your help in advance

<font size=-1>[ This Message was edited by: Codey on 2002-07-23 00:56 ]</font>


(sock) #2

On 2002-07-23 00:50, Codey wrote:
First I tried target_give, but I can’t seem to get that to work, I targeted it to a item_health_small, but it doesn’t seem to show up activatable in the map and unfortunately the docs on that item are pretty thin.

“Target_give” is a throw back to the Q3 days and I will have to ask to see if the code is live anymore. I suspect not, because it would break/unbalance the gameplay of MP.

On 2002-07-23 00:50, Codey wrote:
In the ai scripting manual it mentions givearmour and giveinventoryitem but I’m assuming the ai scripting is for single player mode only???

Yep the AI script file is SP only.

Sock
3D Brush Monkey


(SCDS_reyalP) #3

at least on mp map has health packs lying around. mp_creature, I think. you might want to have a look at that.


(sock) #4

I’ve been told by the coding people here that the “target_give” code does work ok, but your next problem is finding a health pack entity which will work in MP.

Sock
3D Brush Monkey


(Codey) #5

Excellent, thanks for the help thus far, I’m going to try all the health entities in a test map then, see how I go.

p.s I’m so desperate to get this idea to work, I even tried trigger_hurt with a negative dmg value, thought it might give health if I did that but no… lol

thanks again
Codey

<font size=-1>[ This Message was edited by: Codey on 2002-07-24 00:51 ]</font>

<font size=-1>[ This Message was edited by: Codey on 2002-07-24 01:02 ]</font>


(Codey) #6

Ok, I put all the health entities in a room and only two:

item_health_breadandmeat
item_health_wall_box

don’t work

So then I targeted a target_give at one of the other health entities, but in the game the health I have targeted is no longer there and the target_give itself is not “touchable” or usable by the player. It’s when I give the health item a targetname, it doesn’t show up anymore.

So then I added a func_invisible user and targeted it to the target_give, didn’t do anything either.

Also tried “alertentity” on the target_give from script but that made RTCW fall over heeh, I impressed with abilities to crash program.

Is there another way of setting up a target_give?? I’m running out of options here.

<font size=-1>[ This Message was edited by: Codey on 2002-07-24 02:04 ]</font>

<font size=-1>[ This Message was edited by: Codey on 2002-07-24 02:14 ]</font>

<font size=-1>[ This Message was edited by: Codey on 2002-07-24 03:04 ]</font>


(sock) #7

Generally in Q3 “target_give” was used to setup the player with certain items when they spawned. You would setup the “target_give” entity with a targetname to all spawn points in the map and a target field to all items you wanted them to have. It was an special entity which was fired/used at the beginning of a match.

The problem with RTCW is that the MP and SP are different code bases and not all entity items are supported in both exe’s. As you are finding out most of the health packs from the SP are not present or maybe not functionally.

One possibility for using the “target_give” after the game has started is to point a “target_relay” at the “target_give” and alertentity the “target_relay” from a script. The script section could be started via “trigger_multiple” brush linked to “target_script_trigger” entities.

Sock
3D brush Monkey


(Codey) #8

Thanks sock, I tried that with the enities setup the way you described, but I get illegal operations from RTCW.

Oh well, I’m sure there must be a way to do it, but I’m all out of time on this map, so I think I’ll leave it to a little later when I have time to experiment some more.

Thanks to everyone for your help.


(WeblionX) #9

Wanna just put the health packs in? Or do you want it to happen everytime when someone spawns? I know the small health packs work because I once had to test the layout of a SP map in MP 'cause SP kept crashing. I think they may respawn though, so Hrm…


(kat) #10

<font size=“2”>Codey…
I was just doing some editing and placed a target_relay and noticed all the stuff you can do with them… have a read thru the editor comments as you may be able to do what you need by setting or using ‘keys’ and triggering the event indirectly (still not sure about this myself so it’s just a speculative thought)</font>


(Codey) #11

The way I wanted it to work is, if I put a trigger in the map and the player using it will receive 5 health each time.

With a target_relay I would be able to have the axis or allies only operation.
But the problem comes in the actual giving of the health to the player.

It seems that the target_give only works in SP, for health items anyway, haven’t tried it for anything else. Also trigger_hurt will not work in reverse, ie set DMG -5, will not give player health instead of taking it away.

Having a health enitity lying there would be counter-intuitive because it’s supposed to look like the item the player is activating (behind the trigger) is giving the health out.

It’s possible that this could change the gameflow a bit, but it is for small amounts of health placed away from the main areas, so if the player can make it there from a battle, they deserve to get a bit of health top-up.

Thanks for the help guys. Keep those ideas flowing we’re bound to come up with something.


(WeblionX) #12

Script movers that give out the health packs? (eg Open a drawer and there’s a health pack! Woah!) But I have no idea what this device is you’re making, so… That’s about it for now.


(Codey) #13

The idea is to have the health points go directly to the player, not from a spawned health entity. However if it can be done using a hidden health pack, that’s ok too.

There are several items that you could want give out health in a game, eg:

Soda Machine
Water Taps/basin
Snack vending machines
Fantasy scenerio health pooln thingy
Recharger machines like HL

Any of the above would be a candidate for that type of health gives and many more I can’t think of atm.

Making the health spawn from the object infront of the player might be one way to do it, but that won’t work for something like a tap where you are supposed to be drinking from it.
Which is the type of thing I’m trying to do.

Anyway it won’t make it into my latest map now, as it’s about to go beta, I’ll try something like that on my next project or the SP conversion.


(WeblionX) #14

If it is possible to, you can make the health pack move really fast so the player doesn’t notice it. Unfortunately my editor’s a little wacky atm so I can’t test anything (Well… I COULD, but it’d take forever to even make a simple map)


(krekits) #15

Since it’s been established that it works the same in RTCW as in Q3, all you need to do is read the Radiant manual. This question was on another forum yesterday so I tested in in a small map.

http://www.qeradiant.com/manual/Q3Rad_Manual/appndx/appn_b_7.htm#target

The manual mentions q3dm10’s health beam as an example, you can have it work differently if you want though.


(Codey) #16

Ok, thanks for all the help, I’ll give it a try the way it suggests.

And all I had to do was RTFM, oh dear, I assumed it had the same info in the manual as comes up in the enitity window so I didn’t look in there.

Thanks again
Codey


(Codey) #17

Um, I just tested in a small map, as per the manual:


To give items to players during the game: make a trigger_multiple target this entity, then make it target the item(s) to give to the player when the trigger is touched. This is how the column of health and armor in Q3DM10 works.

I can’t for the life of me get it to work with a trigger_multiple.


(digibob) #18

I’ll test it when i get a free minute, say mebe next year sometime :wink:


(bani) #19

On 2002-07-29 04:46, Codey wrote:
The idea is to have the health points go directly to the player, not from a spawned health entity. However if it can be done using a hidden health pack, that’s ok too.

i could add a health trigger to the scripting functions in RTCW for my mod, though your map would only work on servers running the mod.

fortunately its a server-side only mod so clients dont need to download anything.

if this is important enough to you, let me know. it would be nice to have a mod-specific map done :grin:


(damocles) #20

Does anyone know the name of the ammo pack item? The one dropped by Lts in MP. I’m going to try using the target_give, but I wanted to give ammo instead of health.