Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2009-11-29 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
November 29, 2009, 05:32:03 AM *
Welcome, Guest. Please login or register.
Login with username, password and session length
News: Hall of Fame
Must Visit it
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1]   Go Down
  Print  
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 Offline

United States 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!

Code:
    "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 Offline

Germany 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:
Code
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!
Code
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
Level 7 Expert
*****
Offline Offline

Brazil Brazil

Posts: 537




doug_tiozao
« Reply #2 on: November 25, 2009, 08:58:27 PM »

Correct. Your skill_cmd is wrong, you have to use

Code:
if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug

Smiley

Skill Fixed:

Code:
    "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
Level 7 Expert
*****
Offline Offline

United States United States

Posts: 753


Watch Tower


« Reply #3 on: November 25, 2009, 09:02:18 PM »

Correct. Your skill_cmd is wrong, you have to use

Code:
if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug

Smiley

Skill Fixed:

Code:
    "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 Cheesy (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 Offline

United States 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))

Code
GeSHi (eventscripts):
  "skill1_cmd" "if (server_var(wcs_chance) <= server_var(dice)) then racealias_drug"

^^ was my original code

I use:

Code
GeSHi (eventscripts):
 "skill1_cmd"     "if (server_var(wcs_dice) <= server_var(wcs_chance)) then racealias_drug"
Logged
Sasuke[Icetouch]
Level 4 Intermediate
****
Offline Offline

Germany 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))

Code
GeSHi (eventscripts):
  "skill1_cmd" "if (server_var(wcs_chance) <= server_var(dice)) then racealias_drug"

^^ was my original code

I use:

Code
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
Level 7 Expert
*****
Offline Offline

United States United States

Posts: 753


Watch Tower


« Reply #6 on: November 26, 2009, 05:05:32 AM »

So basically I just mixed up where i use (dice)) and (chance))

Code
GeSHi (eventscripts):
  "skill1_cmd" "if (server_var(wcs_chance) <= server_var(dice)) then racealias_drug"

^^ was my original code

I use:

Code
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... Tongue
Logged


(Anyone who C&P's my races, give credit, TY)
AvasT
Level 7 Expert
*****
Offline Offline

Brazil Brazil

Posts: 537




doug_tiozao
« 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 Offline

Germany 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 Smiley
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?
################################
Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
Today at 01:07:33 AM
how do i add the wcsCadmin? when i try to cut and paste it in eventscripts it wont let me for some reason..?
Today at 12:07:17 AM
November 28, 2009, 10:59:50 PM
Lol !
November 28, 2009, 09:45:25 PM
heh, I wonder if you deleted me O.o
November 28, 2009, 09:22:11 PM
You could still have declined :p
November 28, 2009, 09:06:48 PM
they added me Tongue
November 28, 2009, 08:49:13 PM
Well Texno, you shouldn't have added all of 'em instantly Smiley
Recent
[Today at 05:18:19 AM]

[Today at 05:15:44 AM]

[Today at 05:13:51 AM]

[Today at 05:03:58 AM]

[Today at 04:58:37 AM]

[Today at 04:58:00 AM]

[Today at 03:25:51 AM]

[Today at 01:54:35 AM]

[Today at 01:43:10 AM]

[Today at 12:54:21 AM]
Theme switch

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.373 seconds with 26 queries.