January 17, 2018, 07:59:22 AM

Author Topic: Ability  (Read 2542 times)

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Ability
« on: April 13, 2010, 10:20:54 PM »
Hey

i'm trying to make an ability for a race that can spawn props...
The ability should do so it removes a prop, so there should not be any limits on how many props you can remove..

but im not sure how to make an ability so could you help me?

i got this so far ( its not me who have made it, i just found it on a random post so i thougth i would use it):
Code: [Select]
block deleteprop
{
es_xgetcmduserid est_userid
es est_getviewprop server_var(est_userid) propdele
es est_getviewplayer server_var(est_userid) propdele1
if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then es est_dissolve server_var(propdele)
}

If you make it for me, could you then also explain how you did, so i can make it myself another time?

Thank you
« Last Edit: April 13, 2010, 10:46:19 PM by Insane White Tiger »
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Offline gimik

  • Level 7 Expert
  • *****
  • Posts: 316
Re: Ability
« Reply #1 on: April 13, 2010, 11:16:17 PM »
If thats the full block then heres the skill

"Player_say"
"Skillx_setting"     "blah blah"
"Skillx_cmd"     "if (server_var(text) = ability) then es_xdoblock <path> (deleteprop/es_deleteprop)

This way they can type ability, or make a keybind for it.




Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #2 on: April 13, 2010, 11:20:45 PM »
Ah okay nice ;P

But will it delete the last prop he did spawn or will it delete the prop he is pointing on?
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Muse

  • Guest
Re: Ability
« Reply #3 on: April 14, 2010, 07:53:00 AM »
First. You should declare variables.
Code: [Select]
block deleteprop
{
   es_xset est_userid 0
   es_xset propdele 0
   es_xset propdele1 0
   es_xgetcmduserid est_userid
   es est_getviewprop server_var(est_userid) propdele
   es est_getviewplayer server_var(est_userid) propdele1
   if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then es est_dissolve server_var(propdele)
}
If you want make ability you should add this after this:
Code: [Select]
              es wcs_warden server_var(wcs_userid) server_var(wcs_duration) server_var(wcs_dmg) server_var(wcs_radius) server_var(wcs_team_target) server_var(wcs_team_targetn) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) server_var(wcs_wardencounter)
              wcs_getlanguage "wcs_lng" "wcs_lng_wardencreated"
              es_tell server_var(wcs_userid) #multi server_var(wcs_lng)
            }
          }
          es_xmath wcs_ability_count - 1
          es_keysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)
        }
        es_xelse do
        {
          wcs_getlanguage "wcs_lng" "wcs_lng_noability"
          es_tell server_var(wcs_userid) #multi server_var(wcs_lng)
        }
      }
Something that:
Code: [Select]
      if (server_var(wcs_tmp) in "delprops") do
      {
        es_xset wcs_ability_count 0
        es_keygetvalue wcs_ability_count WCSuserdata server_var(wcs_userid) ability_count
        ifx parse("(wcs_ability_count > 0) or (wcs_ability_count == -1)") do
        {
          es_xevent initialize wcs_ability
          es_event setint wcs_ability userid server_var(wcs_userid)
          es_xevent fire wcs_ability
          if (server_var(wcs_tmp) = "delprops") do
          {
            es_xset propdele 0
            es_xset propdele1 0
            es est_getviewprop server_var(wcs_userid) propdele
            es est_getviewplayer server_var(wcs_userid) propdele1
            if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then est_dissolve server_var(propdele)
          }
          es_xmath wcs_ability_count - 1
          es_keysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)
        }
        es_xelse do
        {
          wcs_getlanguage "wcs_lng" "wcs_lng_noability"
          es_tell server_var(wcs_userid) #multi server_var(wcs_lng)
        }
      }
And add player_spawn skill to needed race like that:
Code: [Select]
    "skill3_setting"    "es_xset wcs_count 5|es_xset wcs_count 10|es_xset wcs_count 15|es_xset wcs_count 20|es_xset wcs_count 25"
    "skill3_cmd"        "es_keysetvalue WCSuserdata event_var(userid) ability delprops;es_keysetvalue WCSuserdata event_var(userid) ability_count server_var(wcs_count)"
    "skill3_sfx"        "0"

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #4 on: April 14, 2010, 08:03:29 AM »
okay, thank you for help :)
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #5 on: April 18, 2010, 01:00:01 AM »
hmm i cant get it to work..
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Muse

  • Guest
Re: Ability
« Reply #6 on: April 18, 2010, 09:55:36 AM »
Post codes.

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #7 on: April 18, 2010, 01:14:10 PM »
Well, i have tryed a bit different things to try get it working... this is 1 of them..
Code: [Select]
    "skill3_setting"    "es_xset wcs_count 5|es_xset wcs_count 10|es_xset wcs_count 15|es_xset wcs_count 20|es_xset wcs_count 25"   
"skill3_cmd"        "es_keysetvalue WCSuserdata event_var(userid) ability delprops;es_keysetvalue WCSuserdata event_var(userid) ability_count server_var(wcs_count)"   
"skill3_sfx"        "0"

Code: [Select]
block deleteprop
{
     if (server_var(wcs_tmp) in "delprops") do     
     {       
     es_xset wcs_ability_count 0       
     es_keygetvalue wcs_ability_count WCSuserdata server_var(wcs_userid) ability_count       
     ifx parse("(wcs_ability_count > 0) or (wcs_ability_count == -1)") do       
     {         
     es_xevent initialize wcs_ability         
     es_event setint wcs_ability userid server_var(wcs_userid)         
     es_xevent fire wcs_ability         
     if (server_var(wcs_tmp) = "delprops") do         
     {           
     es_xset propdele 0             
     es_xset propdele1 0             
     es est_getviewprop server_var(wcs_userid) propdele           
     es est_getviewplayer server_var(wcs_userid) propdele1           
     if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then est_dissolve server_var(propdele)         
     }         
     es_xmath wcs_ability_count - 1         
     es_keysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)
     }       
     es_xelse do       
     {         
     wcs_getlanguage "wcs_lng" "wcs_lng_noability"         
     es_tell server_var(wcs_userid) #multi server_var(wcs_lng)       
     }     
     }
     

<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Muse

  • Guest
Re: Ability
« Reply #8 on: April 18, 2010, 01:40:38 PM »
nono.

Find in Wcs_skills this:
Code: [Select]
              es wcs_warden server_var(wcs_userid) server_var(wcs_duration) server_var(wcs_dmg) server_var(wcs_radius) server_var(wcs_team_target) server_var(wcs_team_targetn) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) server_var(wcs_wardencounter)
              wcs_getlanguage "wcs_lng" "wcs_lng_wardencreated"
              es_tell server_var(wcs_userid) #multi server_var(wcs_lng)
            }
          }
          es_xmath wcs_ability_count - 1
          es_keysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)
        }
        es_xelse do
        {
          wcs_getlanguage "wcs_lng" "wcs_lng_noability"
          es_tell server_var(wcs_userid) #multi server_var(wcs_lng)
        }
      }
And AFTER this put that:
Code: [Select]
      if (server_var(wcs_tmp) in "delprops") do
      {
        es_xset wcs_ability_count 0
        es_keygetvalue wcs_ability_count WCSuserdata server_var(wcs_userid) ability_count
        ifx parse("(wcs_ability_count > 0) or (wcs_ability_count == -1)") do
        {
          es_xevent initialize wcs_ability
          es_event setint wcs_ability userid server_var(wcs_userid)
          es_xevent fire wcs_ability
          if (server_var(wcs_tmp) = "delprops") do
          {
            es_xset propdele 0
            es_xset propdele1 0
            es est_getviewprop server_var(wcs_userid) propdele
            es est_getviewplayer server_var(wcs_userid) propdele1
            if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then est_dissolve server_var(propdele)
          }
          es_xmath wcs_ability_count - 1
          es_keysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)
        }
        es_xelse do
        {
          wcs_getlanguage "wcs_lng" "wcs_lng_noability"
          es_tell server_var(wcs_userid) #multi server_var(wcs_lng)
        }
      }
Should be like that:
Code: [Select]
..........
        es_xelse do
        {
          wcs_getlanguage "wcs_lng" "wcs_lng_noability"
          es_tell server_var(wcs_userid) #multi server_var(wcs_lng)
        }
      }
      if (server_var(wcs_tmp) in "delprops") do
      {
        es_xset wcs_ability_count 0
....

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #9 on: April 18, 2010, 01:59:48 PM »
ah okay i will try that
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #10 on: April 18, 2010, 02:24:54 PM »
so like this?

Code: [Select]
          es wcs_warden server_var(wcs_userid) server_var(wcs_duration) server_var(wcs_dmg) server_var(wcs_radius) server_var(wcs_team_target) server_var(wcs_team_targetn) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) server_var(wcs_roundcounter)
          wcs_getlanguage "wcs_lng" "wcs_lng_wardencreated"
          es es_xtell server_var(wcs_userid) #multi server_var(wcs_lng)
          }
          }
          es_xmath wcs_ability_count - 1
          es es_xkeysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)
        }
        es_xelse do
        {
        wcs_getlanguage "wcs_lng" "wcs_lng_noability"
        es es_xtell server_var(wcs_userid) #multi server_var(wcs_lng)
        }
      }
       if (server_var(wcs_tmp) in "delprops") do     
    {       
       es_xset wcs_ability_count 0       
       es_keygetvalue wcs_ability_count WCSuserdata server_var(wcs_userid) ability_count
       ifx parse("(wcs_ability_count > 0) or (wcs_ability_count == -1)") do       
       {         
       es_xevent initialize wcs_ability         
       es_event setint wcs_ability userid server_var(wcs_userid)         
       es_xevent fire wcs_ability         
       if (server_var(wcs_tmp) = "delprops") do         
       {           
es_xset propdele 0           
       es_xset propdele1 0           
       es est_getviewprop server_var(wcs_userid) propdele           
       es est_getviewplayer server_var(wcs_userid) propdele1           
       if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then est_dissolve server_var(propdele)         
       }         
       es_xmath wcs_ability_count - 1         
       es_keysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)       
       }       
       es_xelse do       
       {         
       wcs_getlanguage "wcs_lng" "wcs_lng_noability"         
       es_tell server_var(wcs_userid) #multi server_var(wcs_lng)       
       }     
       }
    }
  }
« Last Edit: April 18, 2010, 02:29:56 PM by Insane White Tiger »
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Muse

  • Guest
Re: Ability
« Reply #11 on: April 18, 2010, 02:37:38 PM »
yes.. I don't know how many "}" in standard wcs

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #12 on: April 18, 2010, 04:59:06 PM »
hmm still cant get it to work...

btw gratz with lvl 7 ;P
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..

Muse

  • Guest
Re: Ability
« Reply #13 on: April 18, 2010, 05:09:22 PM »
Thank you.
Show all your race and all "wcs_ability" block (es_wcsskills).

Offline Insane Tiger

  • Level 7 Expert
  • *****
  • Posts: 225
  • Country: dk
  • Coding Races
Re: Ability
« Reply #14 on: April 18, 2010, 05:16:43 PM »
Code: [Select]
  "1"
  {
    "name"              "Bob the Builder"
    "author"            "Insane White Tiger"
    "shortdescription"  "Can he do it? Yes he can!"
    "required_level"    "0"
    "maximum_level"     "0"
    "allow_only"        "0"
    "teamlimit"         "0"
    "restrict_shop"     "0"
    "preloadcmd"        "0"
    "player_spawn_cmd"  "0"
    "round_start_cmd"   "0"
    "round_end_cmd"     "0"
    "numberofskills"    "4"
    "numberoflevels"    "8"
    "skillnames"        "High spots|Bob got a lot of cars|Destroy prop|What do you want to create today?"
    "skilldescr"        "Gravity to reach the high spots|Speed|Delete prop|Prop Menu"
    "skillcfg"          "player_spawn|player_spawn|Player_say|player_Ultimate"

    "skill1_setting"    "es_xset wcs_gravity 0.92|es_xset wcs_gravity 0.84|es_xset wcs_gravity 0.76|es_xset wcs_gravity 0.68|es_xset wcs_gravity 0.6|es_xset wcs_gravity 0.52|es_xset wcs_gravity 0.44|es_xset wcs_gravity 0.36"
    "skill1_cmd"        "es_delayed 2 est_SetGravity event_var(userid) server_var(wcs_gravity);es_keysetvalue WCSuserdata event_var(userid) gravity server_var(wcs_gravity);wcs_getlanguage wcs_lng wcs_lng_r_levitation;es_tell event_var(userid) #multi server_var(wcs_lng)"
    "skill1_sfx"        "es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(userid);es est_Effect 10 #a 0 sprites/lgtning.vmt server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1) 20 50 2 60 100 0.8 0 20 100 255 1"
   
    "skill2_setting"    "es_xsetinfo wcs_speed 1.10;es_xsetinfo wcs_alpha 50|es_xsetinfo wcs_speed 1.20;es_xsetinfo wcs_alpha 70|es_xsetinfo wcs_speed 1.30;es_xsetinfo wcs_alpha 90|es_xsetinfo wcs_speed 1.40;es_xsetinfo wcs_alpha 110|es_xsetinfo wcs_speed 1.50;es_xsetinfo wcs_alpha 130|es_xsetinfo wcs_speed 1.60;es_xsetinfo wcs_alpha 150|es_xsetinfo wcs_speed 1.70;es_xsetinfo wcs_alpha 170|es_xsetinfo wcs_speed 1.75;es_xsetinfo wcs_alpha 190"
    "skill2_cmd"        "es es_xkeygetvalue wcs_tmp WCSuserdata event_var(userid) speed;es es_xif (server_var(wcs_tmp) > server_var(wcs_speed)) then es_xsetinfo wcs_speed server_var(wcs_tmp);es es_xkeysetvalue WCSuserdata event_var(userid) speed server_var(wcs_speed);es est_Speed event_var(userid) server_var(wcs_speed);es es_xtell event_var(userid) : Bob is driving fast."
    "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_var(wcs_y1) server_var(wcs_z1) 20 60 1 4 2 0 255 100 0 255 0"

    "skill3_setting"    "es_xset wcs_count 5|es_xset wcs_count 10|es_xset wcs_count 15|es_xset wcs_count 20|es_xset wcs_count 25"   
    "skill3_cmd"        "es_keysetvalue WCSuserdata event_var(userid) ability delprops;es_keysetvalue WCSuserdata event_var(userid) ability_count server_var(wcs_count)"   
    "skill3_sfx"        "0"   
   
    "skill4_setting"    "es_xrand wcs_rand 1 10|es_xrand wcs_rand 1 10|es_xrand wcs_rand 1 10|es_xrand wcs_rand 1 10| es_xrand wcs_rand 1 10| es_xrand wcs_rand 1 10| es_xrand wcs_rand 1 10| es_xrand wcs_rand 1 10"
    "skill4_cmd"        "es es_xif (server_var(wcs_rand) <= 10) then es_xdoblock wcs/WCSultimates/prop_menu"
    "skill4_sfx"        "0"
    "ultimate_cooldown" "15|14|13|12|10|7|5|2"
}
Ultimate
Code: [Select]
block prop_menu
{
popup create prop_menu
popup addline prop_menu "What do you want to create?"
popup addline prop_menu "->1. toilet"
popup addline prop_menu "->2. Cinderblock"
popup addline prop_menu "->3. gazebo"
popup addline prop_menu "->4. Vendingmachine"
popup addline prop_menu "->5. microwave"
popup addline prop_menu "->6. sofa"
popup timeout prop_menu view 0
es popup send prop_menu server_var(wcs_userid)
popup select prop_menu 1 wcs/WCSultimates/toilet
popup select prop_menu 2 wcs/WCSultimates/Cinderblock
popup select prop_menu 3 wcs/WCSultimates/gazebo
popup select prop_menu 4 wcs/WCSultimates/Vendingmachine
popup select prop_menu 5 wcs/WCSultimates/microwave
popup select prop_menu 6 wcs/WCSultimates/sofa
}
block toilet
{
es_prop_dynamic_create server_var(wcs_userid)) models/props/cs_militia/toilet.mdl
}
block Cinderblock
{
es_prop_dynamic_create server_var(wcs_userid) props/de_nuke/cinderblock_stack.mdl
}
block gazebo
{
es_prop_dynamic_create server_var(wcs_userid) props/cs_havana/gazebo.mdl
}
block Vendingmachine
{
es_prop_physics_create server_var(wcs_userid) props_interiors/vendingmachinesoda01a.mdl
}
block microwave
{
es_prop_physics_create server_var(wcs_userid) props/cs_office/microwave.mdl
}
block sofa
{
es_prop_dynamic_create server_var(wcs_userid) props/cs_office/sofa.mdl
}
Ability
Code: [Select]
       if (server_var(wcs_tmp) in "delprops") do     
    {       
       es_xset wcs_ability_count 0       
       es_keygetvalue wcs_ability_count WCSuserdata server_var(wcs_userid) ability_count
       ifx parse("(wcs_ability_count > 0) or (wcs_ability_count == -1)") do       
       {         
       es_xevent initialize wcs_ability         
       es_event setint wcs_ability userid server_var(wcs_userid)         
       es_xevent fire wcs_ability         
       if (server_var(wcs_tmp) = "delprops") do         
       {           
       es_xset propdele 0           
       es_xset propdele1 0           
       es est_getviewprop server_var(wcs_userid) propdele           
       es est_getviewplayer server_var(wcs_userid) propdele1           
       if (server_var(propdele1) = 0) then if (server_var(propdele) != propdele1) then est_dissolve server_var(propdele)         
       }         
       es_xmath wcs_ability_count - 1         
       es_keysetvalue WCSuserdata server_var(wcs_userid) ability_count server_var(wcs_ability_count)       
       }       
       es_xelse do       
       {         
       wcs_getlanguage "wcs_lng" "wcs_lng_noability"         
       es_tell server_var(wcs_userid) #multi server_var(wcs_lng)       
       }     
       }
<-[Coding races]->
<3 Abilities and Ultimates
- I'm from Denmark..