Healt system

Any aspects of level design for the Source engine.

Re: Healt system

Postby Esbentikjoeb on Sun Mar 02, 2014 9:25 pm

I can inform you that I got the question to my second problem.

The SetHealth works like a charm. I still need to get rid of the first problem though. (getting players hp by going through a port, but only one time)

What i basicly need is a trigger_multiple that works like a trigger_once for every individual player. And i don't really know how to do so. Maybe I could use something like a filter_player_name and make every single player get a targetname or something? I just don't know for sure how to do that...
Esbentikjoeb
Dumpling
Dumpling
 
Joined: Sun Mar 02, 2014 6:06 pm

Re: Healt system

Postby Mehis on Sun Mar 02, 2014 9:31 pm

How I would do it:

- All players start with specific targetname and health
- Use trigger_multiple with:
OnStartTouch > !activator (works in MP) > AddOutput > targetname ply_10hp
OnStartTouch > !activator > AddOutput > health 10 (might've been sethealth, I forgot)

- Each port has trigger_multiple(s) (depending on if the ports are linear. aka can you only cross them in order or randomly)
- Triggers can only be triggered by entity named ply_10/20/30/...hp, which will then give you the HP and specific name

Example:

Player spawns in the map, is named ply_10hp and HP set to 10. Player tries to go to port that will give 50hp but fails because isn't named ply_40hp.

You see where I'm getting at?
User avatar
Mehis
Regular
Regular
 
Joined: Fri Jan 28, 2011 8:41 pm

Re: Healt system

Postby Esbentikjoeb on Sun Mar 02, 2014 9:56 pm

It's not linear so players will be able to go back to the first port and that's why i need it to unactivate for that specific player after he received his 10 hp. But it still have to work for the rest of the players :)

It could be a solution to give all players a name, but how do I do that exactly? Should they all be called "normal player" and when they enter the first port for instance, they will be called "specialplayer1"?

But when they advance to the next port i'll have to give them a new name so they wont be able to reenter port 2, but with that new name they will be able to go back to port 1. Unless it's possible to give players multiple names?

Hehe. I have really never used filter_activator_name before :D
Esbentikjoeb
Dumpling
Dumpling
 
Joined: Sun Mar 02, 2014 6:06 pm

Re: Healt system

Postby Esbentikjoeb on Sun Mar 02, 2014 11:24 pm

okay a little update on the matter:

When all players start they will be named "x"
When they reach the port there is a trigger_multiple and a trigger_hurt and a filter_activator_name.
The trigger_hurt only heals players named "x"
Just after the player gets the 10hp from the trigger_hurt the trigger_multiple erases the name "x" and gives the name "q"
The next port has the same entities except the trigger_hurt only accepts the name "q"

This method works, but the placement of the trigger_multiple is essential. For example when the name "x" is given at the very start it is at outmost importance that players can't reach this trigger again (unless they respawn/restart at the level). Because if they can reach that spot again, they will be able to go from the trigger_multiple to the trigger_hurt as much as they want.

So it's all about placing the trigger_multiples right for this to work :D
Esbentikjoeb
Dumpling
Dumpling
 
Joined: Sun Mar 02, 2014 6:06 pm
Previous

Return to Hammer Editor Help

Who is online

Users browsing this forum: Bing [Bot]