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 2008-06-15 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
June 15, 2008, 01:35:37 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Races and Items added into Download section from our great Race Coders!
Such as HOLLIDAY|NovaKiller|Stinkyfax|Frodo|TeacherCreature|Phat_Wizard
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1]   Go Down
  Print  
Author Topic: variable power on skills  (Read 61 times)
seconds
Level 4 Intermediate
****
Offline Offline

United States United States

Posts: 82



« on: June 04, 2008, 10:42:44 PM »

i thought of a way of making a skill have 10 outcomes when its activated but im not shur if its possible with how i wanted to do it and i would like you opinion


Code:
"skill1_cmd" "es_if (rand > 0) then es_if (rand < 10) then racealias_1dmg
;es_if (rand > 10) then es_if (rand < 20) then racealias_2dmg
;es_if (rand > 20) then es_if (rand < 30) then racealias_3dmg
;es_if (rand > 30) then es_if (rand < 40) then racealias_4dmg
;es_if (rand > 40) then es_if (rand < 50) then racealias_5dmg
;es_if (rand > 50) then es_if (rand < 60) then racealias_6dmg
;es_if (rand > 60) then es_if (rand < 70) then racealias_7dmg
;es_if (rand > 70) then es_if (rand < 80) then racealias_8dmg
;es_if (rand > 80) then es_if (rand < 90) then racealias_9dmg
;es_if (rand > 90) then es_if (rand < 100) then racealias_10dmg"


"racealias_1dmg" "damage code here"

if i set a rand between 1 100 would this make the correct alias fire coded like this?
Logged
KaBoom
Level 3 Trained Apprentice
***
Offline Offline

United States United States

Posts: 79


Still learning Python. Hold on lol!



famaskaboom
« Reply #1 on: June 05, 2008, 12:46:36 AM »

Well, you have to do make(set) a rand first by using es_xrand rand 1 100 in your case (like you mentioned) or use server_var(wcs_dice). If you continue to use 'rand' by using my first method, make sure it is server_var(rand). Besides that, what you are doing is how you do it, but two things of advice: This skill only has about a 90% chance of working, because if the dice lands exactly on 10, 20, 30, 40, 50, 60, etc. then nothing happens. Secondly, its not es_if, its just if or es_xif for the non-expanded version. At least you have the idea.

Two possible fixed versions:
Code:
"skill1_cmd" "es_xrand rand 1 100
;if (server_var(rand) > 0) then if (server_var(rand) < 10) then racealias_1dmg
;if (server_var(rand) > 10) then if (server_var(rand) < 20) then racealias_2dmg
;if (server_var(rand) > 20) then if (server_var(rand) < 30) then racealias_3dmg
;if (server_var(rand) > 30) then if (server_var(rand) < 40) then racealias_4dmg
;if (server_var(rand) > 40) then if (server_var(rand) < 50) then racealias_5dmg
;if (server_var(rand) > 50) then if (server_var(rand) < 60) then racealias_6dmg
;if (server_var(rand) > 60) then if (server_var(rand) < 70) then racealias_7dmg
;if (server_var(rand) > 70) then if (server_var(rand) < 80) then racealias_8dmg
;if (server_var(rand) > 80) then if (server_var(rand) < 90) then racealias_9dmg
;if (server_var(rand) > 90) then if (server_var(rand) < 100) then racealias_10dmg"

"racealias_1dmg" "damage code here"
Code:
"skill1_cmd" "if (server_var(wcs_dice) > 0) then if (server_var(wcs_dice) < 10) then racealias_1dmg
;if (server_var(wcs_dice) > 10) then if (server_var(wcs_dice) < 20) then racealias_2dmg
;if (server_var(wcs_dice) > 20) then if (server_var(wcs_dice) < 30) then racealias_3dmg
;if (server_var(wcs_dice) > 30) then if (server_var(wcs_dice) < 40) then racealias_4dmg
;if (server_var(wcs_dice) > 40) then if (server_var(wcs_dice) < 50) then racealias_5dmg
;if (server_var(wcs_dice) > 50) then if (server_var(wcs_dice) < 60) then racealias_6dmg
;if (server_var(wcs_dice) > 60) then if (server_var(wcs_dice) < 70) then racealias_7dmg
;if (server_var(wcs_dice) > 70) then if (server_var(wcs_dice) < 80) then racealias_8dmg
;if (server_var(wcs_dice) > 80) then if (server_var(wcs_dice) < 90) then racealias_9dmg
;if (server_var(wcs_dice) > 90) then if (server_var(wcs_dice) < 100) then racealias_10dmg"

"racealias_1dmg" "damage code here"

BTW, you don't need to put each piece of code on a different line, but you can if it helps you understand/see the code better.
-KaBoom!
Logged

Don't reply, unless you have something useful to say.

Don't steal. The government hates competition.

There are 10 kinds of people in this world, those who can read binary and those who can't.
RK1132
Level 3 Trained Apprentice
***
Offline Offline

United States United States

Posts: 73




Kballer117

myServer 67.201.15.212:27015
(Warning: click connects through Steam)
« Reply #2 on: June 05, 2008, 12:50:11 AM »

IDK
but kaboom is pretty smart
Logged

:0
seconds
Level 4 Intermediate
****
Offline Offline

United States United States

Posts: 82



« Reply #3 on: June 05, 2008, 02:48:27 AM »

awsome    i was going to do the es_rand in settings as a level up thing lvl 1 rand 1 10 lvl 2 rand 1 20 ect. TY for the help!!!   

im going to be making and entire pack of races based off of this and they will be named for elements... there will be upto 4 tiers in the pack. and each tier will represent the complexity of the race im hoping for 20-30 races total

edit: total after thought

the wcs_dice can be made to 100% working by changing the first if variable and setting a >= or =<

Code:
"skill1_cmd" "if (server_var(wcs_dice) >= 1) then if (server_var(wcs_dice) =< 10) then racealias_1dmg
;if (server_var(wcs_dice) >= 11) then if (server_var(wcs_dice) =< 20) then racealias_2dmg
;if (server_var(wcs_dice) >= 21) then if (server_var(wcs_dice) =< 30) then racealias_3dmg
;if (server_var(wcs_dice) >= 31) then if (server_var(wcs_dice) =< 40) then racealias_4dmg
;if (server_var(wcs_dice) >= 41) then if (server_var(wcs_dice) =< 50) then racealias_5dmg
;if (server_var(wcs_dice) >= 51) then if (server_var(wcs_dice) =< 60) then racealias_6dmg
;if (server_var(wcs_dice) >= 61) then if (server_var(wcs_dice) =< 70) then racealias_7dmg
;if (server_var(wcs_dice) >= 71) then if (server_var(wcs_dice) =< 80) then racealias_8dmg
;if (server_var(wcs_dice) >= 81) then if (server_var(wcs_dice) =< 90) then racealias_9dmg
;if (server_var(wcs_dice) >= 91) then if (server_var(wcs_dice) =< 100) then racealias_10dmg"

"racealias_1dmg" "damage code here"

« Last Edit: June 05, 2008, 07:44:08 AM by seconds » Logged
mobsi
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 203



« Reply #4 on: June 05, 2008, 03:10:38 PM »

made sth similar some time ago but never published it 

but still very nice

greez mobsi
Logged

better the devil you know than the devil you don't
KaBoom
Level 3 Trained Apprentice
***
Offline Offline

United States United States

Posts: 79


Still learning Python. Hold on lol!



famaskaboom
« Reply #5 on: June 05, 2008, 08:11:58 PM »

Awesome, you understood me  . You could also avoid complication by doing something like:
Code:
"skill1_cmd" "es_xrand rand 1 10
;if (server_var(rand) = 1) then racealias_1dmg
;if (server_var(rand) = 2) then racealias_2dmg
;if (server_var(rand) = 3) then racealias_3dmg
;if (server_var(rand) = 4) then racealias_4dmg
;if (server_var(rand) = 5) then racealias_5dmg
;if (server_var(rand) = 6) then racealias_6dmg
;if (server_var(rand) = 7) then racealias_7dmg
;if (server_var(rand) = 8) then racealias_8dmg
;if (server_var(rand) = 9) then racealias_9dmg
;if (server_var(rand) = 10) then racealias_10dmg"

"racealias_1dmg" "damage code here"
Logged

Don't reply, unless you have something useful to say.

Don't steal. The government hates competition.

There are 10 kinds of people in this world, those who can read binary and those who can't.
seconds
Level 4 Intermediate
****
Offline Offline

United States United States

Posts: 82



« Reply #6 on: June 06, 2008, 08:31:53 AM »

ohh i didnt even think about that lol... ima test it with the 1-100 first and all but if i dont like how it turns out ill use that
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
June 14, 2008, 12:19:10 AM
June 13, 2008, 03:03:35 PM
Howard Webb - Rest in Hell
June 13, 2008, 11:13:33 AM
!@#$% It didn't work
June 13, 2008, 11:07:46 AM
Nvm, i think i figured it out, i had to use this thingy STEAM_0:1:15758148
June 13, 2008, 10:36:09 AM
Yeah, can someone help me with my admin problem? I can't seem to make myself admin
June 11, 2008, 07:37:06 AM
@Takibo: http://warcraft-source.com/board/index.php/topic,809.0.html
Man! People need to learn how to use the search function these days!
June 11, 2008, 12:08:31 AM
Where's the RPG race?
Recent
[Today at 12:06:26 AM]

[Today at 12:04:56 AM]

[Today at 12:03:10 AM]

[June 14, 2008, 10:59:40 PM]

[June 14, 2008, 09:56:05 PM]

[June 14, 2008, 09:52:17 PM]

[June 14, 2008, 09:41:24 PM]

[June 14, 2008, 09:34:06 PM]

[June 14, 2008, 08:49:41 PM]

[June 14, 2008, 08:46:41 PM]
Theme switch

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.05 seconds with 29 queries.