February 17, 2020, 03:40:57 PM

Author Topic: [Tutorial] How to Make a Race  (Read 1504 times)

Offline Grim Reaper

  • Level 7 Expert
  • *****
  • Posts: 218
  • WCS Coding helper :)
[Tutorial] How to Make a Race
« on: May 15, 2010, 01:16:24 AM »
*UPDATE* The Coded Version Of the Race is now up.
*UPDATE* Chapter B2. Is up.

Today I am going over the basic race coding stuff (Not Coding the Skills) But just an example on what things do for everything. So basically this is what a race looks like later in this session i will use the skills for it.
I'm Hoping for admins to make this a sticky  ;D so then well I'll always see this topic and so will everyone else
[Chapter B1.] (Basic Race Coding)
Code: [Select]
// "1" <Race Number goes here (This racenumber shows where you will find the race at in changerace)
// { <This "{" Always come after the race number
// "name" "Wolf of the Wind" <What you want the name of the race called (Keep it short)
// "author" "Reaper" <Who made the race goes here
// "shortdescription" "The fast Predator" <Describe the race example: "shortdescription" "The camoflaged man!"
// "required_level" "30" <What lvl you need before you can use the race
// "maximum_level" "0" <How many times you can lvl on this race before you can't use it again "0" disables this
// "allow_only" "0" <Who can use this race example: "allow_only" "<STEAM_X:X:XXXXXXX>"
// "teamlimit" "0" <How many people can use this race on each team
// "restrict_shop" "<bootspeed20>" <What item from the shopmenu the race can't use example "restrict_shop" "<bootspeed20>"
// "preloadcmd" "0" <Cmd means "Command" so what do you think it does?
// "player_spawn_cmd" "0" <This will restrict weapons
// "round_start_cmd" "0" <This is the command that you use when the round starts
// "round_end_cmd" "0" <This is what will happen on death
// "numberofskills" "4" <This is how many skills you have on the race
// "numberoflevels" "6" <This is how many times you can level each skill
// "skillnames" "Claws|Fatal Bite|Stamina|Howl of the Wind" <This is what you use to name your skills but you have to have the "|" Between each skill
// "skilldescr" "The claws of the wolf deal more damage|Chance to Poison the Enemy|Stamina|Deal damage to nearby enemy's" <This is how you describe the skill
// "skillcfg" "Player_attacker|Player_attacker|Player_spawn|Player_ultimate" <This is how the skill will activate Example: "skillcfg" "Player_spawn|Player_attacker|Player_victim"
// } <Don't forget to keep these "{" "}" Even on each side
Now below this is the coded Version of the race so take a look.
Code: [Select]
Coded race
By: Reaper

// "1"
// {
// "name"                                 "Wolf of the Wind"
// "shortdescription"                "The fast Predator"
// "author"                               "Reaper"
// "required_level"                   "30"
// "maximum_level"                  "0"
// "allow_only"                         "0"
// "teamlimit"                            "0"
// "restrict_shop"                    "<bootspeed20>"
// "preloadcmd"                        "0"
// "player_spawn_cmd"            "0"
// "round_start_cmd"                "0"
// "round_end_cmd"                  "0"
// "numberofskills"                     "4"
// "numberoflevels"                    "6"
// "skillnames"                            "Claws|Stamina|Fatal Bite|Howl of the Wind"
// "skilldescr"                              "Deal extra Damage with your claws|Poison your enemy with your Fatal Bite|Speed Boost|Deal damage to Nearby enemy's"
// "skillcfg"                                  "Player_attacker|Player_attacker|Player_spawn|Player_ultimate"

// "skill1_setting"    "es_xset wcs_multiplier 0.9|es_xsetinfo wcs_multiplier 1.0|es_xsetinfo wcs_multiplier 1.1|es_xsetinfo wcs_multiplier 1.2|es_xsetinfo wcs_multiplier 1.3|es_xsetinfo wcs_multiplier 1.4"
// "racealias_knifedmg"  "es_set wcs_dmg event_var(dmg_health);es_xmath wcs_dmg float;es_math wcs_dmg * server_var(wcs_multiplier);es est_RoundDecimal wcs_dmg server_var(wcs_dmg) 0;es wcs_dealdamage event_var(attacker) event_var(userid) server_var(wcs_dmg);wcs_getlanguage wcs_lng wcs_lng_r_knifedmg;es_format wcs_lng server_var(wcs_lng) event_var(es_attackername) server_var(wcs_dmg) event_var(es_username);es_tell event_var(attacker) #multi server_var(wcs_lng);es_tell event_var(userid) #multi server_var(wcs_lng)"
// "skill1_cmd"        "if (event_var(weapon) in server_var(wcs_wpn_knives)) then racealias_knifedmg"
// "skill1_sfx"        "if (event_var(weapon) in server_var(wcs_wpn_knives)) then es_xgetplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(userid);es_xmath wcs_z1 + 50;if (event_var(weapon) in server_var(wcs_wpn_knives)) then est_effect 11 #a 0 sprites/purpleglow1.vmt server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) 2 4 255"

// "skill2_setting"     "es_xsetinfo wcs_speed 1.2;es_xsetinfo wcs_alpha 90|es_xsetinfo wcs_speed 1.26;es_xsetinfo wcs_alpha 110|es_xsetinfo wcs_speed 1.32;es_xsetinfo wcs_alpha 130|es_xsetinfo wcs_speed 1.38;es_xsetinfo wcs_alpha 150|es_xsetinfo wcs_speed 1.44;es_xsetinfo wcs_alpha 170|es_xsetinfo wcs_speed 1.5;es_xsetinfo wcs_alpha 190"
// "skill2_cmd"         "es es_xkeygetvalue wcs_tmp WCSuserdata event_var(userid) speed;es es_xif (server_var(wcs_speed) > server_var(wcs_tmp)) then es est_Speed event_var(userid) server_var(wcs_speed);es es_xif (server_var(wcs_speed) > server_var(wcs_tmp)) then es_xkeysetvalue WCSuserdata event_var(userid) speed server_var(wcs_speed);wcs_getlanguage wcs_lng wcs_lng_r_unholyact;es es_xtell event_var(userid) #multi #lightgreen: You just got a Stamina Boost"
// "skill2_sfx"         "es es_xgetplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(userid);es est_effect 10 #a 0 sprites/smoke.vmt server_var(wcs_x1) server

// "skill3_setting" "es_xset wcs_dmg 5;es_xset wcs_time 5|es_xset wcs_dmg 7;es_xset wcs_time 6|es_xset wcs_dmg 9;es_xset wcs_time 7|es_xset wcs_dmg 11;es_xset wcs_time 8|es_xset wcs_dmg 12;es_xset wcs_time 9|es_xset wcs_dmg 14;es_xset wcs_time 10"
// "skill3_cmd" "es wcs_dealpoison event_var(attacker) event_var(userid) server_var(wcs_time) server_var(wcs_dmg);es_tell event_var(attacker) You did a Poisonous fatal bite to the enemy"
// "skill3_sfx" "0"

// "skill4_setting"     "es_xsetinfo wcs_maxtargets 2;es_xsetinfo wcs_radius 500|es_xsetinfo wcs_maxtargets 3;es_xsetinfo wcs_radius 550|es_xsetinfo wcs_maxtargets 3;es_xsetinfo wcs_radius 600|es_xsetinfo wcs_maxtargets 3;es_xsetinfo wcs_radius 650|es_xsetinfo wcs_maxtargets 4;es_xsetinfo wcs_radius 700|es_xsetinfo wcs_maxtargets 4;es_xsetinfo wcs_radius 750"
// "skill4_cmd"         "es_xdoblock wcs/WCSultimates/wcs_ulti_chain"
// "skill4_sfx"         "0"
// "ultimate_cooldown"  "31|29|28|27|26|25"
// }
And that would be the correct way to code a race.
Any questions please comment.

[Chapter B2.] (Skill Settings)

In this Chapter i am going to show you skill settings.

For example if your "numberoflevels" is at "6" and the skill your working on is speed it will be
Code: [Select]
"skill1_setting"     "es_xset wcs_speed 1.15|es_xset wcs_speed 1.25|es_xset wcs_speed 1.35|es_xset wcs_speed 1.45|es_xset wcs_speed 1.55|es_xset wcs_speed 1.65"
And the point of "skill#_setting" is because if there's no skill_setting there's no leveling or getting higher speed. (Be sure to always keep your "numberoflevels" even with your "skill#_setting")

And now We are going to go over are basic skill_setting cmd's
Code: [Select]
1. wcs_speed (Higher Speed)

2. wcs_gravity (Lower Gravity)

3. wcs_dmg (Damage)

4. wcs_divider (Divide)

5. wcs_multiplier (Multiply Damage)

6. wcs_chance (Chance of something happening)

7. wcs_addhealth (Extra Health)
There are more than just that but those are the basic ones.
But now you need to know where to put these at.
You ALWAYS put them after the es_xset.
It doesn't matter which setting cmd it always comes after the es_xset.
But how do you use them?.
Use it WITH the wcs Like this
Code: [Select]
"skill#_setting"   "es_xset wcs_speed 1.5"
So now you know to use it WITH the wcs.
How many ways are there to do skill settings?.
I only Know of 2 es_xsetinfo wcs_X and es_xset wcs_X you can use them both ways.
Code: [Select]
"skill#_setting"   "es_xsetinfo wcs_speed 1.5"
Or this
Code: [Select]
"skill#_setting"   "es_xset wcs_speed 1.5"
So now you know WHERE and HOW to use skill settings.
« Last Edit: May 15, 2010, 07:12:43 PM by Grim Reaper »
Looking for photo :(

Offline X510

  • Level 5 Trained Intermediate
  • *****
  • Posts: 116
  • intermediate wcs coder
    • G2X Website
Re: [Tutorial] Basic Race Coding
« Reply #1 on: May 15, 2010, 06:06:36 AM »
« Last Edit: May 15, 2010, 06:39:45 AM by X510 »

ADD ME ON FACEBOOK X510's facebook

Offline MiBShidobu

  • Level 7 Expert
  • *****
  • Posts: 1620
  • Country: us
Re: [Tutorial] Basic Race Coding
« Reply #2 on: May 15, 2010, 06:17:05 AM »
What part of this is krypt's?
Quote from: Tha Pwned
2:35 PM - La Muerte: pwned + forum = fail
2:36 PM - Tha Pwned: +1
2:36 PM - Tha Pwned: Don't quote

Offline Grim Reaper

  • Level 7 Expert
  • *****
  • Posts: 218
  • WCS Coding helper :)
Re: [Tutorial] Basic Race Coding
« Reply #3 on: May 15, 2010, 07:05:50 AM »
the ultimate xD I edited it to fit in the race...
« Last Edit: May 15, 2010, 06:30:46 PM by Grim Reaper »
Looking for photo :(