| This topic has not yet been rated!
|
You have not rated this topic. Select a rating:
|
|
Author |
Topic: [Help]Burn when below 50 HP (Read 128 times)
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« on: August 23, 2009, 03:01:36 PM » |
|
First of all, this is my first post here on the WCS forums, I'm very new to making races, so please bear with me if I make any noobish mistakes. I've been working on this new tank race for my server. I want it to catch fire for 10 seconds when it gets below 50 health (the 10 seconds is because you burn at 5 hp/sec, so you'll burn until you hit 0), but I don't want to make it a skill of its own for a very simple reason- no one would put points into it. So, I decided to just add it to the beginning of one of his existing skills' CMDs. The code looks like this: GeSHi (eventscripts): es est_gethealth hp_count event_var(userid);if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10
I'm thinking maybe my parentheses aren't right, but aside from that, I really don't know what's wrong with it. When the tank drop below 50 hp, he just doesn't burn. I really need help with this race, can someone give me a hand here? EDIT: Feel free to contact me on Xfire or Steam with any help you can provide.
|
|
|
|
« Last Edit: August 25, 2009, 02:01:51 AM by WhiteKnight »
|
Logged
|
|
|
|
ScHigGn
Level 2 Apprentice

Offline
 Germany
Posts: 52
 -]CSF[- ScHigGn.demyServer 82.98.216.198:27000(Warning: click connects through Steam)
|
 |
« Reply #1 on: August 23, 2009, 07:12:12 PM » |
|
Try This es_xset hp_count 0; es est_gethealth hp_count event_var(userid);if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10
|
|
|
|
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #2 on: August 23, 2009, 10:58:58 PM » |
|
Thanks for the reply, but that doesn't seem to have worked either. Any other ideas? Maybe the problem lies in the fact that I'm just adding this to the cmd of another skill? Should I put this in the player_spawn_cmd instead? EDIT: Alright, I tried adding it to the player spawn and it still didn't work. Here's what my player_spawn_cmd looks like at the moment: es wcs_restrict event_var(userid) allow m3 1 0 0;es est_setclipammo event_var(userid) 2 100;es est_speed event_var(userid) 0.5;es_xset hp_count 0; es est_gethealth hp_count event_var(userid);if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10 Since the race IS a tank, it gets only a shotgun, extra ammo, reduced speed, and it's SUPPOSED to catch fire when below 50 HP. It still doesn't work.
|
|
|
|
« Last Edit: August 23, 2009, 11:07:47 PM by WhiteKnight »
|
Logged
|
|
|
|
ScHigGn
Level 2 Apprentice

Offline
 Germany
Posts: 52
 -]CSF[- ScHigGn.demyServer 82.98.216.198:27000(Warning: click connects through Steam)
|
 |
« Reply #3 on: August 23, 2009, 11:08:13 PM » |
|
event player_hurt { es_xset hp_count 0 es est_gethealth hp_count event_var(userid) if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10 } Or in a "player_victim" Skill... es_xset hp_count 0; es est_gethealth hp_count event_var(userid);if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10
|
|
|
|
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #4 on: August 23, 2009, 11:27:30 PM » |
|
Well, the tank doesn't have any player_victim skills, but where would I add that first code?
|
|
|
|
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #5 on: August 24, 2009, 05:39:30 PM » |
|
bump
|
|
|
|
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #6 on: August 24, 2009, 06:44:47 PM » |
|
event player_hurt { es_xset hp_count 0 es est_gethealth hp_count event_var(userid) if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10 } Well, I didn't know where to put that code, so I tried simply taking the middle part and separating it by semicolons and putting it in the player_spawn_cmd. It still didn't work, though. es_xset hp_count 0;es est_gethealth hp_count event_var(userid);if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10 That's what I put in the player_spawn_cmd. Can someone else help?
|
|
|
|
« Last Edit: August 25, 2009, 02:00:00 AM by WhiteKnight »
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #7 on: August 25, 2009, 02:02:01 AM » |
|
bump.
|
|
|
|
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #8 on: August 28, 2009, 07:54:07 AM » |
|
bump.
I'm a bit disappointed here, people typically reply to other people's help topics quite quickly...
|
|
|
|
|
Logged
|
|
|
|
Crazy
Level 2 Apprentice

Offline
 United States
Posts: 54
|
 |
« Reply #9 on: August 28, 2009, 07:32:21 PM » |
|
Whiteknight, what I think you have to do is, make a keygroupcreate, and set The Tank to that group. Then go to event player_hurt in your wcs.txt and insert something along the lines of a check to see if the event_var(userID) is in that keygroup, and if he is then you make it check for the health, and if the health is lower than 50 do est_burn.
|
|
|
|
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #10 on: August 30, 2009, 01:58:36 AM » |
|
Whiteknight, what I think you have to do is, make a keygroupcreate, and set The Tank to that group. Then go to event player_hurt in your wcs.txt and insert something along the lines of a check to see if the event_var(userID) is in that keygroup, and if he is then you make it check for the health, and if the health is lower than 50 do est_burn.
Is there no simpler way to do this? I'm really new to creating races, really, so can you give me step-by-step instructions?
|
|
|
|
|
Logged
|
|
|
|
Crazy
Level 2 Apprentice

Offline
 United States
Posts: 54
|
 |
« Reply #11 on: August 30, 2009, 02:31:45 AM » |
|
When it comes to keysetvalues I'm as lost as you are my friend. All I know is that what I told you will work. But also, when you guys posted this code... GeSHi (eventscripts): es_xset hp_count 0;es est_gethealth hp_count event_var(userid);if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10
You guys forgot 2 parenthesis or however you spell it. GeSHi (eventscripts): es_xset hp_count 0;es est_gethealth hp_count event_var(userid);if (server_var(hp_count) <= 50) then es est_Burn event_var(userid) 10
|
|
|
|
|
Logged
|
|
|
|
WhiteKnight
Level 1 Trained Beginner
Offline
 United States
Posts: 25
 Killplan02WhiteKnight30303myServer wcs.pixel-gamers.com:27016(Warning: click connects through Steam)
|
 |
« Reply #12 on: August 30, 2009, 06:41:56 AM » |
|
When it comes to keysetvalues I'm as lost as you are my friend. All I know is that what I told you will work. But also, when you guys posted this code... GeSHi (eventscripts): es_xset hp_count 0;es est_gethealth hp_count event_var(userid);if server_var(hp_count) <= 50 then es est_Burn event_var(userid) 10
You guys forgot 2 parenthesis or however you spell it. GeSHi (eventscripts): es_xset hp_count 0;es est_gethealth hp_count event_var(userid);if (server_var(hp_count) <= 50) then es est_Burn event_var(userid) 10
I tried it with the updated parentheses, and unfortunately, it still didn't work. Go figure. EDIT: Perhaps someone with a bit more experience in this area can give us some help here?
|
|
|
|
« Last Edit: August 30, 2009, 07:51:43 AM by WhiteKnight »
|
Logged
|
|
|
|
|
|
|
|
|