| This topic has not yet been rated!
|
You have not rated this topic. Select a rating:
|
|
Author |
Topic: Help with Coding (Read 63 times)
|
gimik
Level 1 Trained Beginner
Offline
 United States
Posts: 32
|
 |
« on: November 25, 2009, 08:29:07 PM » |
|
SO I'm just learning to code WCS races and i wrote my first piece of code, was hoping you guys could take a look and help me out. So basically what I'm trying to get out of this is to 'Drug' the person getting shot. It has a 3-15% chance to occur, and it has 5 levels, each level increases the duration by 0.5 sec, starting at 0.5 up to 2.5 seconds. Thanks! "skill1_setting" " es_xset wcs_chance 97;es_xset wcs_duration .50|es_xset wcs_chance 94;es_xset wcs_duration 1|es_xset wcs_chance 91;es_xset wcs_duration 1.5|es_xset wcs_chance 88;es_set wcs_duration 2|es_xset wcs_chance 85;es_xset wcs_duration 2.5" "racealias_drug" "es est_drug wcs_tmp event_var(userid) 1." "skill1_cmd" "if (server_var(wcs_chance) <= server_var(dice)) then racealias_drug" "skill1_sfx" "0"
|
|
|
|
|
Logged
|
|
|
|
Sasuke[Icetouch]
Level 4 Intermediate
  
Offline
 Germany
Posts: 97
FreeTimeCoder
|
 |
« Reply #1 on: November 25, 2009, 08:36:50 PM » |
|
First of all, lookup the syntax for the drug command. Syntax: est_Drug <identifier> [time] The identifier is in this case event_var(userid) -> the victim you want to drug your racealias_drug has to be something like that: GeSHi (eventscripts): "racealias_drug" "es est_drug event_var(userid)"
But, you want a specific duration, so you have to set the time too, to your duration! GeSHi (eventscripts): "racealias_drug" "es est_drug event_var(userid) server_var(wcs_duration)"
That'd be it. Anyone can correct me if I'm wrong.
|
|
|
|
|
Logged
|
################################ Don't think you can believe in what you thought you could believe in. Now, tell me, did you find any sense in that? No? Read it again. Still not? ################################
|
|
|
|
AvasT
|
 |
« Reply #2 on: November 25, 2009, 08:58:27 PM » |
|
Correct. Your skill_cmd is wrong, you have to use if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug  Skill Fixed: "skill1_setting" "es_xset wcs_chance 97;es_xset wcs_duration .50|es_xset wcs_chance 94;es_xset wcs_duration 1|es_xset wcs_chance 91;es_xset wcs_duration 1.5|es_xset wcs_chance 88;es_set wcs_duration 2|es_xset wcs_chance 85;es_xset wcs_duration 2.5" "racealias_drug" "es est_drug event_var(userid) server_var(wcs_duration)" "skill1_cmd" "if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug" "skill1_sfx" "0"
|
|
|
|
|
Logged
|
Lol?
|
|
|
|
Zawmbee
|
 |
« Reply #3 on: November 25, 2009, 09:02:18 PM » |
|
Correct. Your skill_cmd is wrong, you have to use if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug  Skill Fixed: "skill1_setting" "es_xset wcs_chance 97;es_xset wcs_duration .50|es_xset wcs_chance 94;es_xset wcs_duration 1|es_xset wcs_chance 91;es_xset wcs_duration 1.5|es_xset wcs_chance 88;es_set wcs_duration 2|es_xset wcs_chance 85;es_xset wcs_duration 2.5" "racealias_drug" "es est_drug event_var(userid) server_var(wcs_duration)" "skill1_cmd" "if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug" "skill1_sfx" "0" Actually avast, you are incorrect... The chance goes down per level, so it would be chance first then dice  (Unless he wants the chance to go down per level.
|
|
|
|
|
Logged
|
(Anyone who C&P's my races, give credit, TY)
|
|
|
gimik
Level 1 Trained Beginner
Offline
 United States
Posts: 32
|
 |
« Reply #4 on: November 25, 2009, 09:06:00 PM » |
|
So basically I just mixed up where i use (dice)) and (chance)) GeSHi (eventscripts): "skill1_cmd" "if (server_var(wcs_chance) <= server_var(dice)) then racealias_drug"
^^ was my original code I use: GeSHi (eventscripts): "skill1_cmd" "if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug"
|
|
|
|
|
Logged
|
|
|
|
Sasuke[Icetouch]
Level 4 Intermediate
  
Offline
 Germany
Posts: 97
FreeTimeCoder
|
 |
« Reply #5 on: November 25, 2009, 10:17:35 PM » |
|
So basically I just mixed up where i use (dice)) and (chance)) GeSHi (eventscripts): "skill1_cmd" "if (server_var(wcs_chance) <= server_var(dice)) then racealias_drug"
^^ was my original code I use: GeSHi (eventscripts): "skill1_cmd" "if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug"
No, your code was correct, Avast is actually wrong. If you would to your last thing, you would have a chance of 85% to activate the skill. Other way around, it's only 15%, just do what I told you and everything else is just fine.
|
|
|
|
|
Logged
|
################################ Don't think you can believe in what you thought you could believe in. Now, tell me, did you find any sense in that? No? Read it again. Still not? ################################
|
|
|
|
Zawmbee
|
 |
« Reply #6 on: November 26, 2009, 05:05:32 AM » |
|
So basically I just mixed up where i use (dice)) and (chance)) GeSHi (eventscripts): "skill1_cmd" "if (server_var(wcs_chance) <= server_var(dice)) then racealias_drug"
^^ was my original code I use: GeSHi (eventscripts): "skill1_cmd" "if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug"
No, your code was correct, Avast is actually wrong. If you would to your last thing, you would have a chance of 85% to activate the skill. Other way around, it's only 15%, just do what I told you and everything else is just fine. That is exactly what I was saying, however, I did not know if he wanted the chance to be lower since the amount of time it lasts gets longer... That is why I am confused... 
|
|
|
|
|
Logged
|
(Anyone who C&P's my races, give credit, TY)
|
|
|
|
AvasT
|
 |
« Reply #7 on: November 26, 2009, 04:37:38 PM » |
|
I'm not wrong Sasuke, he just reversed chance with dice _(_" It means almost the same thing.
|
|
|
|
|
Logged
|
Lol?
|
|
|
Sasuke[Icetouch]
Level 4 Intermediate
  
Offline
 Germany
Posts: 97
FreeTimeCoder
|
 |
« Reply #8 on: November 26, 2009, 04:41:30 PM » |
|
If you change that, the chance wouldn't be 97-85%, but 3-15%. We don't know if he wants to lower the chance per level, or just want it from 3-15%. But if it's the last thing, I'd recommend doing es_xset wcs_chance 3..15 and not 97-85, more user friendly code
|
|
|
|
|
Logged
|
################################ Don't think you can believe in what you thought you could believe in. Now, tell me, did you find any sense in that? No? Read it again. Still not? ################################
|
|
|
|
|
|